SI4010 + FT232R: A 433 MHz USB Radio Transmitter

Some new updates on the SI4010 front. First of all SI4010Prog now support a FTDI FT232R chip as C2 Bus master. Second I’ve wrote a firmware that allows controlling the SI4010 transmitter through a serial line.

SI4010Prog + FT232R

SI4010prog can now use a FT232R as C2 bus interface. Major advantage of this is that you can first load a firmware into the SI4010. And than use the FT232R as USB to serial adapter to communicate with the firmware as a normal serial device.

To implement the C2 bus master I use the special FTDI ‘SYNCBB’ bit bang mode on the DTR and CTS lines of the chip. This mode guarantees that the timing of the read and write actions is accurate, and the read and write actions are synchronized.

A downside of this interface is that it is relative slow. This is caused by the fact that multiple USB control transfers have to be done for writing one byte to the SI4010’s memory.

Other FTDI chips than the FT232R that support SYNCBB mode bit banging might also be supported. But I only tested it with a FT232R(rev. C).

The updated SI4010Prog is available it the Si4010Prog repository.

SER4010

To be able to play with the SI4010’s radio features without constantly having to modify and upload a new firmware to the SI4010 MCU, I wrote the SER4010 firmware. SER4010 is a firmware that allows control over the SI4010 RF functions from outside the device through a serial connection.

The firmware basically allows the following three things:

  • Configure RF parameters like: frequency, modulation type, bit rate, output power
  • Load a data frames
  • Send the loaded frame

A frame in this case is just a bit string where the bit’s encode the output level, eg. ‘1’ or ‘0’, to send. The duration of 1 bit is determined by the bit rate. This gives full flexibility for the data encoding, while having guaranteed timing of the symbols. The only limiting factor currently is that the byte string can not be longer then ~250 bytes.

To compile the firmware you need the Keil 8051 compiler toolchain and the SiLabs IDE + SI4010 common header files. But precompiled firmware file are available under releases in the Git Hub project.

The SER4010 firmware and C interface library source can be found in the SER4010 Git Hub project.

All Combined: A tunable 433 MHz USB radio transmitter

If we combine a FT232R + SI4010 with the SER4010 we end up with a USB OOK/FSK Radio transmitter for the 433 MHz ISM-band! I call this combination the SER4010-USB module. Adding a casing and a SMA antenna connector to it and it almost look like a professional device:).

SER4010-USB device RF transmitter

SER4010-USB device RF transmitter

You might wonder why I call it ‘433 MHz tunable’. This is caused by the antenna matching network. Although the SI4010 is tunable in the 27–960 MHz range, the external circuitry to match the 50 Ohm antenna to the output impedance of the chip is designed specifically for 433 MHz. So it is only effectively tunable within the band for which the SI4010 module was designed.

I did some range testing with a cheap omni directional 433 MHz antenna. With direct line-of-sight I was able to control Somfy RTS blinds from ~300 meters away. The range might even be further, but at 300 meters I lost my line-of-sight, and thus my ability to verify that the receiver received the signal. But I was already very satisfied with the 300 meters;).

More information on the SER4010-USB module and information about building one you self see the SER4010-USB page.

SI4010 Microcontroller

When browsing eBay for new ISM-band transceivers to play with, I stumbled upon the Silicon Laboratories SI4010 micro controller. The SI4010 is a 8051 with a build in tunable RF transmitter for OOK and ASK and on top of that it has a build in AES engine. That seemed perfect for my secure domestic sensor network!

The Hardware

The module I bought on eBay is a PCB that contains a SI4010 and a 50 Ohm unbalanced antenna matching network. All pins are connected to pads on the border of the PCB. The PCB also has pads for a crystal resonator, but no crystal is present. It seems this module is possibly the same as the HopeRF RFM60.

SI4010 module front & back

SI4010 module front & back

The heart of the SI4010 is a 8051 compatible micro controller that runs at 24 MHz with 1 instruction per clock cycle. It has a build in oscillator, although there is a possibility to add an external crystal.

