Texas Instruments | Communicating With the RFID Base Station | Application notes | Texas Instruments Communicating With the RFID Base Station Application notes

Texas Instruments Communicating With the RFID Base Station Application notes
Application Report
SWRA283 – September 2011
Communicating With the RFID Base Station
Stefan Recknagel .............................................................................................................................
ABSTRACT
This document describes the USB RFID base station that is delivered with the eZ430-TMS37157 demo
tool. It does not describe the GUI that is delivered with the tool [for a description of the GUI and other
information about the tool, see the eZ430-TMS37157 Development Tool User's Guide (SLAU281)]. This
application report helps the reader design a custom Windows GUI to control the RFID base station. The
RFID base station is capable of communicating with all Digital Signature Transponder (DST) compliant
Texas Instruments transponders.
1
2
3
4
Contents
Introduction ..................................................................................................................
Communication Protocol Between Host PC and Base Station .......................................................
Summary .....................................................................................................................
References ...................................................................................................................
2
3
5
5
List of Figures
...........................................................................
1
Com Port Settings for the USB Base Station
2
Downlink Protocol Structure ............................................................................................... 3
3
Command Byte 1
4
5
...........................................................................................................
Command Byte 2 ...........................................................................................................
Uplink Protocol Structure...................................................................................................
2
3
4
4
List of Tables
1
PWM Timings for Downlink Protocol ..................................................................................... 2
2
PPM Timings for Downlink Protocol ...................................................................................... 2
3
Downlink Protocol Bytes ................................................................................................... 3
4
Command Byte 1 Description ............................................................................................. 3
5
Command Byte 2 Description ............................................................................................. 4
6
Uplink Protocol Bytes ....................................................................................................... 5
SWRA283 – September 2011
Submit Documentation Feedback
Communicating With the RFID Base Station
Copyright © 2011, Texas Instruments Incorporated
1
Introduction
1
www.ti.com
Introduction
The base station implements a USB to serial converter that emulates a COM port in Windows. Figure 1
shows the COM port settings that are necessary for communication with the base station.
Figure 1. Com Port Settings for the USB Base Station
Upon receipt of a transponder command, the base station sends the command to an RFID transponder
and also receives the answer if a transponder is in range. The downlink modulation [Pulse Width
Modulation (PWM) or Pulse Position Modulation (PPM)] and the decoding of the transponder response
[frequency shift keying (FSK) modulated] are handled in the base station.
The base station is capable of using PWM or PPM for the downlink protocol; the timings are predefined in
the base station and cannot be changed (see Table 1 and Table 2). The user does not need to know
these timings for communication with the base station; these are provided for information only.
Table 1. PWM Timings for Downlink Protocol
SYMBOL
TIME
NODE
Toff low bit
170 µs
Transmitter off time for a low bit
Ton low bit
330 µs
Transmitter on time for a low bit
Toff high bit
480 µs
Transmitter off time for a high bit
Ton high
520 µs
Transmitter on time for a high bit
Table 2. PPM Timings for Downlink Protocol
2
SYMBOL
TIME
NODE
Toff low bit
170 µs
Transmitter off time for a low bit
Ton low bit
230 µs
Transmitter on time for a low bit
Toff high bit
170 µs
Transmitter off time for a high bit
Ton high
350 µs
Transmitter on time for a high bit
Communicating With the RFID Base Station
Copyright © 2011, Texas Instruments Incorporated
SWRA283 – September 2011
Submit Documentation Feedback
Communication Protocol Between Host PC and Base Station
www.ti.com
2
Communication Protocol Between Host PC and Base Station
2.1
Downlink Protocol from Host PC to Base station
The downlink protocol to initiate a transponder command is shown in Figure 2. The base station
immediately sends the corresponding command to the RFID transponder and sends a response back to
the host PC, regardless of whether or not a transponder was in range.
Figure 2. Downlink Protocol Structure
Table 3. Downlink Protocol Bytes
BYTE
NODE
Start
Start byte indicating a new command = 0x01
Length
Length of the whole command (bytes) excluding start byte, length and LRC
CMD1
Command byte 1
CMD2
Command byte 2 (optional)
PB1
Length of power burst 1 in ms – charge time to charge the VCL capacitor, can be extended to 2 bytes
#TX-bits
Number of bits transmitted to the transponder
TX Data
Data transmitted to the transponder
PB2
Length of power burst 2 in ms, needed for a programming or MSP access command
#RX-bytes
Number of bytes which the transponder will send back, usually 0x0A – 10 bytes (TMS37157)
LRC
Redundancy check over the data sent to the base station, excluding start byte
The structure of command byte 1 is shown in Figure 3, and its bits are explained in Table 4.
msb
lsb
Figure 3. Command Byte 1
Table 4. Command Byte 1 Description
COMMAND
FINISHED?
Bit 7
PB LENGTH
Bit 6
COMMAND TYPE
RESERVED
Bits 5 - 4
Bit 3
Indicates if one additional command byte is following
0
No command byte is following
1
Command byte is following
Length of PB1 is one or two bytes
0
PB1 is one byte
1
PB1 is two bytes
Low-frequency command type
00
Standard transponder commands (default)
01
Reserved
10
Reserved
11
Reserved
Reserved
0
SWRA283 – September 2011
Submit Documentation Feedback
Default
Communicating With the RFID Base Station
Copyright © 2011, Texas Instruments Incorporated
3
Communication Protocol Between Host PC and Base Station
www.ti.com
Table 4. Command Byte 1 Description (continued)
RESPONSE
Bit 2
PWM/PPM
Bit 1
MODE
Bit 0
Determines which response can be expected
0
Reserved
1
LF response (default)
Chooses which modulation is used for LF downlink protocol
0
PWM modulation is used
1
PPM modulation is used
Chooses between transponder mode or setup mode
0
Transponder mode (default)
1
Reserved
If bit 7 of command byte 1 is set, command byte 2 must follow. The majority of bits in command byte 2 are
reserved. Command byte 2 is needed only for a battery charge command, if the magnetic field must stay
on after power burst 2 and no response is expected. The structure of command byte 2 is shown in
Figure 4 and its bits are explained in Table 5.
msb
lsb
Figure 4. Command Byte 2
Table 5. Command Byte 2 Description
COMMAND
FINISHED?
RESERVED
Bit 7
Bit 6 - 5
Indicates if one additional command byte follows
0
No command byte follows (default)
1
Command byte follows
Reserved
00
KEEP TX ON/OFF
RESERVED
Bit 4
Bits 3 - 0
0
Turn TX off after PB2
1
Keep TX on after PB2 (no response)
Reserved
0000
2.2
Default
Chooses if the magnetic field (TX) should stay on after PB2 (for battery charge)
Default
Uplink Protocol from Base Station to Host PC
The uplink protocol for the communication from the base station to the host PC is similar to the downlink
protocol. The transponder answer is usually 12 bytes (TMS37157), the base station automatically deletes
the 2-byte pre-bit phase; the first transponder data is then the start byte (0x7E for the TMS37157). This
results in a length of 10 bytes for transponder data. The length of the uplink protocol is always 14 bytes for
standard transponder commands. Figure 5 shows the structure of the uplink protocol, and its bytes are
described in Table 6.
Figure 5. Uplink Protocol Structure
4
Communicating With the RFID Base Station
Copyright © 2011, Texas Instruments Incorporated
SWRA283 – September 2011
Submit Documentation Feedback
Summary
www.ti.com
Table 6. Uplink Protocol Bytes
BYTE
NODE
Start
Start byte indicating an new command 0x01 (by default)
Length
Length of the whole command (bytes) excluding start byte, length and LRC, usually 0x0B – 11 bytes
(TMS37157)
00
Reserved. 0x00 (default).
Transponder data
Response of the transponder begins usually with 0x7E (TMS37157)
LRC
Redundancy check over the data sent to the base station, excluding Start byte
If no transponder is in range or a battery charge command was performed, the base station responds by
setting the whole transponder data (10 bytes) to 0x0.
2.3
How to Calculate the Longitudinal Redundancy Check (LRC)
The base station calculates the LRC over all bytes of the incoming and outgoing data excluding the start
byte. The LRC byte is calculated by performing a XOR over the bytes. The user has to calculate the LRC
over the data he sends to the base station and add it to the send string. The LRC is always the last byte
of the outgoing or incoming data. The user can calculate the LRC over the received data and compare it
with the received LRC for error detection.
−
The source code below shows a calculation routine for the LRC. It returns the LRC as a byte value.
3
public byte LRC_calc(byte[] bytes, int length)
{
int lrc;
lrc = bytes[0];
for (int i = 1; i < length; i++)
{
lrc = lrc ^ bytes[i];
}
return (byte)(lrc);
}
Summary
This application report provides the user of the RFID base station the possibility of writing a custom GUI
for communicating with the RFID base station. In conjunction with the TMS37157 PaLFI data sheet, the
user can create custom transponder commands that extend the capabilities of the RFID demo software
delivered with the eZ430-TMS37157 demo tool.
4
References
1. TMS37157 Passive Low-Frequency Interface (PaLFI) Device With EEPROM and 134.2-kHz
Transponder data sheet (SWRS083)
2. eZ430-TMS37157 Development Tool User's Guide (SLAU281)
3. Low-Frequency RFID in a Nutshell (SWRA284)
SWRA283 – September 2011
Submit Documentation Feedback
Communicating With the RFID Base Station
Copyright © 2011, Texas Instruments Incorporated
5
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,
and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should
obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are
sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard
warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where
mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,
or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied
by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive
business practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional
restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all
express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not
responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonably
be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governing
such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and
acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their products
and any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may be
provided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in
such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at
the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are
designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designated
products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Applications
Audio
www.ti.com/audio
Communications and Telecom www.ti.com/communications
Amplifiers
amplifier.ti.com
Computers and Peripherals
www.ti.com/computers
Data Converters
dataconverter.ti.com
Consumer Electronics
www.ti.com/consumer-apps
DLP® Products
www.dlp.com
Energy and Lighting
www.ti.com/energy
DSP
dsp.ti.com
Industrial
www.ti.com/industrial
Clocks and Timers
www.ti.com/clocks
Medical
www.ti.com/medical
Interface
interface.ti.com
Security
www.ti.com/security
Logic
logic.ti.com
Space, Avionics and Defense
www.ti.com/space-avionics-defense
Power Mgmt
power.ti.com
Transportation and Automotive www.ti.com/automotive
Microcontrollers
microcontroller.ti.com
Video and Imaging
RFID
www.ti-rfid.com
OMAP Mobile Processors
www.ti.com/omap
Wireless Connctivity
www.ti.com/wirelessconnectivity
TI E2E Community Home Page
www.ti.com/video
e2e.ti.com
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2011, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising