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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/09/03 06:56
Read: times


 
#58127 - RE: Want to insult us? -100 points!
Responding to: ???'s previous message
I am assuming that your buttons, when pressed, pulls the port bit to ground. Near the end of your T0_ISR you are performing several bit manipulations, one of which, ANL A,T0_STATE, destroys the data you have developed.
First pass, P1 = 1111 1110 , button 1 pressed.
during START, T0_TEMP = 1111 1111, T0_STATE = 1111 1111

MOV A,P1          A=1111 1110
XCH A,T0_TEMP     A=1111 1111   T0_TEMP=1111 1110
XRL A,T0_TEMP     A=0000 0001
JNZ T0_ISR_END    exit & wait next interrupt

Second Pass
MOV A,P1          A=1111 1110  (button still pressed)
XCH A,T0_TEMP     A=1111 1110   T0_TEMP=1111 1110
XRL A,T0_TEMP     A=0000 0000
JNZ T0_ISR_END    A=0, no jump
MOV A,T0_TEMP     A=1111 1110
XCH A,T0_STATE    A=1111 1111  T0_STATE=1111 1110
XRL A,T0_STATE    A=0000 0001
ANL A,T0_STATE    A=0000 0000  ???????
ORL T0_FLAGS,A    T0_FLAGS unchanged
(exit)


Perhaps by eliminating the ANL instruction your button routine may work.
One minor point, your comments indicate that Timer 0 is to be 16 bit but your TMOD value sets it up for 8 bit, auto reload, which is apparently what you want.

Hal

List of 9 messages in thread
TopicAuthorDate
Timer 0 interrupt problem ?            01/01/70 00:00      
   RE: Timer 0 interrupt problem ?            01/01/70 00:00      
   Want to insult us? -100 points!            01/01/70 00:00      
      RE: Want to insult us? -100 points!            01/01/70 00:00      
         RE: Want to insult us? -100 points!            01/01/70 00:00      
            RE: Want to insult us? -100 points!            01/01/70 00:00      
            RE: Want to insult us? -100 points!            01/01/70 00:00      
               RE: Want to insult us? -100 points!            01/01/70 00:00      
   RE: Timer 0 interrupt problem ?            01/01/70 00:00      

Back to Subject List