Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Interrupt routine

2006-01-03 by dlc

The ONLY way to return to where the interrupt occurred is to use a RETI 
instruction.

DLC

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
>     & gt;
>      > 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
> 
>     -- 
>     Confidence is the feeling you have before you really understand the
>     problem.
> 
> 
> ------------------------------------------------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars 
> <http://us.rd.yahoo.com/mail_us/taglines/photos/*http://pg.photos.yahoo.com/ph//page?.file=calendar_splash.html&.dir=>. 
> Add photos, events, holidays, whatever.
> 
> SPONSORED LINKS
> Atmel avr 
> <http://groups.yahoo.com/gads?t=ms&k=Atmel+avr&w1=Atmel+avr&w2=Microcontrollers&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s=90&.sig=a_VWnyFlgM4nNSKwYg7V3Q> 
> 	Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Atmel+avr&w2=Microcontrollers&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s=90&.sig=b26gH7zUN4MtXbR94lbbng> 
> 	Intel microprocessors 
> <http://groups.yahoo.com/gads?t=ms&k=Intel+microprocessors&w1=Atmel+avr&w2=Microcontrollers&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s=90&.sig=lPUnRqJx7nqw1wyiyGpciw> 
> 
> Pic microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Atmel+avr&w2=Microcontrollers&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s=90&.sig=FQZsK0YJzN30czaApcXA-A> 
> 
> 
> 
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
> 
>     *  Visit your group "AVR-Chat
>       <http://groups.yahoo.com/group/AVR-Chat>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        AVR-Chat-unsubscribe@yahoogroups.com
>       <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
> 
> 
> ------------------------------------------------------------------------
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.