I tried to do a simple program using the ATmega16 microcontroller, the program is to toggle two LEDs the first one by using timer0 interrupt and the other using timer2 interrupt.
2 Answers
Yes, you can. However there is one thing to note:
Only one ISR can run at once.
That means that if one LED wants to toggle while the other one is in the process of toggling it will have to wait until that first ISR is finished before it can toggle.
For simple LED toggling that won't be noticeable, but it's something you need to bear in mind if you are doing multiple things that require precise timing.
Yes, we can.
(stackexchange wants the body of the answer to be at least 30 characters, so I have to add some filler. Truth is, for answering the question as asked, there is nothing more to say.)