uracoli-devel
[Top][All Lists]
Advanced

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

Re: [uracoli-devel] Update and sleep question


From: Joerg Wunsch
Subject: Re: [uracoli-devel] Update and sleep question
Date: Wed, 6 Jun 2012 22:28:12 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

As Vasilakes, Keith wrote:

> It can't be that hard to put it to sleep can it?

For an example implementation that successfully performs "deep sleep",
you can have a look at the "XXO" (short for Tic-Tac-Toe, since you'd
play the game on paper with letters X and O):

http://hg.savannah.gnu.org/hgweb/uracoli/file/35b169b034ee/uracoli-appnotes/linuxtag2012/Src/08_SpielPowerSave/misc.c

Sorry, comments are in German as this was done in order to be handed
out on a German workshop we held in March, 2012, but the actual source
is in English.

The board is a very simple one based on the ATmega128RFA1, and as it
doesn't feature a 32 kHz crystal you could run timer 2 (or the MAC
symbol counter) asynchronously from, the wakeup from deep sleep is
handled by the watchdog timer here.  As a specific feature of the
powersave design in that application, upon wakeup, it simply fires the
watchdog again, now in reset mode, in order to restart the game from
the beginning.

The entire application draws about 2 µA when sleeping, including a
periodic 1-second wakeup to poll for any (touch) button press that is
intended to wakeup the game.

Even though the ATmega128RFA1 is a single-chip transceiver +
microcontroller, the basic steps are the same as for a two-chip
device: first, it must be sure the transceiver can be put to sleep,
then the microcontroller can fall asleep, too.  The main loop itself
also performs a CPU sleep when reaching the bottom of the loop, but
this one is done in idle mode only, just waiting for the next
interrupt to arrive, but with all the MCU clocks running.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

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