[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [uracoli-devel] Sleeping
From: |
Joerg Wunsch |
Subject: |
Re: [uracoli-devel] Sleeping |
Date: |
Wed, 16 May 2012 18:02:04 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
As Vasilakes, Keith wrote:
> I see the radio drawing about 5-6 ma, and if I try to put it o sleep
> I gt it down to 4...WAY too high!
There must be something wrong. I'm using a comparable sequence to
yours on an ATmega128RFA1 (and previously also on an ATmega1281 from a
Zigbit module), and the sleep current drops down to ~ 1 µA. It's a
temperature sensor I'm using to monitor the outside temperature, and
it wakes up only once per 300 s. (On that ATmega128RFA1 board, I
don't even have a 32 kHz crystal, so I had to use the watchdog
oscillator to wake up. Works too.)
> set_sleep_mode(SLEEP_MODE_PWR_DOWN);
> cli();
> sleep_enable();
> sei();
> radio_set_state(STATE_SLEEP);
> sleep_cpu();
> sleep_disable();
No need for the complicated individual sleep_* functions. Just
calling sleep_mode() is the "do everything" function for it.
> there is a timer running off the 32k clock to wake it up...
If you had really put the device to power-down mode, this would turn
off the 32 kHz clock, too. You need power-save mode. So if your
device continued to work anyway, it's a good indication you did not
put the CPU to sleep at all. ;-)
Make sure the OCDEN fuse it set to `1' (ie., turned off). While
it's enabled, the main clock doesn't turn off since the debugging
interface needs it. Note that debuggers (AVR Studio, AVaRICE)
have a tendency to automatically enable this fuse.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)