[TriEmbed] Atmega fast startup

Pete Soper pete at soper.us
Wed Jan 10 10:11:44 CST 2018


I dug up the forum discussion below on AVR Freaks (THE community 
resource for this family of chips). The closest to a money line is here 
(with useful response in the very last post of the thread):

   "What start up time does this result in (would be nice if you gave 
this in number of CK-cycles). We actually wake an ATmega168 from power 
down with the internal clock oscillator running at 4MHz and fuse 
settings like this: CKSE3..0 = 0010 SUT1..0 = 00 (where 0 means 
programmed and 1 means unprogrammed). This results in a start up time of 
approx. 1ms whereas the datasheet claims 6CK for this kind of operation 
which is 1.5us. Do you get a start up time of 6Ck and if so what 
FUSE-settings do you use?"

I'm personally 99% sure they didn't have a means of more precise 
measurement, or else there's a mystery factor that makes my measurement 
lucky by about a factor of three and we're left wondering why the chip 
would need three times as long for a deep sleep wakeup as for a cold start.

But based on my super small sample, if this thread wasn't 11 years old, 
I could jump in with the suggestion that the carefully measured latency 
might turn out to be 300usec for a 328 if the deep sleep wakeup is like 
a cold start but without the supply voltage delay.

The 328 (and other AVR) data sheets beat around the bushes about SUT 
fuse settings with the internal clock, and this made Shane doubtful 
about the various constraints. But I think the different scenarios run 
like this for deep sleep wakeup:

1) External, running clock source an zero startup delay with the fuses: 
the few clocks everybody is dreaming about

2) Internal RC, most likely something like the 300usec for a 328p at 
room temp *or maybe less*, or, if Atmel land is a complete mystery, 
*maybe more*. I didn't do my test from deep sleep wakeup. (aside: is it 
conceivable the RC clock design and behavior would differ between the 
328 and the 168 mentioned in the form thread? Maybe the lack of clear 
documentation suggests some chips DO require a nonzero SUT fuse setting? 
Ugh)

3) External resonator or crystal (I read someplace a resonator starts 
faster). The startup is the same few clocks plus the SUT fuse choices 
that are about how long the crystal or resonator needs to achieve 
resonance and complete stability: 0ms, 4.1ms, or 65ms. Based on what 
I've seen so far, the reliability issue comes into play here: pick a 
startup delay too short for the crystal or resonator and the system is 
flakey.

Note that if you have a vanilla Arduino with the vanilla optiboot 
bootloader there may be an additional, huge delay as the loader listens 
to the serial port for programming instructions and that times out.

http://www.avrfreaks.net/forum/query-wake-power-down-mega16l?skey=0ms%20startup%20delay

-Pete

On 01/10/2018 08:55 AM, Pete Soper wrote:
> This was an experiment to see the best case cold start latency. I got 
> it down to five machine instructions plus the internal startup of the 
> on-chip oscillator so Shane and others in the discussion can see the 
> answers to the questions left hanging: how fast the RC-based clock 
> gets going and whether the latency tends to be deterministic. For one 
> chip, one VCC and one temperature a half dozen repetitions suggest it 
> is deterministic.
> Pete
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20180110/926f924a/attachment.htm>


More information about the TriEmbed mailing list