XBee® Wi-Fi RF Modules
© 2013 Digi International, Inc. 48
5. Sleep
The XBee Wi-Fi module supports two different sleep modes.
• Pin Sleep
• Cyclic Sleep
In addition the sleep mode current draw can be modified with the following sleep
options.
• AP Associated Sleep
• Deep Sleep
Pin sleep allows an external microcontroller to determine when the XBee should sleep
and when it should wake by using either the SleepRq pin (default) or the SPI_nSSEL pin.
In contrast, cyclic sleep allows the sleep period and wake times to be configured
through the use of AT commands. The module can stay associated to the access point
or can enter a deeper sleep and associate to the access point for each sleep/wake
occurrence. The sleep mode is configurable with the SM and SO commands.
Besides the four sleep modes mentioned above, each of them operate a little differently
based on the serial interface (UART or SPI).
Using Sleep Mode: UART
When the serial interface is UART, the On/nSleep pin is used to indicate that the module
is entering sleep mode, unless it is configured for a different usage. (See command
reference table) If D9 is configured for On/nSleep, then it is driven low when asleep and
high when awake, whether using pin sleep or cyclic sleep.
If CTS hardware flow control is enabled (D7 command), the CTS pin is de-asserted (high)
when entering sleep to indicate that serial data should not be sent to the module. The
module will not respond to serial or RF data when it is sleeping. Applications that utilize
the UART are encouraged to observe CTS flow control in any of the sleep modes. When
the XBee wakes from sleep with flow control enabled, the CTS pin is asserted (low).
If using pin sleep, D8 must be configured for SleepRq (See command reference table) to
put the module to sleep. Otherwise, there is no sleep at all, meaning the module will
always stay awake in full power mode. When D8 is configured for SleepRq, the host
should drive SLEEP_RQ high to put the module to sleep, and the host should drive
SLEEP_RQ low to wake up the module.
Using Sleep Mode: SPI
When the serial interface is SPI, SPI_nATTN is used as an attention indicator to tell the
SPI master when it has data to send. Since SPI only operates in API mode, it will assert
SPI_nATTN and send out a modem status indicator after initialization. The host can use
this to know when the radio is ready to operate as a SPI slave. Since the function of
SPI_nATTN is to indicate when the XBee has data to send to the host, it may legitimately
be driven high or low while the module is awake.