I was just writing some PIC code and was experimenting with interrupts.
I was wondering, if the main PIC program is waiting (say for a second), in that second will the PIC still carry out the interrupt sub-routine?
If you do not understand what I am saying please ask!
I was just writing some PIC code and was experimenting with interrupts.
I was wondering, if the main PIC program is waiting (say for a second), in that second will the PIC still carry out the interrupt sub-routine?
If you do not understand what I am saying please ask!
So if the main program is waiting it will still call the interrupt and then go back to where the delay was at. So say if it was half way through a 6 second delay, it would then call the interrupt, the carry on for the rest of the delay?
So if the main program is waiting it will still call the interrupt and then go back to where the delay was at. So say if it was half way through a 6 second delay, it would then call the interrupt, the carry on for the rest of the delay?
hi,
Thats the way it works.
Its a good idea to keep the work time as short as possible within an ISR.
Set flags as required within the ISR and service them in the main program.
The main program doesn't really call it, it's called by something in hardware - a timer, a communications port, end of A/D conversion, that kind of thing.
the delay will normally be a bit longer that it should be due to the isr whcih is not accounted for ( unless it is based on a timer.... not the usual case )