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?