Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/21/04 14:43
Read: times


 
#65263 - help please
dear friends
i had write a program which utilieze the 2 interrupts of atmel at89c52 microcontroller but it dosn't work i first write a program for every interrupt ans try it alone and it works but when i combine the two programmes the it dosn't work and i don't know why could you please take a look at it and tell me why
yours
mohamed
the code is
ORG 0000H
LCALL START
ORG 0003H
LJMP ISR2
ORG 000BH
LJMP DEBOUNCE
ORG 0013H
LJMP ISR
ORG 0050H
ISR2:
CLR EX0
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
MOV A,R1
INC A
MOV R1,A
RANGE2:CJNE R1,#01H,RANGE3
SETB P3.5
CLR P3.6
CLR P3.7
LJMP ER2
RANGE3:CJNE R1,#02H,RANGE4
CLR P3.5
SETB P3.6
CLR P3.7
LJMP ER2
RANGE4:CJNE R1,#03H,RANGE5
SETB P3.5
SETB P3.6
CLR P3.7
LJMP ER2
RANGE5:CJNE R1,#04H,RANGE6
CLR P3.5
CLR P3.6
SETB P3.7
LJMP ER2
RANGE6:CJNE R1,#05H,RANGE7
SETB P3.5
CLR P3.6
SETB P3.7
LJMP ER2
RANGE7:CJNE R1,#06H,RANGE8
CLR P3.5
SETB P3.6
SETB P3.7
LJMP ER2
RANGE8:CJNE R1,#07H,RANGE1
SETB P3.5
SETB P3.6
SETB P3.7
LJMP ER2
RANGE1:CJNE R1,#08H,RANGE2
MOV A,#00H
MOV R1,A
CLR P3.5
CLR P3.6
CLR P3.7
LJMP ER2
ER2:RETI
ORG 0250H
DEBOUNCE:
CLR TF0
CLR TR0
JNB EX1, STEX1
JNB EX0,STEX0
STEX1:SETB EX1
LJMP ER3
STEX0:SETB EX0
LJMP ER3
ER3:RETI
ORG 0350H
ISR:
CLR EX1
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
MOV A,R0
INC A
MOV R0,A
SINE:CJNE R0,#01H,TRIANGLE
CLR P1.0
SETB P1.1
LJMP ER1
TRIANGLE:CJNE R0,#02H,SQUARE
SETB P1.0
CLR P1.1
LJMP ER1
SQUARE:CJNE R0,#03H,SINE
MOV A,#00H
MOV R0,A
CLR P1.0
CLR P1.1
LJMP ER1
ER1:
RETI
ORG 0500H
START:
MOV R0,#00H
MOV R1,#00H
MOV SP,#02FH
MOV IE,#087H
MOV TMOD,#01H
MOV IP,#07H
SETB IT1
SETB IT0
END


List of 8 messages in thread
TopicAuthorDate
help please            01/01/70 00:00      
   RE: meaningless subject            01/01/70 00:00      
   RE: help please            01/01/70 00:00      
   RE: help please            01/01/70 00:00      
      Take care of yourself..            01/01/70 00:00      
         RE: Take care of yourself..            01/01/70 00:00      
            None of which brings us to...            01/01/70 00:00      
               RE: None of which brings us to...            01/01/70 00:00      

Back to Subject List