Yahoo Groups archive

AVR-Chat

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

Message

Re: mega 168

2005-08-23 by Volkmar Dierkes

Dennis,

I am sorry, but you are wrong. In an interrupt driven system, an
interrupt may occur at any time. If the serving of the interrupt
would end in returning to a different address, the code wouldn't be
executed in the desired sequence. If you want to wait in a loop
until the interrupt is being serviced, you need to set a flag in the
ISR and check this flag in your loop to exit it at the given time.

Please reread the datasheet to understand the interrupts correctly.

Volkmar

On Sun, 21 Aug 2005 21:45:48 -0500, Dennis wrote:

> What I am saying is the next instruction is not being executed. In an 
> interrupt driven system, a loop is waiting for the interrupt. When it 
> happens the process continues from the instruction following the loop. It 
> doesn't go back to the loop, or not supposed to.
> D
> ----- Original Message ----- 
> From: "Larry Barello" <yahoo@barello.net>
> To: <AVR-Chat@yahoogroups.com>
> Sent: Sunday, August 21, 2005 9:33 PM
> Subject: RE: [AVR-Chat] mega 168
>
>
>> If what you are saying is true (and it isn't) then this very common
>> programming idiom won't work since an interrupt on the "rjmp" instruction
>> will cause it to exit.
>>
>> Forever:
>> Rcall DoThisTask
>> Rcall DoThatTask
>> Rcall etc
>> Rjmp forever
>>
>> Please re-read my previous response again.  What is pushed is the address 
>> of
>> the next instruction to execute, not the next address.
>>
>> Cheers!
>>

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.