End Device configuration
XBee end devices support four different sleep modes:
- Pin sleep
- Cyclic sleep
- Cyclic sleep with pin wake-up
- MicroPython sleep (with optional pin wake). For complete details see the Digi MicroPython Programming Guide.
Pin sleep allows an external microcontroller to determine when the XBee 3 Zigbee RF Module sleeps and when it wakes by controlling the SLEEP_RQ pin. In contrast, cyclic sleep allows the sleep period and wake times to be configured through the use of AT commands. Cyclic sleep with pin wake-up is the same as cyclic sleep except the device can be awakened before the sleep period expires by lowering the SLEEP_RQ line. The SM command configures the sleep mode. The end device continues to stay awake as long as DTR is held low. The device resumes its sleeping pattern upon driving DTR high again.
In both pin and cyclic sleep modes, XBee end devices poll their parent every 100 ms while they are awake to retrieve buffered data. When the end device sends a poll request, it enables the receiver until it receives an acknowledgment from the parent. It typically takes less than 10 ms between sending the poll request to receiving the acknowledgment. The acknowledgment indicates if the parent has buffered data for the end device child. If the acknowledgment indicates the parent has pending data, the end device leaves the receiver on to receive the data. Otherwise, the end device turns off the receiver and enter idle mode (until it sends the next poll request) to reduce current consumption (and improve battery life).
Once the device enters sleep mode, the On/Sleep pin (Micro pin 25/SMT pin 26) it de-asserts (low) to indicate the device is entering sleep mode. If the device enables CTS hardware flow control (D7 command), it de-asserts (high) the CTS pin (Micro pin 24/SMT pin 25) when entering sleep to indicate that serial data should not be sent to the device.
If the Associate LED pin is configured (D5 command), the associate pin is driven low to avoid using power to light the LED. The SLEEP_RQ pin is configured as a pulled-down input so that an external device must drive it low to wake the device. All other pins are left unmodified during sleep so that they can operate as previously configured by the user. The device does not respond to serial or RF data when it is sleeping.
Applications that must communicate serially to sleeping end devices are encouraged to observe CTS flow control.
When the device wakes from sleep, it asserts (high) the On/Sleep pin, and if it enables flow control, it also asserts (low) the CTS pin. The associate LED and all other pins resume their former configured operation. If the device has not joined a network, it scans all SC channels after waking to try and find a valid network to join.
PDF
