top of page

Heading 1

RFD900 Sik Programming

In all of the balloons up until now and likely for all future balloons, I have used a radio modem known as the RFD900+. This modem is made by a company known as RFDesign. The modem was specifically designed for telemetry uses and with the included dipole antennas this modem is supposed to have a 40Km range line of sight (LOS). Additionally, since this radio operates in the industrial, scientific, and medicinal radio band at around 900 MHz and because it only uses a power of 1watt this radio can be used without the need for an amateur radio license. None of these traits are as important, as the fact that this modem is capable of using antennas diversity. What this means is that the modem can have two antennas attached to it. Whichever antenna is receiving the highest signal strength will be used to send and receive messages. In this way the modem can extend the strength of the signal by using two different antennas.

​

As I have already mentioned in my description of the third version of the balloon, I am currently looking to design an antenna array which is capable of sensing the strongest signal and orienting itself in that direction. To do this I needed to use returned signal strength indicators (RSSI) which this modem is already capable of measuring. Unfortunately, while the RFD900 and its firmware(SIK) already has a method built in to calculate these values, the values are not readily accessible from outside the RFD900. This tutorial will give an overview of how to program the RFD900's uC so that these interrupts are sent through the UART of the RFD900 modem. Additionally, I will provide a link to the RFD900 code and the ST uC code that is used to receive the messages.

RSSI Values

Note this whole tutorial, along with the whole concept of using an antenna which can be pointed in various directions is based on an ability to measure the strength of the signal being received from the antenna. RSSI is what allows us to measure the signal strength, once these values are derived the uC can determine which way it needs to turn the antenna array (in my case) or which antenna to use (in the original implementation). To give a better understanding of antenna RSSI and how it is measured I have attached a flowchart describing how antenna RSSI is measured in the RFD900. This flowchart is actually provided by a company known as SiLabs. This company manufactures the uC that is used to control the RFD900+: SiLabs 1030.

Screen Shot 2019-09-14 at 11.20.02 PM.pn

SiLabs 1030 Resources

Throughout this tutorial I will be referencing registers, interrupts, etc which are all inherent to the Silabs 1030 controller. The vast majority of this information was found by looking into a variety of datasheets provided by Silabs. A list of the datasheets and what they contain is below. Note that Silabs also provides many tutorials for their products and their website as a tremendous amount of documentation for all of their products.

​

AN440: This document holds detailed information about what data is held by each register in the SiLabs uC

AN415: This is the programming guide for a number of SiLabs uC. This document has many helpful examples within it.

AN882: This document holds information about how antenna diversity is handled within the SiLabs uC. It also gives background on what registers are used to store RSSI values and how RSSI data is measured.

Si102x/3x: This is the specific manual for the uC used within the RFD900+

Getting Started: Sik Single Point

The firmware that is run on the RFD900 is known as Sik. There are two versions of Sik currently available. The first is Sik single point, this firmware supports communications between only two modems. The second version is Sik multi-point, which allows one modem to broadcast data to multiple modems. For this tutorial, I will be using the single point version. The homepage for Sik Single-Point can be found on GitHub below

​

SIK Single Point Github Link

​

On the GitHub homepage, there is a list of dependencies required for the Sik radio modem. Do not pay attention to this list, for the time being, only focus on the requirement for SDCC. SDCC stands for Small Device C Compiler, in this tutorial it will be used to compile code for the RFD900+. The rest of the dependencies and hardware in listed as necessary on the GitHub page are used for uploading the code to the RFD900 modem. Unfortunately, I have been unable to get, EC2Tools to work for Mac, I also found that RFDesign has a program to upload the firmware to the modem using a USB to Serial interface cord. The only problem is that this program is only available on Windows. Having tried a couple of different methods to get the EC2Tools to work, I decided to use the RFDesign program.

​

Going back to SDCC, to install SDCC go to the following page and download the binaries of SDCC for the platform you are using. If you are using Mac, be aware that there are two separate distributions for two different architectures. If your Mac was made after 2005 use the x86 file. Download this file and use the included tutorial to properly install SDCC. This file can be found within the download by following the path

