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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/05/05 15:47
Read: times


 
#86625 - Messing with stack inside interrupt...
Responding to: ???'s previous message
If you don't want to change the port state or the loop of the program code (i.e. you want to react within 2 cycles from the signal arrival and can't afford any more instructions in the loop) you can always do this: Set up a timer interrupt, then perform this in the interrupt routine: Pop the return address (2 bytes), push address of the next instruction after the loop (or whatever routine you want to service the timeout instead) then RETI, the interrupt will cause the program flow to escape the loop as the return won't occur to where the interrupt happened, but wherever the last address on the stack points.


List of 15 messages in thread
TopicAuthorDate
How to escape from an endless loop ?            01/01/70 00:00      
   what is the problem?            01/01/70 00:00      
   Counter            01/01/70 00:00      
      How about another BIT flag            01/01/70 00:00      
         how would you do that            01/01/70 00:00      
         Problem Solved with a combination.            01/01/70 00:00      
   External interrupt            01/01/70 00:00      
      Additional explanation about the problem            01/01/70 00:00      
         loops            01/01/70 00:00      
            Not in the ISR            01/01/70 00:00      
         Answer t o additional explanation            01/01/70 00:00      
   Messing with stack inside interrupt...            01/01/70 00:00      
      Setup stack inside interrupt            01/01/70 00:00      
   I am sure it is good way for you!            01/01/70 00:00      
      Your idea is good.            01/01/70 00:00      

Back to Subject List