Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to return to a particular line after ISR is executed???

Status
Not open for further replies.

saraheem

Newbie level 5
Joined
Dec 21, 2009
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
I am using AT89s51 and programming with embedded C (Keil uVersion4 demo version).
I am writing a program that has a number of routines of which one is called sig_ctrl(). I am also using Interrupt 0 in my proj.

My question is this:

After the ISR is executed i want my program to ALWAYS continue executing from the start of sig_ctrl() routine only and should NOT return to where the program was being executed prior to the interrupt was sensed. If i use a jump (i.e. calling sig_ctrl() ) statement, then the uC will still be inside the ISR only, which i dont want to happen as this might cause trouble. How can this be done...? Pls give ur ideas...

Thank you...
 

Re: How to return to a particular line after ISR is executed

Hi saraheem,

"If i use a jump (i.e. calling sig_ctrl() ) statement, then the uC will still be inside the ISR only"

I don't think so because a jump is an unconditional branching and is different from calling a subroutine. So a simple jump instruction would be enough. Also clear interrupt flags if required.

If not, try doing this: When you reach the ISR, pop the stack and push to the stack the address to which you wish to move once the ISR finishes.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top