High frequency 13,56 MHz RFID solutions offer ideal close-proximity identification for
product authentication, parcel tracking, document management, library and ticketing
applications.
This application note describes how to build an RFID (radio frequency identification) shortrange reader using STMicroelectronics STM8S-DISCOVERY and ISO14443 type-B CR14
contactless coupler. The STM8S-DISCOVERY and the CR14 communicate through an I
bus.
The resulting RFID reader can exchange data with ISO 14443-2 type-B proximity PICCs
(proximity integrated coupling cards) also called tags. Communications are possible only
when the tags are present in the electromagnetic field generated by the reader built-in
antenna.
Once the STM8S-DISCOVERY is powered up through a USB cable connected to the host
PC, an electromagnetic field is generated by the RFID reader. A beep is emitted and the
LED LD1 briefly lights up when an ISO 14443-2 type-B proximity tag is detected by the
reader and its unique identifier (UID) successfully read.
2
C
The STM8S-DISCOVERY can be used to evaluate the main features of all STM8S MCUs,
even if it is built on an STM8S105C6T6.
Reference documents
■ STM8S-DISCOVERY evaluation board user manual (UM0817).
■ Developing and debugging your STM8S-DISCOVERY application code (UM0834).
■ User manual “CR14 and CRX14 reference design PCB Gerber files” (UM0672) and RFID
This application is built around a short range RFID reader PCB developed by
STMicroelectronics. The PCB Gerber files and the user manual "CR14 and CRX14
reference design PCB Gerber files" (UM0672) are available from http://www.st.com.
This board is designed to be connected to a digital host, in this case an STM8SDISCOVERY, which manages data transmission and reception through an I
(see Figure 1).
The tags supported by this application must be based on ST contactless memories
compliant with ISO 14443 part2 type-B standard for the radio-frequency power and signal
interface.
This application has been tested using a tag based on ST SRI2K short range contactless
EEPROM. Refer to application note AN2866 explaining how to design a 13.56 MHz tag
antenna.
Figure 1.Short range RFID reader solution
Resistors
TS1
GPIO's
LD1
Buzzer
USB
STLINK
SWIM
5V
3V3
STM8S105C6T6
SO16
footprint
2
C interface
RP1
RP2
I2C bus
J1
HE10
STMicroelectronics
CR14
STM8S-DISCOVERY
RFID reader PCB
Doc ID 17784 Rev 15/24
Application descriptionAN3255
1.2 Short-range contactless communication principles
1.2.1 CR14 contactless coupler
The CR14 is the main component of the RFID reader PCB. It interfaces with the following
components:
●The contactless tags
The data frames exchanged with the tags are compliant with ISO14443 type-B radio
frequency protocol. Data are stored in the CR14 input/output Frame registers (see
Table 1: CR14 control registers).
●The STM8S105C6T6 through the I
The CR14 is organized as 4 functional blocks:
●The I²C bus controller
It handles the serial connection with the STM8S105C6 application host, and controls
the read/write accesses to all CR14 registers. It is compliant with the 400 KHz I
specification.
●The RAM buffer
The RAM buffer is bidirectional. It stores all the request frame bytes to be transmitted to
the tag, plus all the received bytes sent back by the tag on the answer frame.
●The transmitter
It powers the tag by generating a 13,56 MHz signal on an external antenna. The
resulting field is 10% modulated using ASK (amplitude shift keying) modulation to
transmit data.
●The receiver
It demodulates the signal generated on the antenna by the load variation of the tag.
The resulting signal is decoded by an 847 KHz BPSK (binary phase shift keying) subcarrier decoder.
2
C bus.
2
C bus
The CR14 generates an electromagnetic field which is rectified to power the tag. The reader
transmits information to the tag by modulating the carrier wave. To transmit information back
to the reader, the tag backscatters the carrier wave by modifying its own impedance thereby
perturbing the field.
The CR14 chip contains six volatile registers of which three allow to configure the CR14 and
to transmit/receive frames to/from the tag (see Ta bl e 1 ):
●Parameter register
●Input/Output Frame register
●Slot Marker register
For details regarding registers description and CR14 I
datasheet.
Table 1.CR14 control registers
AddressDescriptionAccessPurpose
00hParameter register1 byte
6/24Doc ID 17784 Rev 1
2
C protocol, refer to the CR14
WSet parameter register
RRead parameter register
AN3255Application description
Table 1.CR14 control registers (continued)
AddressDescriptionAccessPurpose
Store and send request
01h
02hST reservedN/A
03hSlot Marker register1 byte
04hST reservedN/AR and W
Input/Output Frame
register
36 bytes
W
R
W
R
W
RReturn FFh
frame to the tag. Wait for
tag answer frame
Transfer tag answered
frame data to host
ST reserved, must not be
used
Launch the automated anticollision process from
Slot_0 to Slot_15
ST reserved, must not be
used
05hST reservedN/AR and W
1.2.2 I2C polling using Ack
During radio frequency data exchange, the CR14 disconnects itself from the I2C bus. The
time needed to complete the exchange is not fixed as it depends on the tag command
format. To know when the exchange is complete before starting reading the data in the
Input/Output Frame register, the bus master uses an Ack polling sequence that performs the
following actions:
1.Initial condition: a radio frequency data exchange is in progress.
2. Step 1: the master issues a START condition followed by the first byte of the new
instruction (Device Select Code plus R/W bit = 1) (see Appendix A: I2C memory
addressing).
3. Step 2: if the CR14 is busy, no Ack is returned and the master goes back to Step 1. If
the CR14 has completed the radio frequency data exchange, it responds by sending
back an ACK, thus indicating that it is ready to receive the second part of the next
instruction (the first byte of this instruction has been sent during Step 1).
Figure 2 shows the detailed I²C Ack polling flowchart.
ST reserved, must not be
used
Doc ID 17784 Rev 17/24
Application descriptionAN3255
2ADIO&REQUENCY
DATAEXCHANGE
INPROGRESS
3END
34!24CONDITION
3END#2
$EVICE3ELECT
#ODEWITH27
!#+
RETURNED
./
2EADDATABYTES
FROM#2
9%3
#2)£#
DISCONNECTED
AI
Figure 2.Ack Polling flowchart
1.2.3 Reader-tag protocol
Standard tag commands such as Read and Write are generated by the CR14 using its
Input/Output Frame register. To send a command to the tag, the STM8S105C6 host first
generates internally the complete frame containing the command code followed by the
command parameters (if required). Only the 2 CRC bytes must not be generated as the
CR14 automatically adds them during the RF transmission.
Once the frame is ready, the host writes it into the Input/Output Frame register using an I
Write command.
If the tag answers, the characters received are demodulated, decoded and stored into the
input/output frame buffer. During the entire RF transmission, the CR14 disconnects itself
from the I
the I
2
C bus. On reception of the tag EOF, the CR14 checks the CRC and reconnects to
2
C bus. The host can then get the tag answer frame by issuing an Input/Output Frame
Register Read command on the I
Refer to the CR14 datasheet for details on Read and Write commands.
1.2.4 Commands and tag states
The tag can be switched into different states (see Figure 3). The tag only answers specific
commands depending on its current state. These states are specified by the ISO 15693
standard. For details concerning these states, refers to one of ST short range contactless
EEPROM datasheet (for example SRI2K) available from http://www.st.com.
2
C bus.
2
C
8/24Doc ID 17784 Rev 1
Loading...
+ 16 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.