Cyclic sleep
Cyclic sleep allows the device to sleep for a specified time and wake for a short time to poll its parent for any buffered data messages before returning to sleep again. Enable cyclic sleep mode by setting the SM command to 4 or 5. SM5 is a slight variation of SM4 that allows the device to wake up prematurely by asserting the Sleep_RQ pin(pin 10/SMT, pin 9/TH). In SM5, the XBee device can wake after the sleep period expires, or if a high-to- low transition occurs on the Sleep_RQ pin. Setting SM to 4 disables the pin wake option.
In cyclic sleep, the device sleeps for a specified time, and then wakes and sends a poll request to its parent to discover if the parent has any pending data for the end device. If the parent has buffered data for the end device, or if it receives serial data, the device remains awake for a time. Otherwise, it enters sleep mode immediately.
When the device wakes, it asserts (high) the On/Sleep line, and de-asserted (low) when the device sleeps. If you enable hardware flow control (D7 command), the CTS pin asserts (low) when the device wakes and can receive serial data, and de-assert (high) when the device sleeps.
The following figure shows the XBee sleep pins.
Surface-mount cyclic sleep pins
S2C Through-hole cyclic sleep pins
The following figure shows the cyclic sleep waveforms.
In the figure above, t1, t2, and t3 represent the following events:
- t1 - Time when the device wakes from cyclic sleep
- t2 - Time when the device returns to sleep
- t3 - Later time when the device wakes from cyclic sleep
The wake time and sleep time are configurable with software commands.