6
\$\begingroup\$

When using an external xtal/osc with an AVR, you get several startup time options when setting the fuses, such as:

  • 6 CK/14 CK + 0 ms
  • 6 CK/14 CK + 4 ms
  • 6 CK/14 CK + 64 ms

Now... does anyone know if these startup times apply when resuming my AVR from sleep (SLEEP_MODE_PWR_DWN)? Or is it just when starting it for the first time. I want to use a 32.768 kHz watch crystal to keep accurate time, but it seems to me that if there are these startup time issues each and every time after going to sleep then that would make for very unreliable time-keeping.

Using an ATtiny85 if it makes any difference.

\$\endgroup\$
  • \$\begingroup\$ Apparently, the datasheet for the tiny85 is not as verbose as those for other models, where start-up times are explicitly stated (see ATmega128 for instance). I would assume that the start-up procedures are the same for those parts. Plus, whenever the xtal oscillator is stopped it will have to go through the same initialization routine as when the device was powered off, so yes, the same start-up times should apply. \$\endgroup\$ – JimmyB Oct 31 '13 at 12:23
  • \$\begingroup\$ But then it's impossible to implement an RTC using an external 32.768 crystal? How can it keep accurate time if there are random startup delays when going to sleep. Or you'd have to run full-throttle all the time to avoid going to sleep. \$\endgroup\$ – David Högberg Oct 31 '13 at 12:28
  • \$\begingroup\$ How do you plan on keeping time when the crystal is stopped during power-down mode anyway? \$\endgroup\$ – JimmyB Oct 31 '13 at 12:29
  • \$\begingroup\$ Hm, I was planning to use one of the timer/counters. Maybe PWR_DWN is the wrong power saving mode in that case. \$\endgroup\$ – David Högberg Oct 31 '13 at 12:33
  • 1
    \$\begingroup\$ Yes, you'd need to turn it into an oscillator by using a 74LVC1GU04 and two 35pF capacitors, and then run the core off the internal RC oscillator. OTOH, this would free up 1 pin for other purposes. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 31 '13 at 13:40
1
\$\begingroup\$

So it turns out that using an external 32.768 crystal reduces the power consumption of an ATtiny85 a LOT.

Running with an internal 1 MHz clock source and having the AVR sleep most of the time in power down mode - only waking up every 32 ms - it consumes around 62 microamps. However, using a 32.768 crystal as the external clock source, the power consumption is only around 22 microamps, even when running at "full throttle" so to speak (32768 ticks per second with no sleep mode).

So it turns out that running it at that low of a speed cuts down on power consumption so much that you don't actually need to sleep it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.