July 26, 2009

Upgrading the Firmware on the SM130 RFID Module

The Twacky Races project I'm working on at the moment uses RFID tags to unlock parts of a scavenger hunt, so I'd bought a few Arduino RFID shields from Tinker.it and the associated SM130 RFID modules to go with them. However, when I'd soldered up the shields and connected it all up to an Arduino I wasn't having any joy in reading any RFID tags. The green power LED on the shield lit up fine, but that was all.

With the latest Arduino software (0017 RC1) I wasn't getting anything at all on the serial port from the example code. Asa told me that he'd had problems with the Wire library in the later Arduino distributions, and so had ended up using the one from Arduino 0011. That got me a bit further, in that I was getting some data back from the RFID module, but it seemed to just be echoing back anything that I sent to it.

I'd found that out by adding some lines to the example code to get it to print out any data that was recieved - the two Serial.print lines prefixed with + below:


   while(Wire.available())                // while data is coming from the reader
   {
       byte_from_reader = Wire.receive();
+      Serial.print(" 0x");
+      Serial.print(byte_from_reader, HEX);
     
       if ((count == 0) && (byte_from_reader == 2)) { // no RFID found: reader sends character 2

From reading the datasheet for the SM130 module, I found that the module can operate in two modes: one using an I2C interface, and one using a serial UART. Changing between modes of operation requires the firmware on the module to be changed, and by default the module comes with firmware to communicate via UART. Of course, the Arduino shield uses I2C (because the UART on the Arduino is used to talk to the computer through the USB port).

The guys at Tinker.it have a copy of the appropriate firmware available to download from the RFID shield page on their website, but no instructions on how to wire things up to run the upgrade. After failing to wire it up correctly at first (it was late and I somehow confused the pin ordering on the SM130 module...) I worked out how to connect it to either an FTDI cable or an Arduino with the processor removed, in order for the firmware upgrade software to connect and upgrade the firmware on the module.

It's actually quite easy to wire up, once you've carefully prised the processor from your Arduino board. As can be seen from the photo below, there are only five connections you need to make. I've listed them in full in the table below the photo, and included the colour coding for my FTDI cable if you're using that instead of a processor-less Arduino board. I'm not sure if all the FTDI cables are colour-coded the same, but on mine the ground connection is black, and the the colours order from the ground connection is black, brown, red, orange, yellow, green.

Picture showing processor-less Arduino connected to a breadboard and SM130 RFID module
NameArduino (colour in the photo)FTDI ColourSM130 pin #
Vcc/+5V5V (red and yellow)red1 and 28
GNDGnd (green)black14
UART RXDigital 0 (white)orange11
UART TXDigital 1 (blue)yellow12

Once wired up, upgrading the firmware is just a case of running the SM130_FU.exe upgrade program, choosing the correct COM port and firmware file (i2c_22.rme in the firmware upgrade download from Tinker.it) and clicking the "AUTO UPGRADE" button. Then wait for the "Upgrade complete" message and you're done. When you put the module back into the RFID shield you should be rewarded with an orange OK LED as well as the green PWR one, and fingers crossed, you should also be able to read RFID tags.

Tags:

Posted by Adrian at July 26, 2009 12:02 PM | TrackBack

This blog post is on the personal blog of Adrian McEwen. If you want to explore the site a bit further, it might be worth having a look at the most recent entries or look through the archives or categories over on the left.

You can receive updates whenever a new post is written by subscribing to the recent posts RSS feed or

Comments

Hi Adrian, I am trying to flash the firmware to i2c using a chipless arduino, but there is an error that comes up when I hit auto-upgrade. It says the connection timed out. I have double and triple checked the wiring, and it appears to communicate partially with the sonmicro software, but it cannot write to the chip. Any suggestions of what is going wrong?

-Mike

Posted by: Mike at November 1, 2015 11:41 PM
Post a comment









Remember personal info?





Note: I'm running the MT-Keystrokes plugin to filter out spam comments, which unfortunately means you have to have Javascript turned on to be able to comment.