Continue to Site

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.

  • 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.

Regarding interrupt service routine

Status
Not open for further replies.
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.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top