Issues receiving "OK" when module wakes up

Hi all,

I have a pairing of a PIC16F1704 and a RN2903A module for a specific application. Both are going to sleep at the same time. The PIC is woken up by its watch-dog-timer and the RN2903 is woken up once an “ok\r\n” message is received. Everything works as designed when I have the watch-dog-timer set to 16,912ms and send “sys sleep 18000” to the RN2903. But, when I increase the timer to make them sleep for a longer amount of time(WDT=67,650ms and “sys sleep 69000ms”), I am not receiving the “ok\r\n” message indicating that the RN2903 has woken up. I would like to get the module to sleep for 10 minutes or so, but so far I can only successfully make it sleep for about 18 seconds without issue.

Why don’t you use the serial communication of the RN module to wake the PIC? (Level change interrupt) That way you do not have these synchronization issues.
(My first guess would be the PIC timing is not 100% accurate due to some error in the configuration, you could check with a led on an output and stopwatch.)

BTW, sys sleep 69000ms will probably give you and error due to the ‘ms’ the RN expects a just number. :wink:

I will attempt the serial communication interrupt. The “ms” in my forum post was a typo, I am not actually sending the “ms” to the module. But thank you anyways!