I am using the Digi XBee-PRO DigiMesh 2.4 RF module in an embedded application. It is using an Atmel Xmega 8-bit microprocessor as a host processor. I use the Digi modules DIN/DOUT lines for serial UART communications with the Xmega host processor, RTS/CTS for flow control, and SLEEP_RQ (pin 9) and SLEEP (pin 13) pins for controlling and detecting the sleep state of the Digi module. I am using asynchronous pin sleep mode (SM = 1) and am configuring CE=2 (end device) D8=3 (DIO8/SLEEP_RQ pin as digital input, monitored) and D9=1(DIO9/ON/SLEEP as ON/SLEEP status pin) on the Digi module.
The device operation is as follows. The device sends a message to our server via a Digi ConnectPort X2 gateway, at random times, but on average once every 2 seconds. The host processor wakes up the Digi module when it needs to send a message to our server by pulling the SLEEP_RQ pin low. It then sends the message to the Digi module over the UART (using API frames). When done with sending the message over the UART, the host processor pulls the SLEEP_RQ pin high to put it to sleep again. The Digi module stays asleep till the host processor needs to send another message to our server.
This seems to work for arbitrary lengths of time, sometimes for an hour or two, sometimes even over a day, but eventually, the Digi module gets into a state where it no longer wakes up, even through the SLEEP_RQ line is constantly pulled low by the host processor. This is obvious as the SLEEP status pin on the Digi module continues to stay low, indicating that it is stuck in sleep mode.
In this stuck in sleep mode state, if I force the SLEEP_RQ pin to toggle high and then low, the Digi module recovers and is able to start working normally again.
Can anyone please shed some light on why the Digi module gets stuck in sleep mode, and what can be possibly be done to avoid it. Are there any timing requirements that must be followed when pulling SLEEP_RQ low or high?
Any help with this would be greatly appreciated.