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
Advertisement