IPB


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
jump to main() inside ISR
Digg this topic · Save to del.icio.us · Slashdot It · Post to Technorati · Post to Furl · Submit to Reddit · Share on Facebook · Fark It · Googlize This Post · Add to ma.gnolia · Tag to Wink · Add to MyWeb · Add to Netscape
xolang1
post 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?
Go to the top of the page
 
+Quote Post
marke
post 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,


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   4 koi6456 1,539 11th November 2002 - 06:36 PM
Last post by: koi6456
No New Posts   6 sethar 1,112 20th March 2008 - 06:55 AM
Last post by: Carl
No New Posts   4 FLOW_EE 1,918 15th August 2006 - 08:47 PM
Last post by: FLOW_EE
No New Posts   1 ilmasto 611 3rd October 2006 - 09:17 PM
Last post by: jOmega
No New Posts   8 AB2005 1,133 10th January 2007 - 03:04 AM
Last post by: AB2005



RSS Lo-Fi Version Time is now: 4th December 2008 - 03:15 AM
hosted by : L M Photonics Ltd