EHUOYAN YHY521X Bedienungsanleitung

YHY521X
RFID
module
RFID/NFC Reader/Writer Module
User manual
Version 1.0
June, 2018
RFID
SMARTRFIDMODULE

EHUOYAN YHY521X
Manual
Page 2 of 36
CONTENT
1.Introduction......................................................................................................................................4
2.Gengral description..........................................................................................................................4
3.Features.............................................................................................................................................4
4.Application information ..................................................................................................................5
5.Quick reference data........................................................................................................................5
6.Ordering information ......................................................................................................................6
7.Block diagram...................................................................................................................................6
8.Pinning information.........................................................................................................................6
8.1.Pining...........................................................................................................................…….7
8.2.Pin description............................................................................................................…….7
9.Functional description.....................................................................................................................7
10.Digital interface..............................................................................................................................8
10.1.UART interface ........................................................................................................…….8
10.2.Selection of the transfer speeds...............................................................................…….8
10.3.Transfer protocol .....................................................................................................…….8
10.3.1.Host to YHY521X transfer protocol............................................................…….9
10.3.2. YHY521X to Host transfer protocol...........................................................…….9
11.Interrupt request system .............................................................................................................10
12.Antenna Power ...........................................................................................................................10
13.External antenna..........................................................................................................................10
14.YHY521X Command set .............................................................................................................11
14.1.Commands overview..............................................................................................…….11
14.2.Commands and response.......................................................................................…….12
14.2.1.Detect_Clone................................................................................................…….12
14.2.3.MConfigure..................................................................................................…….12
14.2.4.Download_Keys...........................................................................................…….16
14.2.7.Antenna_Control.........................................................................................…….17
14.2.8.Sense_mode..................................................................................................…….17
14.2.15.Card_Sleep.................................................................................................…….18
14.2.16.Card_Type .................................................................................................…….19
14.2.17.Card_ID......................................................................................................…….20
14.2.18.Block_Read................................................................................................…….20
14.2.19.Block_Write...............................................................................................…….21
14.2.20.Value_Init...................................................................................................…….22
14.2.21.Value_Read................................................................................................…….23
14.2.22. Value_Inc..................................................................................................…….24
14.2.23. Value_Dec .................................................................................................…….25
14.2.24. Value_Backup...........................................................................................…….26
14.2.25.Sector_Read...............................................................................................…….27
14.2.26.Sector_Write..............................................................................................…….28
14.2.27. Pages_Read_UL........................................................................................…….29
14.2.28. Pages_Write_UL.......................................................................................…….30
14.2.29. Ntag_Read_Text.......................................................................................…….30
14.2.30. Ntag_Write_Text......................................................................................…….31
14.2.31. Ntag_Read_URL......................................................................................…….32
14.2.32. Ntag_Write_URL.....................................................................................…….33

EHUOYAN YHY521X
Manual
Page 3 of 36
15.Electrial Characteristics..............................................................................................................34
15.1.Operating condition...............................................................................................…….34
15.2.Current consumption.............................................................................................…….35
16.Package outline.............................................................................................................................35
17.Contact information.....................................................................................................................36

EHUOYAN YHY521X
Manual
Page 4 of 36
1.Introduction
This document describes the functionality of the contactless reader/writer
YHY521X. It includes the functional and electrical specifications.
2. General description
The YHY521X is a highly integrated reader/writer for contactless
communication at 13.56MHz.The YHY521X reader supports ISO14443A/
MIFARE®mode.
The module provides a robust and efficient implementation of a demodulation
and decoding circuitry for signals from ISO/IEC 14443A/ MIFARE®
compatible cards and transponders. The digital part handles the complete
ISO/IEC 14443A framing and error detection(Parity & CRC).
In the master mode, YHY521X will seek the card or data itself and output to
host automatically.
In the slave mode, the module just needs only one command to perform one
action, such as read or write data from card’s block. The user does not need
input three steps : request, anticollision and selection. The module will do this
function for you automatically. What you need is just to send one command
to the module. Then it will send back what you want. Anything is just so
simple and so easy. Also, if there is any card goes into the RF field, the red
led on the module will light and the SIG pin will change from “1” to “0” to
indicate the event.
Host interface : Serial UART(RS232 TTL level).
3.Features
▲ Can detect UID clone card
▲ Small size and external antenna
▲Auto scan for presence of tags in and out and upload data
▲NFC NDEF text commands
▲Encrypted EEPROM to store up to 40 groups of keys
▲Contactless operating frequency 13.56 MHz
▲ Supports ISO14443A ,Mifare®Classic1K,Mifare®UltraLight, NTAG213
▲ RS232(TTL) Interface, baud rate up to 230400bps,default 19200bps
▲ Typical Operating Distance: 0 ~4cm
▲ Operating Voltage :DC 3.3V
▲ 1 LED indicator

