IAR Embedded Workbench, SmartRF Studio, CC1120/CC112x, where to start?
This is probably going to be one of the longest posts I have written on Stack Exchange. I have been using TI hardware for a month and would like to document my knowledge for future users.

1. Before you start off, let's see what you need.


A CC1120/CC112x/CC120x or any related wireless radio by TI.
A development board which can house a CC1120/CC112x/CC120x wireless radio and a microcontroller.
A programmer and debugging interface, for example MSP-FET430UIF.
A microcontroller, in this case, we use one from Texas Instruments (MSP430).
IAR Embedded Workbench to program the microcontroller which will be sending and receiving data through the radio module it is interfaced with.
SmartRF Studio to generate register values for a certain configuration of the radio.


2. Fetch the files and software you need.


TI does not own IAR Embedded Workbench, IAR is a different company that owns it. TI, however, does provide a download link on it's own website which will directly get you the IAR variant that works with TI MSP430 processor family. You can download it here.
The CC1120/CC112x/CC120x or other TI radio modules are highly configurable radio modules in which you can change various parameters of the radio, for example, the carrier frequency, transmit power, symbol rate, modulation, etc, etc. All these configurations are written to the radio module during runtime by the microcontroller. However, in order to get the values for these registers, you will use Smart RF studio (it generates values for these registers by allowing you to manually set the parameters). Download SmartRF Studio here.


Note: I placed emphasis on 'during runtime' because these registers reside in the memory of the CC112x device and are reset upon reboot.

Below you can see screenshots of SmartRF studio. You can see that it has a long list of compatible radio modules available, and in the second screenshot, you see equivalent register values being generated from the settings on the main program pane.






Example software for MSP430F5438A microcontroller is available on this page. Scroll down to the software section on this page to find two versions of example software. I'll explain the necessity of each of them:


Rev. C provides a menu based structure for navigating between different modes (RX Sniff Mode, Easy Link Mode, PER Test Mode, etc).
Rev. E provides a different app (IAR EW project) for each mode. If you have a development board without buttons or LCD screen, you should prefer this version since it does not need you to navigate through a menu to reach the specific mode.

If you can afford, I recommend you buy a good development board in the initial stage, for example this one so you have an idea of what's going on. Also, use the Rev. C firmware, which has a menu.

3. Build and run your first project.

Try your first experiment using the RX Sniff Mode. In Rev. C firmware, it will allow you to choose from a list of frequencies in the menu, which includes 169 MHz, 434 MHz, 868 MHz, 915 MHz and 955 MHz. I recommend you experiment using 434 MHz since I have personally encountered problems at high frequencies** (see below). Run your transmitter in the Master Mode and the receiver in the Slave Mode.


Extract the Rev. C firmware files to your user folder
Open per_test.eww and go to Project > Rebuild All
Download the compiled hex to your device by Project > Download > Download Active Application.
Repeat the process with another set of hardware to make your receiver module.


4. Get rid of buttons and menus, change registers to configure your radio module.

Once you feel the need to get rid of buttons and menus, you can move onto Rev. E firmware. However, do remember that it does not have the menu feature and you'll need to change register values in order to configure your radio module to use the appropriate carrier frequency during runtime. If you are using the RX Sniff Mode with the Rev. E firmware, the register values can be modified in cc1120_rx_sniff_mode_reg_config.h file. Remember that you can always use Smart RF studio to generate values for registers, and even though it is good to remember the functions of registers, it is not necessary to do so.



Also remember that you'll need to remove button input functions and add appropriate delays so the packets can be sent automatically after a certain delay. Since MSP430 is not that much documented as compared to PIC and AVR microcontrollers, the appropriate delay functions are waitMs(delay_in_ms) and waitUs(delay_in_us) respectively.

5. Future tasks

Example codes are always a great place to start. You can modify the example software codes above to tweak the processor to match your own needs.

** Long packets and insufficient time between transmission can cause problems. It is desirable to reduce packet lengths by changing the PKTLEN constant in the example code files.