jump to main() inside ISR |
![]() ![]() |
jump to main() inside ISR |
Apr 28 2005, 04:57 AM
Post
#1
|
|
|
Junior Member ![]() ![]() Group: Members Posts: 9 Joined: 23-September 03 From: Baguio City Member No.: 498 |
In codevision 1.23, how does one jump from the interrupt subroutine to main()? I'd like to a code that will uses a timer to time 2 seconds after a certain event in main() occurs. when s secs is seen in the interrupt subroutine, it executes some code lines then if should go back to a certain line in the main code other than the point where the interrupt routine goes...
I was thinking of a forced jump instruction... any ideas? |
|
|
|
Apr 28 2005, 09:00 AM
Post
#2
|
|
|
Posting Freak ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 2,099 Joined: 24-April 02 From: Christchurch, New Zealand Member No.: 1 |
Hello xolang1
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. Best regards, -------------------- Mark Empson administrator
Skype Contact = markempson | phone +64 274 363 067 LMPForum | LMP Tech Warehouse | L M Photonics Ltd | Empson family | Advanced Motor Control Ltd | LMP Software | Mark Empson Website |
|
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
4 | koi6456 | 1,539 | 11th November 2002 - 06:36 PM Last post by: koi6456 |
|||
![]() |
6 | sethar | 1,112 | 20th March 2008 - 06:55 AM Last post by: Carl |
|||
![]() |
4 | FLOW_EE | 1,918 | 15th August 2006 - 08:47 PM Last post by: FLOW_EE |
|||
![]() |
1 | ilmasto | 611 | 3rd October 2006 - 09:17 PM Last post by: jOmega |
|||
![]() |
8 | AB2005 | 1,133 | 10th January 2007 - 03:04 AM Last post by: AB2005 |
|||
|
Lo-Fi Version | Time is now: 4th December 2008 - 03:15 AM |