EHUOYAN YHY521X
Manual
Page 5 of 36
▲ Size: 42mm ×26mm ×6mm
▲Weight:8g
4.Applicationinformation
YHY521X can be use on vending or game machine, secure access, parking,
payment, ticketing, leisure, member ship, time & attendance, biometrics, IT-access,
Identify, loyalty, Counter, data storage and fast data collection systems.
Figure 1. YHY521X Applications
5. Quick reference data _____________________________
Table 1: Quick reference data
Symbol Parameter Conditions Min Typ Max Unit
VCC Supply voltage GND=0V 2.7 3.3 3.6 V
IHPD Hard Power-down Current - - 10 uA
IASD Antenna Soft-down VCC =3.3V 15 20 mA
IVCC Supply Current VCC =3.3V 43 65 mA
DRW Read/Write card Distance VCC =3.3V 0 60 mm
Tamb Operating ambient temperature -25 +85 ℃
6.OrderingInformation
Table 2: Ordering Information

EHUOYAN YHY521X
Manual
Page 6 of 36
Model Number Name
YHY521X RFID module
7. Block diagram _ _____________________________
Figure 2. Simplified YHY521X Block diagram
The Analog circuitry and MFRC522 handle the modulation and demodulation
RFID signal.
The MCU handles the protocol requirements for the communication schemes
including the RF base protocols as well as the protocols for host
communication.
8. Pinning information _____________________________
8.1 Pining

EHUOYAN YHY521X
Manual
Page 7 of 36
Figure 3 – Pinning configuration
8.2 Pin description
Table 3: J1/2 Pin description
Pin Symbol Type Description
J1-1 GND PWR Power supply Ground
J1-2 VCC PWR Power supply, 3.3V DC
J1-3 TXD O Uart Transmitter
J1-4 RXD I Uart Receiver
J1-5 SIG O Interrupt output, LOW level indicates card in the field
J1-6 RFU O Reserved For Use
J4 used for connect to external antenna.
9. Functional description _____________________________
YHY521X supports the Reader/Writer mode for ISO/IEC 14443A/MIFARE card.
Figure 4 – YHY521X Reader/Writer mode

EHUOYAN YHY521X
Manual
Page 8 of 36
10. Digital interface ________ _____________________
10.1 UART Interface
Figure 5 – YHY521X UART interface to host
The YHY521X supports direct interfacing serial UART interface type(J1). It
is similar to RS232 with voltage levels according pad voltage supply.
10.2 Slection of the transfer speeds
The default transfer speed is 19200bps(19.2 k bit/s).
To change the transfer speed, the host controller has to write a value for the
new transfer speed by the CONFIG command, after reset the module, the
new speed will active.
Table 5: Selectable transfer speeds
Transfer Speed [kbit/s] Configure Code
2.4 1
4.8 2
9.6 3
14.4 4
19.2 5
38.4 6
57.6 7
115.2 8
230.4 9
10.3 Transfer Protocol
The original setting for the host and YHY521X communicates at 19200bps, N, 8, 1.
In the slave mode, the host first sends the command and the module executes the
operation and replies with a response to the command. The host can analyze the reply
to check if the operation was successful or if any error occurred during the operation.
10.3.1 Host to YHY521X Transfer Protocol
YHY521X
J1
RXD
TXD
SIG
HOST
TXD
RXD
INT1
Antenna