​

sdcc/share/sdcc/doc/sdcc/INSTALL.txt

Quick Introduction to Sik Firmware Source Code

The purpose of this section is to give a quick overview of the organization of the Sik Firmware code. The firmware directory is of primary interest for this tutorial. Within this directory, there are two additional directories of interest: Radio and include. The include directory contains information about the various RFD900 modems and the uCs within them. The file I will reference most in this tutorial is the Si1020_defs.h, which contains definitions of all the special function registers for both the uC and EZradiopro. The file also contains the names of the available interrupts on the Si1020/30 uC. Within the Radio directory is all of the src code used in this project. All of the values have different purposes and uses within the context of the project. For this specific tutorial, the files that will be used the most are the radio.c, serial.c, and crc.c files. Note that if a new file is created in the Radio directory it is automatically compiled by the make file, this contrasts from the ST makefile in which you have to add any new files to the makefile.

Start Programming.

With all of the introductions out of the way, it is time to begin programming the RFD900+ modem. To do this I am going to start by creating two new files within the Radio directory. The name of these two files will be MAV_RSSI.c and MAV_RSSI.h. These files will be used exclusively for packing the RSSI data and sending it via the UART port. The contents of these files can be found below. They can also be found on the fork I created of the Sik Single Port project.

Screen Shot 2019-09-15 at 12.36.25 AM.pn

Although I have thoroughly commented on these files there may be some areas which are not easily understood because they a formatted for SDCC. First, you should note that the variable RSSI_Mavlink is prepended with the qualifier __xdata. In controllers that use SDCC, there are multiple address spaces; each with a different purpose. __xdata signifies that this variable is stored in the external RAM space. Also, note that serial_write_buf is a function that is included through the "serial.h" file. This file along with serial.c is used to manage all of the UART communications to and from the radio modem. Finally, note that the writeRSSI_MAVLINK function takes 3 arguments. The first two are required by the MAVLINK communications protocol. These values are used to tell the receiving system where the data is coming from. The third argument is the actual RSSI value measured on the antenna.

Screen Shot 2019-09-15 at 12.36.45 AM.pn

The last thing we need to do before programming the uC is complete is to find a section in the Radio.c code that is ideal to send the RSSI values. Looking at the Radio.c file it is possible to find an interrupt that is triggered when a packet is received. This interrupt will also check if the received packet is valid or not. Once the packet is determined to be valid the RSSI values will be updated within their special function registers. The name of the special function registers that hold the RSSI values are

​

EZRADIOPRO_ANTENNA_DIVERSITY_REGISTER_1 0x28

EZRADIOPRO_ANTENNA_DIVERSITY_REGISTER_2 0x29

​

Both of these values are declared in the Si1020_def.h file. At this point in the code, it is an ideal time to transmit the RSSI values for two reasons: we know the RSSI values are valid and we know they were recently measured. For this reason, within the radio.c code, we will inject the code to read the values of the registers and then use the code we wrote in MAV_RSSI to transmit the RSSI values over the UART port. For a more detailed look at the files referenced above visit Github, the forked repository can be found below

​

FORKED SIK REPOSITORY

​

To compile the code navigate to the firmware directory from terminal. While in this directory type "make" into the terminal and the code will compile.

Uploading the Code to the RFD900

At this point you are going to need a Serial to USB converter. Plug the serial side into the RFD900 has shown below.

IMG_6268.jpeg

The other side of the chord is to be plugged into the USB port of your computer running windows. Now, go to the website below

​

https://files.rfdesign.com.au/tools/

​

On this page there is a link to download the zips for RFD tools. These tools are what we will use to upload our compiled program to the RFD900. After connecting to the radio modem select a .ihx file generated in the build directory. Be sure to select the RFD900p.ihx file as it is the one used for the RFD900+ radio modem.

bottom of page