Programming XRF with new firmware

I have been playing around with the XRF wireless module from CISECO. They come with firmware which makes the XRF act like a serial link (ie. serial data sent in one end will come out of another XRF in range). This is a typical set-up and how I have used them before.

Other firmware has also been developed which allows the XRF to do different things. One version of the firmware is used along with a relay board to turn the XRF into a remote controlled switch (using the relay board from CISECO). This uses the aProtocol, details of which are here. For one project I needed to do this. This post is basically my notes on how I went about uploading the new firmware onto the XRF, which might be useful to other folk doing something similar. Note: This if for the newer XRF v1.5 and on a Windows 7 machine (sorry, open source folk…)

The XRF is based on the Texas Instruments CC1110 microcontroller. Like all microcontrollers this can be re-programmed with different code. The XRF has a bootloader on it which allows the easy upload of different firmware. As already mentioned the standard firmware is the serial link.

To reprogram the XRF you will need an FTDI to XRF connector. This is basically a USB to TTL connector, similar to that used for the Arduino (‘proper’ Arduinos have this on-board). But the Arduino runs at 5V, whereas the XRF runs at 3.3V, so you must use the correct connector. I bought this one from CISECO.

To use this you need the XCM (XRF Config Manager), following the instructions here:

http://openmicros.org/index.php/articles/84-xrf-basics/105-xcm-software-config-for-the-xrf

Running the setup.exe installs the XCM to the program list and also runs the program.

I then plugged in the USB interface for the XRF. This installed the device driver successfully.

To do an initial test I clicked the ‘Search’ button on the XCM, which should find all XRF modules on any COM port. It found the device I had connected.

I then clicked ‘Download Config’ to find the config parameters already programme onto the XRF.

Everything seemed to be working ok. I now wanted to upload the XRF relay firmware. Instructions to do this for the previous version of the XRF were available at:

http://openmicros.org/index.php/articles/84-xrf-basics/111-firmware-updating-how-to

According to CISECO the instructions are the same, but rather than uploading a .hex file you are uploading a .bin file.

I had been sent the .bin file for the XRF relay firmware from CISECO. I do not think this easily available for download at the moment – I will change this and add the link when it is. The files are now available from: http://openmicros.org/index.php/articles/84-xrf-basics/180-all-xrf-firmware-updates.

I followed the instructions above and everything seemed to go OK. I committed the code to the XRF and the version number changed.

On worrying thing was that when I clicked the ‘general’ tab and clicked the ‘Download Config’ it did come back with the version details, but it also said on the message section that ‘No valid response received’…. Edit: This is normal and there is no problem with this.

Lets see what happens…

I plugged in the re-programmed XRF RELAY to an active break out board (i.e gave it 3.3V power). I had a ‘normal’ XRF connected to my computer to see any serial commands being sent. When I powered up the XRF RELAY then I saw the message a–STARTED– repeated a few times. This looks promising.

Details on the XRF relay firmware control commands are here:

http://openmicros.org/index.php/articles/87-llap-devices-commands-and-instructions/120-xrf-firmware-relay

 All commands start with an ‘a’ and are 12 bytes long. So I typed “a–APVER—-” and sent it via the serial monitor. The XRF RELAY returned the string “a–APVER1.0-“. So it looks like it has worked. Typing ‘a–DEVTYPE–” returns the line “a–RLY000001”, so the XRF RELAY definitely has the correct code.

More info on getting started with the XRF RELAY and the relay board is here:  http://www.ciseco.co.uk/content/?p=2041

I want to control a number of relays in different places, hence I need to give the XRF RELAY a device ID.To quote the above post:

“It is good practise to change your DeviceID right at the start. To do this is easy. First decide what ID you’d like it to have, this can be two capital letters (eg TT, FG or YY) you cannot use numbers. When you have chosen, we send as a single packet (paste in hyperterminal) the command CHDEVID. To issue the command and to set (for example the device to RB) we use a–CHDEVIDRB, the device will reply to you with the same message to verify it heard you. To apply the settings send a–REBOOT—. The device will now restart by transmitting aRBSTARTED. That’s it your device is now called RB.”

I chose the device ID to be AA, BB, CC etc for the different relays. So following the above instructions I named my first XRF RELAY ‘AA’.

Sending the command ‘aAARELAYATOG’ toggles the relay on and off. I put an LED on pin 8 of the XRF and watched it switch on and off as I sent the toggle command.

Great stuff. It works through 3 floors of my workshop and out onto the street so has great range. I can now use it in my project….

 

 

One response to “Programming XRF with new firmware

  1. Hi Bob,
    Cheers for the email – hope some of it has helped.
    With regards to the XRF pins – its not obvious at all from re-reading my post.

    The XRF manual has the pin out of the XRF unit:
    http://openmicros.org/index.php/articles/84-xrf-basics/113-xrf-manual

    Pin 8 on the XRF is a general purpose IO pin. It is broken out on the XBBO so that is how I attached an LED.
    I dont think these are numbered on the XBBO board, but it is the pin just above the sleep pin (pin 9 on the XBBO/XRF).

    I am not quite sure how I knew that it would give an ON/OFF depending upon the relay state. I think I figured this out from looking at their XRF relay board and following which pin was used for switching:
    http://shop.ciseco.co.uk/xrf-relaybase-also-for-xbee-wireless-dual-relay-module-for-switching-kit/
    I’ve got to admit its not obvious from the documentation as CISECO do not seem to provide schematics… I think I must have reverse engineered it as I have the relay board.
    I also know some of the CISECO folk from Nottingham hackspace, so it could be that one of them told me directly.
    There are two relay outputs so I presume another IO pin is used to control the other relay.

    Hope that helps a bit. I’m going to put this Q/A as a comment on my blog post.
    Might be good to send CISECO a direct email for more info,

    Regards,

    Matt

    > This is an enquiry email
    >
    > Hi, I just read your post on changing the firmware on an XRF, in your case to the relay version. All is good and clear but I cannot find any reference to which of the various XRF pins, when mounted on a XBBO breakout board, are the outputs and which are the inputs. You mentioned you put an LED on pin 8, presumably on the BO board. Can you tell me where to find the information on which pins to use please.
    > Thanks
    > Bob
    >

Leave a Reply to Matthew Little Cancel reply

Your email address will not be published. Required fields are marked *