Use XBee modules for programming flash?

Hello all,

I will be deploying my RCM devices w/ XBee modules attached in the field soon and had an idea for updating code “remotely.” Can the XBee modules be tied to Serial port A in a way that would allow me to use Dynamic C to flash new code to the device using another XBee tied to the serial port on my PC? I know this isn’t exactly remote, not like one could do with the Ethernet connection, but I won’t be using Ethernet on these devices. This method would allow me, however, to simply be in proximity to the devices. Anyway, would such a thing be possible? Or does the programming cable provide something that I couldn’t provide with such a setup?

If this isn’t feasible, is there another good option for flash reprogramming that wouldn’t require physical access?

Thanks,
Jon

Hi Jon,

If programming the module was as easy as connecting serial signals to port A this would work quite easily. Unfortunately, there are a few more signals involved. The other 4 signals used during programming are SMODE0 & 1, RESET and STATUS. The SMODE0 & 1 lines are tied high by the programming connector, that is why there are two connectors on the programming cable, one labeled PROG and the other DIAG. The DIAG connector has the two SMODE lines and the RESET line disconnected. During programming, the RESET line is tied to the serial ports DTR line through a diode (which allows the board to assert the RESET signal as well). The STATUS line is fed back on the DSR line to Dynamic C. Now not all hope is lost, the X-Bee module has several digital I/O lines that could be used to enable and feed back the necessary signals to emulate a programming cable. The tricky part would be either interfacing this to Dynamic C, or writing a custom programmer application to work with the X-bee link. It is a good idea, and I will submit a suggestion to create an Xbee based programming link that would be directly supported in Dynamic C, which would not only allow downloading, but remote debugging of the system. If you are determined to try this on your own, I would recommend looking at the programming cable schematic on our website. You can find it here under Accessories & Peripherals:
http://www.rabbitsemiconductor.com/docs/

Hope this answers your question.

Bill,

Thanks so much for you quick reply!

After posting my question earlier, I began digging a bit deeper into a possible answer in the docs. I discovered the SMODE0/1, RESET and STATUS requirements. I also starting thinking about the requirements imposed by the ZigBee protocol, etc.

I realized that in order for a given RCM-attached XBee module to talk back to a PC-attached XBee module (used for programming in this scenario), it would need to have it’s target module set up prior to programming. You see, in my standard deployment, each RCM-attached XBee module will be set to talk back to a given ZigBee coordinator node. I figure I can implement in my program a feature that would allow me to initiate “programming mode.” This would set the ZigBee target node to the specified node and perhaps (I imagined) set the SMODE0/1 pins high (using an I2C 9-bit Non-volatile I/O expander already present in my design). The only thing about this idea is that I’m not sure about timing issues. Can I set these pins high like this? Will the BIOS wait indefinitely for Dynamic C to come along and start programming? Would a custom BIOS be required?

It seems that using the DIO pins of the XBee to supply SMODE0/1, RESET and STATUS control makes the most sense, but if I understand you correctly, this would require some accommodations on the part of Dynamic C, correct? (or a custom programming app)

Another wrinkle may be the XBee firmware, itself. It seems that the ZigBee firmware doesn’t have the same I/O features of the 802.15.4 firmware, so we would be limited to DTR and CTS/RTS signals. Would this be sufficient? And would it still require modifications to DC?

Also, could this operate at 9600bps? Would I need to use 115,200?

I’ve looked at the programming cable schematic and it was helpful. It seems like this is doable. I would love to see Rabbit build this into DC and would be willing to help in any way I can. Let me know.

Thanks again,
Jon