Greetings Indy SiP fans! Today, we're going to show how to write firmware for a TI MSP430 host microcontroller to duplicate the functionality of the USB-UART IC on the Indy SiP Development Boards.
This post is the first of a series of three that will show systems using the Indy UHF RFID SiPs along with an MSP430 host microcontroller. All three use the MSP430 USB LaunchPad evaluation kit, which showcases the MSP430F5529 microcontroller. This kit was chosen because it is low cost(only $12.99!), includes a programmer and debugger, is easy to use, and comes with a variety of useful USB firmware examples. Each post of the three will focus on a single MSP430 firmware configuration that interacts with the Indy SiPs in a unique way. We will post one each week here on the Impinj Support Portal.
Update - Check out the rest of the postings in the series here:
Bonus Post 1: Indy SiP With MSP430 IRI-LT Host - Non-Blocking
Bonus Post 2: Indy SiP With MSP430 IRI Host and USB-UART Printf
This week's example will showcase using a host microcontroller (the MSP430) to translate between 3.3V UART traffic and USB with a host PC, as shown in the block diagram in Figure 1. This functionality is already built into the kit in the form of a USB-UART bridge IC, but this example will let us achieve the same using an external microcontroller. A simple firmware project for the MSP430 is all it takes to enable this functionality.
Figure 1: Example Simple Block Diagram
Indy SiP Background
To start off, let's get a little background on the Indy SiPs and their development kits. The Indy SiPs are UHF RFID reader Systems in Package that communicate with hosts using the IRI (Impinj Radio Interface) protocol over a physical UART connection. The host in the system could be a PC, a microprocessor, or a microcontroller. The connections to and from an Indy SiP are shown in Figure 2, which has been reproduced from the RS2000 Datasheet.
Figure 2: Indy SiP RS2000 Required and Optional Connections
On the RS500 and RS2000 SiP development kits, there are three ways to connect a host to the SiP: USB UART, RS232 DB9 connectors, and hookup wires connected directly to the SiP. A block diagram of the RS2000 development kit, reproduced from the RS2000 Hardware User's Guide, is shown in Figure 3.
The default configuration is to connect the UART pins to a USB-UART chip, which allows a PC to simply connect to the kit via USB. In this configuration, a host PC application can connect to the Indy SiP using a COM port, and generate IRI traffic to communicate with the part. Impinj provides software that accomplishes this in the Indy Demo Tool(available here), which is a GUI that can exercise all of the features of Indy SiPs. There are also a number of example host PC applications written for Windows, Linux, and OS X, which are included in the ITK Release Package.
Note: Downloading the ITK Release Package requires that you create an account and sign in. Visit the link to start the process.
The second Indy SiP host connection option is to use the host UART RS-232 DB-9 connector, which allows communication with a host device signaling UART traffic at RS-232 voltage levels. If you have a USB-DB9 adapter, you can use this port in the same way you use the USB-UART on-board interface of the development kit.
Finally, the Indy SiP host can be connected by simply connecting an arbitrary UART device signaling at 3.3V to the center pin of the UART selection jumpers. This is how we will connect the MSP430 development kit in our examples.
Figure 3: RS2000 Development Kit Block Diagram
Example Hardware Setup
In order to exercise our example, we will have to connect the various parts such that they can communicate with each other. A block diagram of the connections is shown in Figure 4. The connections are listed below.
- The MSP430 launchpad should be connected to the PC via USB.
- The Indy SiP development board should be powered
- The RS500 development board is powered by a USB connection
- The RS2000 development board is powered by a 12V DC adapter
- The Mini-Guardrail antenna (or other UHF RFID antenna) should be connected to the SMA connector J2 on the Indy SiP dev kit.
- The MSP430's UART pins must be connected to the Indy SiP.
- The MSP430 UART pins are connected to J1, on pins P3.3 (RX) and P3.4 (TX), which are labeled in silkscreen on the kit.
- The RS500 development board allows connection to the UART using J14 and J16.
- MSP430 J1 P3.3 should connect to the center pin of J14
- MSP430 J1 P3.4 should connect to the center pin of J16
- The RS2000 development board allows connection to the UART using JP209 and JP210.
- MSP430 J1 P3.3 should connect to the center pin of JP209
- MSP430 J1 P3.4 should connect to the center pin of JP210
- These connections can be easily made using 100 mil pitch jumper wires, or mini-grabber wires.
- The jumpers for the Indy SiP development board headers should be set aside for this example.
A picture of a hardware setup using the RS500 SiP is shown in Figure 5. The host PC is excluded from the picture.
Figure 4: Example Block Diagrams
Figure 5: Example RS500 Hardware
Example Firmware and Software Setup
To configure the MSP430 on the USB Launchpad board to act as a USB-UART bridge, simply program the device with the firmware in the attached Code Composer Studio (CCS) project(MSP430 Indy SiP USB-UART Bridge.zip below). The CCS software is free to download.
A firmware image(MSP430 Indy SiP USB-UART Bridge.txt below) may also be programmed into the device using the standalone MSP430Flasher utility. This utility is included with the MSP-EXP430F5529LP software package in the "Binary" directory. It can be used to program the attached firmware image using the following command-line input:
MSP430Flasher.exe -n MSP430F5529 -w "MSP430 Indy SiP USB-UART Bridge.txt" -v -z [VCC] -m SBW2 (-i USB) (-e ERASE_ALL)
When connecting the MSP430 device to the PC, you will need a driver file for the USB-UART to work properly. This driver is included in the MSP-EXP430F5529LP software package, and is also attached to this page (SimpleUsbBackChannel.inf below). The device will appear in the device manager as "F5529LP simpleUsbBackchannel".
Once the MSP430 is configured as a USB-UART bridge, and is connected to the Indy SiP development board and host PC, the host PC can communicate with the Indy SiP via the USB-UART COM port, which will allow use of the Indy Demo Tool GUI(available here) as well as the PC-based IRI examples that are included with the ITK Release Package.
3. Start performing tag reads as shown in Figure 6.
a. Open the Indy Demo Tool software by double-clicking on the “Indy Demo Tool.exe” file. (available here)
b. Press the “Scan” button to detect the COM port corresponding to the hardware.
c. Press the “Connect” button to connect to the hardware.
d. Under the “Inventory” tab, start an inventory by pressing the “Start” button.
i. At this point, the “Event Log” on the right hand side of the GUI will show the stream of EPCs of the tags that are read by the Indy SiP via the mini-guardrail antenna.
e. Try moving the tag relative to the antenna, or introducing a new tag, and observe the change in the reads displayed in the Event Log.
Figure 6: Indy Demo Tool GUI Configuration
MSP430 Firmware Details
In this section we'll go into some additional detail about the firmware loaded on the MSP430.
This firmware was created by modifying one of the example projects shipped with the MSP430 USB Launchpad kit, the "SimpleUsbBackchannel" example. This example from TI demonstrates a bidirectional USB-UART bridge operating at a baud rate of 28.8 kbps. In order to make the example work as a bridge for the Indy SiP, we have to increase the baud rate to 115.2 kbps. We also have to increase the master clock speed, and add a circular buffer to store the data that is being received from the device in a timely fashion. The addition of the circular buffer in place of a simple linear buffer in the TI example allows asynchronous reads from and writes to the UART RX buffer, which in turn allows for construction of much more co-operative firmware systems.
For more details on the TI firmware, see the documentation distributed with the MSP-EXP430F5529LP software package(slac623c.zip).
See you next time!
Tune in next week to see MSP430 firmware with the Indy SiP IRI libraries on-board, sending ASCII text over the USB COM port to a PC!