avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] why does ISR not always seem to run on wake from sleep?


From: Britton Kerin
Subject: Re: [avr-chat] why does ISR not always seem to run on wake from sleep?
Date: Wed, 9 Nov 2016 12:03:01 -0900

On Wed, Nov 9, 2016 at 12:20 AM, Erik Christiansen
<address@hidden> wrote:
> On 08.11.16 15:55, Britton Kerin wrote:
>> Having thought about this more I believe the root of the problem is
>> shown in Fig-1 of the ATMega328P datasheet.
>
> Fig 17-1 on p87, I guess.
>
>> When sleeping the clock is stopped, and when idle I think clk is shut
>> off to the input circuit of 17-1, but in either case pin change
>> detection can occur, so obviously it isn't happening due to that
>> circuit.
>
> According to Table 14-1, clkIO is active in Idle mode, and pin change
> wake-up is effective if unmasked. OK, Fig 17-1 only shows the clock as
> "clk", so the two do not corroborate well.

True, but clkIO is not on in e.g. power down mode, so either the wake up
mechanism for the modes is different (which is not documented and seems
highly weird and unlikely), or the wake-up mechanism is independent of
all clocks, because according to section 14.6 power-down "basically halts
all generated clocks, allowing operation of asynchronous modules only".

I posted more details about this problem here:

http://www.avrfreaks.net/forum/atmega328p-datasheet-bug-pin-change-isrs-arent-always-called-wake

[snip]

> Have you tried filling all unused vector table slots with a vector to a
> third LED blinker, so that if (inexplicably) another interrupt is
> enabled and occasionally waking the system, you'll know? (It is nearly
> 20 years now since that scenario caused me some debugging effort.)

Great idea, I'll try this.

Britton



reply via email to

[Prev in Thread] Current Thread [Next in Thread]