Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
one small doubt regarding avr atmega interrupts.When the program enters into the ISR,does it clear interrupt flag corresponding to that ISR only or does it disable all interrupts?
When an interrupt is triggered all interrupts are disabled. You can re-enable them in the ISR if you chose but you better know what other code could be executing, nested interrupts can be quiet complicated, and totally disastrous if you don't take into account the the status register itself is not independent of what else is going on in those ISRs. Generally speaking the FIRST thing an ISR should do is save the Sreg, and the last thing it should do before it reti's is restore the status register.
Might help you a bit.
While the ISR flag might be cleared keep in mind that even if global interrupts are disabled if an event occurs the specific events flag could be set to 1 again, basically causing as re-entrance into the ISR the moment it exits, perhaps not with intended consequences. This is most pronounced on high speed timers with triggers where a second event could occur before the first one is finished processing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.