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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/07/09 15:09
Read: times


 
#163196 - Interrupts not working
Hi experts, can suggest why interrupts are nor working when used to catch inputs from tact switches? My main program is a led matrix display, I used external interrupt 1 as enabler of interrupt 2 and interrupt 2 is used to catch the input from keyboard, evrytime time I activate interrupt 1 and 2, i dsbale them to prevent exeuting the more than one, then i used timer 1 to enable both interrupts again. I already used the push and pops to protect the registers. but still, it keeps on hanging and timer 1 does notseem be be working either.
isr0:
debouncer: jnb p3.2,debouncer
jb p3.7,ended
     MOV TMOD,#00100001B
       mov tl0,#0b0h
       mov th0,#03ch
       setb ET0
       setb TR0
	   mov 50h,#00h
	   mov 51h,#00h
	   mov 52h,#00h
	   setb it1
	   setb ex1
   clr it0
	clr ex0
	sjmp tended
ended: clr p3.7
    mov 60h, 50h
	mov 61h, 51h
	mov 62h, 52h
    clr it0
	clr ex0
tended:reti
isr1:
debouncer1: jnb p3.3,debouncer1
mov a, #00fh
 lcall n_delay
	   mov r4, 50h
	   cjne r4,#00h, get2nd
	   mov 50h, p1
	   sjmp Endpoll		  
get2nd: mov r4, 51h
      cjne r4,#00h, get3rd
	   mov 51h, p1
	   sjmp Endpoll
get3rd: mov r4, 52h
       cjne r4,#00h, Endpoll
	   mov 52h, p1
	setb p3.7
	    setb it0
	setb ex0
Endpoll:

reti
tmr0:
       mov tl0,#0B0h
       mov th0,#03Ch



xdec:   djnz counter20,EndInterrupt

       mov counter20,#40

	     mov 50h,#00h
	   mov 51h,#00h
	   mov 52h,#00h
		  clr p3.7
	    clr it1
		clr ex1
	    setb it0
		setb ex0
EndInterrupt: reti	
 



List of 5 messages in thread
TopicAuthorDate
Interrupts not working            01/01/70 00:00      
   EA ?            01/01/70 00:00      
      YEah, i also activated ea.            01/01/70 00:00      
         do not retype ...            01/01/70 00:00      
            Debounce and interrupts            01/01/70 00:00      

Back to Subject List