Silicon Laboratories EFM8, EZRadio Programming Manual

AN954: Programming Guide for EFM8 and EZRadio®
This document is intended to serve as a guide for application development with EZRa-
Si4x55 ICs. It introduces the major parts of the hardware platform, such as the RF
dio® Pico board, which contains the radio and the necessary RF components required to op­erate the device according to a desired regulatory standard.
It introduces the energy friendly microcontroller 8-bit (EFM8) which is required to con­trol the radio, evaluate the RF parameters, and develop custom application programs. Besides the hardware, this document also describes the application programming inter­face (API) that makes it possible for the EFM8 and RF Pico board to communicate with each other. Using the software tools provided by Silicon Labs and following this pro­gramming guide will make software development as easy as possible, as these items will assist in configuring the radio effectively.
KEY POINTS
• EFM8 along with an EZRadio is an ultra­low cost two-chip wireless solution.
• The EZRadio is a sub-GHz wireless communcation platform that can be a receiver, transmitter, or tranciever.
• Configuration of the EZRadio can be done with a simple GUI within a free tool provided by Silicon Labs.
• Configuration of peripherals and pinouts on the EFM8 is performed using an intuitive GUI.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1
Kit USB Connector
CR2032 Battery Holder
Power Source Select
User Push Buttons
User LED
EFM8 Reset Button
EFM8BB1 MCU
Expansion
Header
Direct
Debug Connector
Joystick
128x128 Pixel Memory LCD
Debug IN/OUT
Connector
Reference
Board Connector
AN954: Programming Guide for EFM8 and EZRadio ®
Hardware

1. Hardware

This section will introduce the hardware needed for this reference design and demo. Using an EFM8 along with an EZRadio is a two chip low cost wireless solution. This section will also discuss the connections between the radio, the MCU, and the expansion board used to connect the two.

1.1 Kits

In order to run the software demos and get started with developing, 3 boards are required. EFM8BB1, Expansion Board, and Si4455

1.2 Busy Bee Starter Kit

The EFM8BB1 Starter Kit (STK) is a platform that allows the user to demonstrate, evaluate, and develop solutions. This kit includes the EFM8BB1 8-bit MCU. It has vast functionality and utilizes an LCD, buttons, joystick, debug interface, and much more to allow rapid evaluation of both the MCU itself and any add-on hardware using the expansion (EXP) header.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 1
Figure 1.1. Busy Bee Starter Kit
AN954: Programming Guide for EFM8 and EZRadio ®
Hardware

1.3 RF Pico Card

The RF pico board is a radio module that contains an EZRadio IC, a matching network, and an SMA connector on the top side. Other than the antenna connector, these components are covered by a metal shield for noise reduction. The digital signals of the radio (SCLK, SDI, SDO, NSEL, SCL, SDA, VDD and GND) can be accessed on test points at the edge of the board. The boards also have a factory-loaded board identification memory (EBID) on the bottom side 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 EXP board explained next. The Pico card comes with an antenna which is screwed into the SMA connector on the top of the card.
Antenna Connection
Noise Shield
Test Points
Figure 1.2. RF Pico Card
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 2
AN954: Programming Guide for EFM8 and EZRadio ®
Hardware

1.4 Expansion Board

The expansion (EXP) board is used to connect the EFM8 Starter Kit to the RF Pico board. It has two sets of headers on each side, one male, and one female. These are both mirrors of each other and can be used to transfer SPI, GPIOs, power, and ground. The RF Pico card sits on top of this EXP board via the RFP1/2 ports located in the middle of the EXP board. A further layout of all the ports and connections are outlined in the following figures and tables.
Female Expansion Header
(Connects to STK)
Pico Card Connectors
Figure 1.3. Expansion Board
Expansion Header Pins
GND
RF_NIRQ
RF_SDN
P1.5
P1.6
NC
P0.5
P1.3
EBID_SCL
EBID_SDA
1
3
5
7
9
11
13
15
17
19
Male Expansion Header
2
VMCU
4
MOSI
6
MISO
8
SCLK
10
RF_NSEL
12
14
16
18
20
P0.4
P0.5
P1.2
5V
3V
Figure 1.4. Expansion Board 20-pin Header
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 3
AN954: Programming Guide for EFM8 and EZRadio ®
Hardware
RFP2 Connector
1
3
5
7
9
11
13
15
17
19
2
GND
4
NC
6
NC
8
NC
10
NC
12
NC
14
NC
16
SDA
18
3V3
GND
20
GND
MOSI
SCLK
RF_NIRQ
SDA
RF_GPIO_0
RF_GPIO_2
NC
VRF
GND
RFP1 Connector
1
3
5
7
9
11
13
15
17
19
2
4
6
8
10
12
RF_GPIO_1
14
RF_GPIO_3
16
18
20
GND
MISO
RF_NSEL
RF_SDN
SCL
NC
VRF
GND
GND
NC
NC
NC
NC
NC
NC
SCL
3V3
GND
Figure 1.5. RFP1 and RPF2 Connectors
Table 1.1. EZRadio to EFM8 Connections
Pin Name Pin Function BB1 STK Pin
GND Ground GND
VDD Voltage Supply VDD
NIRQ Interrupt output, active low P0.0
SDN Shutdown input, active high P1.5
NSEL SPI select input P1.1
SCLK SPI clock P1.0
SDI SPI data input P0.6
SDO SPI data output P0.7

