jump to main() inside ISR
Posted 28 April 2005 - 04:57 AM
I was thinking of a forced jump instruction... any ideas?
Posted 28 April 2005 - 09:00 AM
I do not know why you would want to jump to main inside an interrupt routine. If you try, you will still be in the interrupt routine until you get to the exit code. You could create all sorts of problems if you were abloe to stack up interrupts.
If you wish to force the exit from interrupt to go to a particular address rather than returning to where the interrupt was called from, you can push the new return address onto the stack before the RETI. You should becareful not to push more than you pop, otherwise you will get a stack overflow.
I use this technique if I want to do a warm boot on an error such as a timeout error.
If you want to let the interrupt routine determine a main line function, you can set up a series of semaphores. In operation, the mainline code continually tests the semaphores, and the interrupt routines set the semaphores.
Perhaps you could give more detail of your requirements and someone may be able to be more specific in the reply.
Mark Empson | administrator
Skype Contact = markempson | phone +64 274 363 067
LMPForum | Power Factor | L M Photonics Ltd | Empson family | Advanced Motor Control Ltd | Pressure Transducers | Smart Relay | GSM Control | Mark Empson Website | AuCom | Soft Starters
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users