XBee S1 receives data after initial config, but won't after shutting off

I’m using XB24-API-001 802.15.4 modules on the 10EF firmware. They each use API mode to talk to their own PIC18F67J50 MCU. The baud rate is 57000. One of them acts as the master and is always transmitting data for the other to receive. If I configure the radio on the one receiving the data then it will successfully receive the data and send it over UART to the MCU for further processing. However, after the device shuts off and power is cut to the module, if I start it back up to receive more data then it won’t get anything useful. The only thing I get is 0xFF right off the bat, and then nothing else after that. If I reconfigure the radio then it will work the first time, but no times after that.

I have several devices that receive data in this way from a central master unit, and only a couple of the devices have this problem. Other devices work just fine and will receive data every time they power up.

Could it be that the radio module is somehow getting its configuration messed up once the power is cut?

Sounds like you are not using the Write Command (WR) to write the settings to the modules flash.

mvut, thanks for the response.

I’m using the ATWR command, but maybe it still isn’t getting saved between power cycles. But other devices don’t have this problem, and work just fine between power cycles. Here are the configuration settings being applied.

rom const unsigned char *rom XBeeConfigTable[] = {
“ATRE”, // Reset to factory defaults
“ATDH0”, // Set hi address
“ATDLFFFF”, // Set lo addres
“ATBD6”, // Set baud rate (57,600 bps)
“ATRN3”, // Delay for clear channel assessment
“ATMM1”, // No acks
“ATCH17”, // Set channel
“ATRO4”, // Set packetization time out
“ATPL4”, // Set power level (4 = 0dBm for XBee)
“ATD61”, // Set flow control on pin 6
“ATCA24”, // Set clear channel assesment threshhold
“ATAP1”, // Set API mode
“ATWR”, // Write changes
“ATCN” // Exit command mode

As long as you are getting the OK back from the WR, it is writing the settings to flash. You can verify that by pulling the module out after this portion of your code runs and then reading back the value in XCTU via an interface board with the module connected to it.

I replaced the radio in that particular device and it’s functioning correctly now. It connects to the master radio every time now. This is a somewhat infrequent problem but it occurs enough that I’d like to figure out a way to resolve it. Are there ways the radio could have been getting reset?

Sure there are built in watchdog resets. There are also commands within the XBee that can cause it to reset such as the Watch Dog Timer, Network Reset and a few others.