1.5 Radio Hardware Interface

The EZRadio devices can be controlled by the host MCU over a SPI bus and six additional signals. The user has access to the radio's API via the SPI bus.
Table 1.2. SPI Signals
Signal Description
SCLK Serial clock, output from master
SDI Master output, slave input(MOSI)
SDO Master input, slave output(MISO)
NSEL Slave select, active low
The high state of the shutdown (SDN) pin is used to completely disable the radio and put the device into the lowest power consumption state. The radio has an interrupt output pin (NIRQ) that can be used to promptly notify the host MCU of multiple events. The NIRQ pin is active low and goes back to high if the pending interrupt flag is cleared by reading the appropriate interrupt pending registers.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 4
AN954: Programming Guide for EFM8 and EZRadio ®

1.6 Setting Up the Hardware

1. Connect an RF Pico Board to the expansion board via the RFP1/2 connectors.
2. Connect the antenna to the SMA connector on the RF Pico Board.
3. Connect the BB1 starter kit to the expansion board via the 20 pin header.
4. Provide power to the board by connecting the DBG USB connector to the PC using the provided USB cable.
5. Move the switch to the AEM position.
6. Wait for Windows to install the driver of the debug interface, if necessary.
Hardware
Figure 1.6. Setting up the BB1 STK
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 5
AN954: Programming Guide for EFM8 and EZRadio ®
Software

2. Software

The first step to getting started with the EFM8BB1 is download Simplicty Studio from the Silicon Labs website (http://www.silabs.com/
simplicity-studio). Follow the installation wizard for a complete install. More information on specific tools included in Simplicity Studio
and their usage can be found at http://www.silabs.com/products/mcu/Pages/simplicity-studio.aspx.
The second software tool needed is Wireless Development Suite or WDS. This tool allows complete custimization to radio parameters. It can be downloaded at https://www.silabs.com/products/wireless/EZRadio/Pages/WirelessDevelopmentSuite.aspx. For more informa­tion on WDS please refer to AN796 found at http://www.silabs.com/Support%20Documents/TechnicalDocs/AN796.pdf.

2.1 Simplicity Studio

Simplicity Studio is a free tool offered by Silicon Labs that includes an IDE and many other tools to speed up development. This is the main tool for developing on Silicon Labs' MCUs and running demos with the kit. Be sure that Simplicity Studio is installed and updated, and the BB1 Starter Kit is connected. Once launched, Simplicity Studio will automatically detect any connected devices that it recogni­zes. After connecting the BB1 kit, the device will appear in the [Detected Hardware] area of the main Simplicity Studio launcher.
Note: There may be a delay after connecting the kit before it appears in Simplicity Studio. If the kit does not appear, ensure the switch is in the AEM position and that the J-Link drivers are installed.
Figure 2.1. Simplicity Studio Main Page

2.2 Wireless Development Suite

