SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By kburgoyne
#197968
According to the XBee forums, the following is necessary to perform a factory reset of an XBee (S2C):

"The ability to restore a module to factory defaults is the same on ALL XBee modules. You hold the DI low and reset the module. This forces you into command mode at 9600 baud. From there, you can issue an ATRE, WR, CN to Restore to defaults, Write to Flash and Exit command mode."

The ability to do this from software (a driver) is somewhat important in order to maximize infallibility. In particular if "something" goes wrong and the XBee UART protocol gets altered (baud rate, stop bits, etc), being able to perform this sequence from software is critical. It's the type of this a driver would perform during initialization in order to ensure the hardware is in a "known state".

Looking at the XBee Explorer schematic my understanding is the initial factory reset signal (RESET with DI low) cannot be accomplished just from software. Is this correct, or am I overlooking something? In fact it looks like there is no "nice" way to perform it manually since DIN cannot be held low (without using a jumper wire) when the RESET button is pressed.

If this is all true and I'm not overlooking something, might I suggest an "upgrade" to future XBee Explorers revs that maybe just has a jumper to connect (directly or indirectly) RESET to DIN? The jumper would facilitate backwards compatibility for those who need it. I personally think if the manual RESET button is being pressed, it might as well perform the maximum reset and ensure the baud rate is restored to 9600. The RESET button seems like a "last resort" operation.

Another nice "upgrade" might be to just have a jumper to cause the normal power-on RESET to be a factory reset (holds DIN low during reset). In this configuration software would always assume the device was powering-on in a factory reset state and needed to be fully configured -- which is usually the most reliable situation anyway for a driver.

Has anyone at SparkFun perhaps already invented any circuit hacks to the XBee Explorers to allow a software initiated or power-on factory reset?
By Valen
#198034
Which Xbee Explorer board are you talking about? The Explorer USB has a reset switch. But the Explorer regulator does not.

On the Explorer Regulator board you can connect a wire from a GPIO pin (of whatever microcontroller you fancy) to the RST pin of the Xbee to let it go into reset. (mind the 3.3 volt protection requirement!) You should also be able to change the register settings of the microcontroller TX pin to make it work as a GPIO pin to go low at the same time as reset. If you time it right, just sending 0x00 with slow enough baudrate chould also result in a long enough low pulse to coincide with a releasing RST pin. The important part is that Din is kept low while RST is allowed to go high again. It does not require that both are connected together. Atleast that how I interpret your understanding of the matter.

If you are talking about the Explorer USB then it becomes a bit more complex to switch the FT231 TX pin low. It probably requires software interaction with the OS/serial port driver of the FT231. Again, sending a slow enough 0x00 character might suffice as a Din low pulse. As the reset switch is not connected to any GPIO pin of the FT231 you'll have to hack a connection yourself. That is, it's already there. Infact 3 of them, RTS,CTS and DTR. You just need some fine soldering to wire from the cut-through solder-jumper to the reset pin hole on the board. I never programmed it myself but the serial port driver in the OS should enable switching of the RTS,CTS and DTR lines more easily. I don't see why the board needs a pin breakout. It's all there!