No because you're not resetting the memory contents. Your instructions will start over, but you'll have non-initialized ram, which may affect program flow. -Micah On Monday 02 January 2006 1:02 pm, Moataz Hussein wrote: > Thanks all for your advice, I was meaning start of program i.e. full > reset. > > In a book I have it is mentioned > "When an interrupt occurs the value of the program counter is stored in > the stack so that the program returns to where it was when the handling > interrupt is over." > > So is it correct that going to the start (rjmp start) at the end of the > interrupt routine instead of the RETI instruction will not help? > > Moataz > > James Washer wrote: > > when you say "start from the beginning", are you saying you want a FULL > > RESET? > > > > If so, you'd need to build and trigger an external reset hardware, or > > enable the watchdog timer and then just spin until a watchdog reset > > occurs. > > > > - jim > > > > On Mon, 2 Jan 2006 04:19:44 -0800 (PST) > > > > Moataz Hussein <husseinmoataz@yahoo.com> wrote: > >>I am working on a test project on AVR 1200, I have a question regarding > >> the external interrupt. I understand that after the interrupt occurs the > >> interrupt handling routine is called, after it is finished the program > >> goes back to where it has stopped. > >> > >> I have a question: > >> > >> Is it possible and how to; After the interrupt handling routine is > >> completed. Can the program starts from the begining not where it stopped > >> when the interrupt routine was called. > >> > >> Thank for help. > > All you need to do is to jump to the beginning of your program at the > end of the interrupt service routine instead of using the usual RETI > (return from interrupt) instruction. Of course, this depends on how you > initialize things too -- if you start out your program from reset and do > not assume anything is initialized and do the full initialization of > everything, then you should be OK. Just beware of the state of the > interrupt enable. All this is predicated on using assembly language and > not C. > > Don
Message
Re: [AVR-Chat] Interrupt routine
2006-01-02 by Micah Stevens
Attachments
- No local attachments were found for this message.