I’m working on building a terrorist threat level alert light for my apartment, so that I can make the proper decisions about what to wear, whether I should be talking to my neighbors or not, etc. The device mounts on the wall, and has a colored lamp for each threat level. Now, to make this effective, it obviously has to be able to update itself automatically. For example if there was a cataclysmic event that happened when I was in the shower, I would really want to know about it without the hassle of turning on a computer and loading the webpage. So, to accomplish this, I decided to use a pair of xBee modules, one of them to control the device, and the other to connect to a computer and broadcast updates.
So this is all and good, but I didn’t spring for the actual development kit, so I had to figure out how to use the modules on my own. The first task was to upgrade the firmware- the version that came preloaded was rather old, and didn’t support the digital i/o pins that I want to use to control the lights. Connecting the serial inputs and outputs using a MAX3232 (like the MAX232 except it runs at 3.3V) let me talk to the device, but the provided firmware upgrade software X-CTU refused to upgrade the firmware, giving the helpful error message ‘lost communication with modem Write Parameters… Failed’. A google search turned up only some German sites, but no one there had solved the problem either. Now, I had read in the manual that I had to connect DIN, DOUT, RTS and DTR to be able to update the firmware, but it wasn’t clear what direction the signals would be headed. Finally, I found someone who had upgraded firmware using their own hardware, and they were kind enough to post the schematics on their website. It turns out that both RTS and DTR are outputs from the PC, which is fine except that the MAX3232 only has two channels in each direction, so I ended up using a LM7404 hex inverter on those channels (technically, this isn’t the correct way to do serial but it works). With much anticipation, I clicked the write button, and… same error! What the heck! So I looked everything over again, but there didn’t seem to be any problems. Well, I figured I would try hooking up the status LED (pin 13 on the xBee module). Then, it works! I don’t really know why this is the case; I thought maybe my voltage regulator was weak or something, but it was rock solid. Anyway, the LED makes it work so it gets to stay. I’ll post some better pictures and a schematic once I get two of them talking to each other.