Sleep Mode isn't Sleeping

Hi All,

I am using the code for sleep mode found on: Arduino, Zigbee and Embedded Development: Sleeping Arduino - Part 4 Wake Up Via Internal Timer. My device is a ATmega328.

The timer and interrupt work, but I do not believe that my device is actually going to sleep. How I understand it, the command sleep_mode() should take the duration that the device is sleeping for, however mine only takes a millisecond or so.

Does anyone else have any experience with this? Any help would be appreciated.

How I understand it, the command sleep_mode() should take the duration that the device is sleeping for

No, it just puts the Arduino to sleep mode. You have to ensure that it wakes up again. Usually this is done by an interrupt which may have different sources. If you're interested in that, take a look at Nick Gammon's page about the topic:

If it's only sleeping for a millisecond it is quite likely that Timer 0 is kicking in and cancelling sleep.

Solved. See Arduino, Zigbee and Embedded Development: Sleeping Arduino - Part 4 Wake Up Via Internal Timer for details.