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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/30/03 06:53
Read: times


 
#46980 - RE: Interrupt inner working
Responding to: ???'s previous message
Sorry Raghu, but it's not as dangerous and scary as you make it sound. An interrupt of the same source is not going to interrupt itself. Only when the programmer makes a mess of it will things happening in interrupts disturb... well... other things. What Tahir should remember is that the CPU can only execute ONE INSTRUCTION AT ANY GIVEN TIME. So when it's busy with an instruction in the isr, it can not be doing an instruction in the main loop at the same time. Instructions in isrs are just normal instructions. So if you change the satus of for instance a port pin in an isr, the pin status will have changed from that moment on. If the interrupt happened in the middle of a piece of code in your main loop which was busy checking that pin, you have a typical bug. So if you want to do something in your main loop which might get disturbed by isrs, or vice versa do this:

clr ea
;do sensitive stuff here
setb ea

That way, things stay predictable.


List of 9 messages in thread
TopicAuthorDate
Interrupt inner working            01/01/70 00:00      
   RE: Interrupt inner working            01/01/70 00:00      
      RE: Interrupt inner working            01/01/70 00:00      
         RE: Interrupt inner working            01/01/70 00:00      
         RE: Interrupt inner working            01/01/70 00:00      
            RE: Interrupt inner working            01/01/70 00:00      
   RE: Interrupt inner working            01/01/70 00:00      
   RE: Interrupt inner working            01/01/70 00:00      
      RE: Interrupt inner working            01/01/70 00:00      

Back to Subject List