EHUOYAN YHY521X
Manual
Page 9 of 36
Table 5. UART frame send by host
1.
1. Header: This header has 2 bytes that indicates the beginning of a frame. These 2
bytes should be always 0xAA 0xBB.
2. Length: This byte is used to indicate the length of the payload data. This includes
the Length, Command and the Data bytes.
3. Command: This byte is used to instruct the module on what operation to perform.
4. Data: These are parameters for the module to execute the command. For example,
for a Read command, the data will be the block number to be read and the
authenticated key. For a Write command, this will be the block number and
the authenticated key and 16 bytes data to write into the block. For other
command, it maybe empty.
5. CSUM: This is the checksum byte. This byte is used on the host as well as the
module to check the validity of the packet and to trap any data
corruption. This is calculated by XOR all the bytes in the packet except
the Header and the CSUM byte.
CSUM=Length⊕Command⊕Data[0]⊕Data[1]…⊕Data[n-1]
Note: If there is one byte “0xAA” in the packet data from Length to CSUM,please
insert one byte “0x00” after “0xAA”,but the Length need not change.
Code example:
//--------------------------------------------------
if (cSendBuffer[i] == 0xAA)
{
TI = 0;
SBUF = 0;
while (!TI);
}
//--------------------------------------------------
10.3.2 YHY521X to Host Transfer Protocol
Table 6. UART frame send by YHY521X
1
.
1. Header: This header has 2 bytes that indicates the beginning of a frame. These 2
bytes should be always 0xAA 0xBB.
2. Length: This byte is used to indicate the length of the payload data. This includes
the Length, Command and the Data bytes
3. Status: This is the status for which the response is being sent back. If ok then the
module return the command which host has sent, if failure it return the
Header Length Command Data CSUM
2 Byte 1 Byte 1 Byte N Bytes 1 Byte
Header Length Status Data CSUM
2 Byte 1 Byte 1 Byte N Bytes 1 Byte

EHUOYAN YHY521X
Manual
Page 10 of 36
ones-complement code. For example, the command is 0x19, then the
ones-complement code is 0xe6.
4. Data: This contains the result data if an operation was successful. It may be empty.
5. CSUM: This is the checksum byte. This byte is used on the host as well as the
module to check the validity of the packet and to trap any data
corruption. This is calculated by XOR all the bytes in the packet except
the Header and CSUM byte.
CSUM=Length⊕Command⊕Response[0]⊕Response[1]⊕…⊕Response[n-1]
11. Interrupt Request System___ _____________________
The YHY521X indicates certain events by pin SIG. If activated, the signal on
pin SIG maybe used to interrupt the host using its interrupt handling
capabilities. This allows the implementation of efficient host software.
In the auto seek mode, if detect a card into the RF field, the SIG pin will
output “0”, else it will be “1”.
12. Antenna Power ___ _____________________
12.1 Antenna Power
You can send command Antenna-control to close the RF power and this will
save some power for the module. After switch off the antenna power, the
module will not read the RFID cards anymore until you send the command to
switch the antenna power on.
13. External antenna____________ _
The YHY521X module needs to connect to an external antenna to read and
write the RFID tags.
You can connect it to a PCB antenna or metal coil antenna. Big or small
antenna is ok if it can match the RF driver.
Figure 6 –external antenna
Inhaltsverzeichnis
Beliebte Steuereinheit Handbücher anderer Marken

Festo
Festo Compact Performance CP-FB6-E Stücklistenhandbuch

Elo TouchSystems
Elo TouchSystems DMS-SA19P-EXTME Bedienungsanleitung

JS Automation
JS Automation MPC3034A Bedienungsanleitung

JAUDT
JAUDT SW GII 6406 Series Kurzanleitung

Spektrum
Spektrum Air Module System Bedienungsanleitung

BOC Edwards
BOC Edwards Q Series Bedienungsanleitung