Silicon Labs provides a powerful tool to help with EZRadio/PRO software development, the Wireless Development Suite (WDS). It is available at https://www.silabs.com/products/wireless/EZRadio/Pages/WirelessDevelopmentSuite.aspx. WDS allows the user to virtual­ly select a radio and use the EZConfigPRO Setup GUI. This setup interface provides an easy path to quickly select and load the de­sired configuration for the EZRadio/PRO devices. The EZConfigPRO Setup allows four different methods for device setup.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 6
AN954: Programming Guide for EFM8 and EZRadio ®
Software
After the desired configuration is selected, the program gives the option to generate a header file which will contain all of the options selected in the GUI. This file can then be used in a Simplicity Studio project to configure the radio and communicate with an MCU. Using the header file generated by the WDS is highly recommended. Manual editing in the header file may cause problems and prevent the radio from working correctly. For more complete information on WDS and EZConfigPRO usage, refer to the WDS User's Guide.
The following figures will be a guide to generating a customized header file. The reference design provided by Silicon Labs has a con­figuration file already included in the project. However, to make changes to the radio configurations it is recommended to generate a new one.
Note: WDS is not necessary for getting the software demos running; however WDS is needed to customize the radio configuration.
Figure 2.2. WDS Introduction
WDS can be used without connecting the physical HW to the PC to obtain configuration parameters. After running the WDS, the user needs to start simulation mode by clicking on the [Simulate radio button.]
Figure 2.3. WDS Simulate Device
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 7
AN954: Programming Guide for EFM8 and EZRadio ®
Software
Figure 2.4. WDS Device Selection
Once the Radio is selected, the radio configurations screen will appear. This is the main page used to generate a configuration file that can be used in a custom project. Preset configurations like Standard Packet TX and Unmodulated Carrier are available to quickly set up a radio project. The Empty Framework project can be used as a blank template. Once the configurations are set, the [Generate
Source] button can be used to create the header file.
Note: WDS does not support EFM8 products. There are options to generate an entire project with MCU source code, however these
projects and code will most likely not work on EFM8 MCUs. When working with EFM8 and EZRadio/PRO, WDS is only used to gener­ate the header file.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 8
AN954: Programming Guide for EFM8 and EZRadio ®
Software
Figure 2.5. WDS Configuration
The generated header file can be used in a new or existing project within Simplicity Studio, or used with any other IDE.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 9
AN954: Programming Guide for EFM8 and EZRadio ®
Software Demos

3. Software Demos

This document covers two demos, which run on combination of EFM8BB1 and a Si4455. The Range Test is used to evaluate the two­chip solution of an EZRadio and an EFM8. The Bidirectional demo is used as a development platform.
The radio_config.h file holds the radio configurations and is a great learning tool for understanding how the radio is set up. The radio API is located in the radio.c/h files. These functions are used to communicate to the radio and they will be further explained later in this document.

3.1 Range Test

The Range test demo is an evaluation tool that allows the user to evaluate the combination of EFM8 and a sub-GHz radio. It has config­urable settings that the user can alter and measure to know how this combination will perform in a specific application.
The menu screen of the demo has the user set a few parameters before entering into transmit mode or receive mode. The first configu­rable parameter is the self identification (ID) and destination ID. These are used to communicate with specific boards. To send a packet between two kits the destination ID of the transmitter and self ID of the receiver must match and the self ID of the transmitter must match the destination ID of the receiver. North and south on the joystick set the ID, and center of the joystick specifies which ID is being altered.
The packet size is fixed at a size of seven but the number of packets to send can be altered. Once all of the parameters are set to the desired values, the west and east positions of the joystick can be used to set the demo into transmit or receive mode.
In transmit mode, the screen will indicate the ID of the board, the ID to be sent to, the max number of packets to be sent, and the number that has been sent. West on the joystick can be used to go back to the menu screen and change parameters. Center on the joystick controls the transmission of packets. Pushing it begins the transmission which will continue until the max number of packets has been sent. Center again can be used to stop and reset the number of packets sent.
In receive mode, the screen will show the IDs, percent of packets correctly received (PER), receive sensitivity (RSSI), number of pack­ets received, and number of packets sent. When a packet is received the packets received, packets sent, RSSI, and PER will update. Again, west can be used to go back to the menu screen.
Figure 3.1. Range Test Menu, Transmit, and Receive Screens

3.2 Bidirectional Packet

The Bidirectional Packet demo is a simple example of the Si4455 wireless radios along with an EFM8 BB1 starter kit. It is controlled via the two push buttons on the starter kits. The tri-colored LED indicates either a button press or when a packet is received.. At first, the LED is green and the push buttons cycle through the colors and transmit the state. The receiver will match the state of the sender such that the two boards, when configured correctly and within range, will have the same color LEDs illuminated. The packet is 7 bytes, and the last byte indicates the state of the transmitting board. This project is intended to be a starting point for developing an application utilizing the sub-GHz radio and an EFM8 MCU.

3.3 Running the Demos

To get the software demos running, follow the steps for installing Simplicity Studio, putting the kit together, and connecting the kit to the host or PC as shown in the figure.
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.1 | 10
Loading...
+ 24 hidden pages