On the memory department it is a bit limited. Apart from the 256 Byte 8051 IRAM, it has 4 kByte of shared XRAM/CODE memory. When using the free Keil compiler, the CODE memory is even more limited to the upper 2 KByte only. Luckily there is also a 12 kByte ROM with precompiled code that offers an API for using most of the build in peripherals. By using this you can reduce the amount user code required.

For persistent storage there is only a 16 Byte EEPROM, 8 Byte of low leak RAM and 8 kByte of OTP NVRAM. The NVRAM is one time programmable, and can only be written through the in-system debug interface. Because the NVRAM is twice the CODE memory, this might allow for patching the NVRAM code by using a boot loader that can load patches from the NVRAM. I haven’t looked into this to see if it is really possible. For development it doesn’t matter that the NVRAM is one time programmable, because you can load code directly into the XRAM/CODE memory using the debug interface.

As mentioned before the chip has an in-system debug interface. It uses the Silicon Laboratories proprietary C2 protocol and uses two shared function GPIO pins. This interface is very powerful because it allows reading and writing all memory. It also offers the ability to set 8 breakpoints.

On the I/O department it has 9 GPIO pins. One pin can also function as LED driver and the pins offer some functionality to function as 18 button push button matrix. The optional external crystal and the C2 debug interface also share there functionality with GPIO pins. The SI4010 does not have a UART, I2C or SPI interface. But because of the relative high clock rate I was able to implement a 9600 Baud UART and a I2C master in software.

The cool thing about this micro controller is the build in RF-module. It supports FSK and OOK modulation in a tunable frequency range of 27 to 960 MHz. The maximum symbol rate is specified at 100 kbps, although I haven’t tested this yet. The cool thing is that it has a Output Data Serializer. The ODS takes a bit string as input and uses this to drive the radio. This allows complete freedom in the preamble, postamble and symbol encoding to use for the data. The module also has automatic antenna tuning, making the antenna choice less critical.

There is also a build in AES unit. Although I haven’t tested how fast it is.

Finally the micro controller accept a supply voltage in the range 1.8 to 3.6 Volt. This allows powering the chip directly from batteries. In standby the micro controller should use less then 10 nA. I wasn’t able to achieve this with the module I bought on eBay. When shut down it still uses 1 mA. This might be caused by the extra antenna circuit that the my module has. But I still have to investigate this.

Using the SI4010

When I received my SI4010 module I directly discovered a mayor problem. I had no way to actually load code into the micro controller. Silicon Laboratories offers a free for download proprietary IDE for this that only works on Windows and uses the  Keil compiler and their proprietary programmer device. But I want to use Linux and SDCC!

Luckily I was not the first to run into this and I found this programmer for the C8051F320 that also uses the Silicon Laboratories C2 protocol. After some tinkering I managed to modify the code to work with the SI4010. The original code uses a LPT port to interface with the C2 bus. But since my laptop lacks a LPT port I used a Cypress EZ-USB FX2 micro controller to perform this job.

All this tinkering finally resulted in a new program called si4010prog that can be used to load and debug a SI4010 micro controller. The source is available on github.

SDCC vs. Keil

Currently I am able to load program’s compiled with SDCC into the micro controller and run them. However I’m not yet able to utilize the build in ROM API of the SI4010. The API is specifically designed for the Keil compiler, and thus uses the Keil calling convention. As I understood this differs from the SDCC calling convention. To be able to use it in SDCC some sort of wrapper has to be build around the API functions. This is not ideal since it will require extra CODE memory when using SDCC.

So for now I’m still stuck with the Keil toolchain.

To Summarize

The SI4010 is definitely a interesting  platform for simple applications where a RF transmitter is needed.

To summarize the pro’s:

  • 8051 compatible but at 24 MHz 1 instruction per clock
  • Build in tunable RF module without restrictions on the data encoding
  • Build in AES module
  • Can be powered directly from batteries
  • In-system debugger

Con’s:

  • Limited amount of memory, and NVRAM only one time programmable
  • (Still) Requires Keil toolchain
  • No receiver, Can only transmit