AN746
Si4012 P
ROGRAMMING
G
UIDE
1. Introduction
This document gives an overview of how to configure and use the Si4012 radio transmitter and provides several
simple software examples.
The Silicon Laboratories’ Si4012 is a fully integrated, crystal-less CMOS high-data rate RF transmitter designed for
the sub-GHz ISM band. This chip is optimized for battery powered applications requiring low standby current and
high output transmit power.
The following operation examples are covered in the programming guide:
to configure the Si4012
How to use the Si4012 transmitter for packet transmission in FIFO mode
How to measure battery voltage
The latest example source codes are available on the Silicon Labs web site:
www.silabs.com.
How
2. Hardware Platform
The source codes are provided for the LCD Base Board hardware platform that is part of the 4012-LCDK1W-434
and the 4012-LCDK1W-915 Si4012 EZRadio One Way Link Development Kits.The LCD Base Board platform is a
demo and development platform for the EZRadio family of RF chips. It consists of an LCD Base Board and
interchangeable RF Pico Boards.
2.1. The LCD Base Board
Figure 1. LCD Base Board
Rev. 0.1 1/13
Copyright © 2013 by Silicon Laboratories
AN746
AN746
The board contains an LCD, four pushbuttons, four LEDs and a buzzer, connected to a Silicon Labs 8051F930
MCU (U2, under the LCD). The MCU is also connected to an RF Pico Board connector pair (RFP1, RFP2). The
connection between the MCU and the EZRadio chip on the RF Pico Board is compatible with the RFStick. See
Table 1 for details. A Silicon Labs USB to C2 debug interface (U4) is also integrated on the board, so the board can
directly be connected via USB to the PC for downloading and debugging code on the U2 MCU.
Table 1. LCD Base Board Selection
Part Number
MSC-LCDBB930-PER
MSC-LCDBB930-AES
Board Description
LCD base board factory loaded with PER demo fw
LCD base board factory loaded with AES demo fw
2.2. RF Pico Board
Figure 2. RF Pico Board
The RF Pico Board is a radio module that contains an EZRadio IC, matching network and pcb antenna. The RF
output is selectable between the PCB antenna and a 50
SMA output connector via a 0
resistor. The boards
also have a factory loaded board identification memory (EBID) that contains data that describes the board
properties. Via the unified RF pico connector pair on the bottom side of the board, any RF pico board can be
connected to the LCD base board.
The example code runs on the C8051F930 MCU of the MSC-LCDBB930 LCD base board and controls the Si4012
on the RF Pico Board using the SMBus interface. The signals listed in Table 2 are connected:
2
Rev. 0.1
AN746
Table 2. Pin Assignments
Si4012
Pin #
2
5
7
8
9
10
Pin Name
GND
VDD
NIRQ
SDN
SCL
SDA
Pin Function
Ground
Supply input
Interrupt status output, active low
Shutdown input, active high
SMBus clock input/output
SMBus data input/output
20
19
25
26
Pin #
C8051F930
Pin name
Ground
VDD
P1.4
P1.5
P0.7
P0.6
2.3. Setting up and Connecting the LCD Base Board to a PC
Power source of the platform can be selected with the power-supply selector switch (SW1) on the base board. If
SW1 is in USB position, supply voltage is provided by the PC that is connected to the J7 mini USB connector. If
SW1 is in Battery position, the supply voltage is provided by three AA batteries in the battery holder on the bottom
side of the board. Current consumption of the RF part of the connected RF Pico Board (RFVDD) can be measured
on JP3. Since JP3 is shorted by a PCB track on the bottom side of the board, the user have to cut the track if this
feature is used.
Steps of connecting the platform to a PC:
Connect
an RF Pico Board to the LCD base board through RFP1 and RFP2.
Select the desired power source with SW1 power selector switch.
Connect the LCD base board to an USB port of the PC.
Wait for Windows to install the driver of the debug interface if necessary.
Rev. 0.1
3
AN746
3. Software Tools
There are two software tools provided by Silicon Labs to help EZRadio software development, the Wireless
Development Suite (WDS) and the Silicon Labs Integrated Development Environment (IDE), both available on
silabs.com.
3.1. Wireless Development Suite (WDS)
The recommended starting point for Si4012 development is the WDS. It can be downloaded from silabs.com and
can be installed on a PC. After connecting one of the hardware platforms described in this document to the PC,
WDS is able to identify the connected board by reading the EBID memories of the board.
The EZConfig Setup GUI is part of the Wireless Development Suite (WDS) program. This setup interface provides
an easy path to quickly selecting and loading the desired configuration for the Si4012 device. The configuration
table provides a list of preloaded, common configurations validated by Silicon Labs. EZConfig also allows for
custom configuration to be loaded using the Radio Configuration Application. After the desired configuration is
selected, the EZConfig setup automatically creates the configuration data that can be used to configure the
EZRadio chip. The program then gives the option to configure directly the EZRadio chip of the connected
hardware, to modify a selected demo code with the configuration and download it to the connected hardware, or to
launch Silicon Labs IDE with the new configuration data preloaded into the user program. For more complete
information on WDS and EZConfig usage, refer to the WDS User’s Guide, available on silabs.com.
3.2. Silicon Labs IDE
The Silicon Laboratories Integrated Development Environment (IDE) is a standard tool for program development
for any Silicon Labs 8-bit MCUs including the C8051F930 that is used on the hardware platforms described in this
document. The Silicon Laboratories IDE integrates a project manager, a source-code editor, source-level
debugger, and an in-system flash programmer. The IDE interfaces to third party development tool chains to provide
system designers a complete embedded software development environment. The Keil Demonstration Toolset
includes a compiler, linker, and assembler and easily integrates into the IDE.
3.2.1. Downloading and Running the Example Codes
1. Connect the hardware platform to the PC according to the description of the used platform.
2. Start Silicon Labs IDE (IDE 4.40 or higher required) on your computer.
3. Select
Project→Open Project...
to open a previously saved project.
4. Before connecting to the target device, several connection options may need to be set. Open the
Connection Options
window by selecting
Options→Connection Options...
in the IDE menu.
5. Select USB Debug Adapter in the “Serial Adapter” section.
6. If more than one adapter is connected, choose the appropriate serial number from the drop-down list.
7. Check the “Power target after disconnect” if the target board is currently being powered by the USB Debug
Adapter. The board will remain powered after a software disconnect by the IDE.
8. Next, the correct “Debug Interface” must be selected. Check the C2 Debug Interface.
9. Once all the selections are made, click the
OK
button to close the window.
10. Click the
Connect
button in the toolbar or select
Debug→Connect
from the menu to connect to the
C8051F930 MCU of the platform.
11. Erase the flash of the C8051F930 MCU in the Debug→Download object code→ Erase all code space
menu item.
12. Download the desired example HEX file either by hitting the Download code (Alt+D) toolbar button or from
the Debug
→Download
object code menu item.
13. Hit the Disconnect toolbar button or invoke the Debug
→Disconnect
menu item to release the device from
halt and to let it run.
4
Rev. 0.1
AN746
4. Controlling the Si4012
The Si4012 has four pins to interface with the host MCU:
SDN
is the shutdown input of the IC. When it is pulled high or left open, the Si4012 goes to its shutdown
state; when pulled low, the Si4012 wakes up.
NIRQ is the interrupt request output that goes low when an enabled interrupt is triggered in the Si4012.
SCL is the SMBus clock.
SDA is the SMBus data.
4.1. Control
The SMBus interface is implemented as a bidirectional 2-wire interface (SCL, SDA) with the host configured as
master and the Si4012 as slave. Both standard (100 kbs) and fast (400 kbs) modes are supported with 7-bit
addressing. The device address is 1110000x, where x is the R/W bit. Since shutdown can be activated, wakeup
can be initiated and interrupts can be polled using the SMBus interface. The minimal necessary control interface
for the Si4012 is only two pins, SDA and SCL.
Figure 3. Minimal MCU Interface
All host commands consist of a 1-byte opcode followed by 0 or more arguments. All responses from the 4012
consist of a 1-byte top level status followed by 0 or more data values. Refer to the data sheet for details on the
command structure and command details of the Si4012.
Rev. 0.1
5