esp8266 sleep modes

The esp8266 marketing summary gives the following information on the available sleep states:

OFF: CHIP_PD pin is low. The RTC is disabled. All registers are cleared.
DEEP_SLEEP: Only RTC is powered on the rest of the chip is powered off. Recovery memory of RTC can keep basic Wi-Fi connecting information. (NOTE: system_deep_sleep)
SLEEP: Only the RTC is operating. The crystal oscillator is disabled. Any wakeup Sleep XTAL Off events (MAC, host, RTC timer, external WAKEUP events interrupts) will put the chip into the WAKEUP state.
WAKEUP: In this state, the system goes from the sleep states to the PWR state. The crystal oscillator and PLLs are enabled.
ON state: the high speed clock is operational and sent to each block enabled by the clock control register. Lower level clock gating is implemented at the block level, including the CPU, which can be gated off using the WAITI instruction, while the system is on.

But the publicly available SDK documentation is a little hazy on how you should enter these states. There’s one function in the SDK system_deep_sleep(uint32 time_in_us), which will power the system down for a given number microseconds (this is DEEP_SLEEP), after which the system will require full reinitialization. The marketing summary suggests that the power consumption in this state, with only the RTC active should be 10uA.

The following inline assembly also compiles:

asm ("waiti 0\n");

But I’ve yet to test it. This theoretically should turn off the CPU (I guess waking it on interrupt?). I’ve not yet seen anything which suggests how to enter WAKEUP or SLEEP states.

Please drop me a mail or leave a comment if you come across any information.

UPDATE: Version 0.9.5 of the espressif SDK has been updated to add a function called: system_deep_sleep_set_option this appear to allow the device to wake up in a lower power mode where the Wifi is off.

This is a continuation of my notes on the esp8266 microcontroller, you can find a complete list of my esp8266 posts here