0 comments Thursday, December 3, 2009

I've recently worked on using XBee(Zigbee) modules for doing wireless communication with the XMOS XC-1 development board. As you may have noticed on the photo, I'm using Arduino breakout boards. These do the  voltage conversions from 5 to 3.3 Volt. One of them is directly connected with the XC-1 using a breadboard. The other one is plugged in an empty Arduino board. Its jumpers are placed to USB mode to enable direct IO with my PC.



On the XMOS chip runs a program which allows to set the clock leds to different shades of orange (varying from red to green actually). Therefor it reads commands from the XBee module, logically being 'r' and 'g'. In the video below you can see how it looks like:







This is how it works behind the scenes:



On the PC side, the XBee module appears as a serial device thanks to the FTDI chip on the Arduino board. When typing a command ('r' or 'g'), it is automatically sent in ascii by the XBee. The other module receives it and sends it to the XMOS chip. This one supports 10 colors ranging from green (value zero) to red (value 10). When the XMOS chip gets a command it will calculate the new value and send it back to the PC via the wireless connection.
The XMOS chip will drive its red and green leds according to the value mentioned above. For example, value 4 means that red will be on for 4 ms and green for 6 ms, creating a shade of orange.