Archive YW-201 User manual

Contactless Card Read/Write Module(YW-201)User’s Manual
Contactless Card Read/Write Module
YW-201
User’s Manual
(version 1.4)
English
WEB:http://www.youwokeji.com.cn
MSN&EMAIL:[email protected]
PHONE:086-10-87171913
MOBILE:086-13671114914
MANAGER:Mr Zhou
Contactless Card, RFID… Page 1 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
Content
1 Summary ....................................................................................................................................3
2 YW-200 Series Module..............................................................................................................3
3 YW-201 Characteristic...............................................................................................................3
4 Function specification................................................................................................................4
4.1 Pin Function..................................................................................................................4
4.2 Dimension.....................................................................................................................5
5 Protocols.....................................................................................................................................5
5.1 UART Protocols of Commands.....................................................................................5
5.2 IIC Protocol...................................................................................................................7
5.3 Switch of Uart and IIC..................................................................................................8
6 Command List............................................................................................................................8
7 Command test sample..............................................................................................................13
6.1.request card ..............................................................................................................13
6.2.read block ..................................................................................................................13
6.3.write block ................................................................................................................13
6.4.download key ..............................................................................................................13
6.5.initial purse ............................................................................................................13
6.6.read purse ..................................................................................................................13
6.7.increment of purse ..................................................................................................13
6.8.decrement of purse ..................................................................................................13
6.9.purse backup ..............................................................................................................13
6.9.1 initial purse 1 ..........................................................................................13
6.9.2 initial purse 2 ..........................................................................................14
6.9.3 purse backup from 1 to 2 ......................................................................14
6.9.4 read purse 2 ................................................................................................14
6.10.card halt ..................................................................................................................14
6.11.read RC500EEPROM ....................................................................................................14
6.12.write RC500EEPROM ..................................................................................................14
6.13.module IDLE ..............................................................................................................14
6.14.module set ................................................................................................................14
8 Application...............................................................................................................................15
9 About the Antenna....................................................................................................................15
10 Order ........................................................................................................................................15
Contactless Card, RFID… Page 2 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
1Summary
YW-201 contactless card Read/Write module was designed on high
integrated reader ICs for contactless communication on 13.56MHz of
Philips.YW-201 integrates MF RC500 RF base station . Engineers need not
take care how to control MF RC500 RF base station. Just send command to
module over IIC or UART.
YW-200 series contactless card Read/Write module support ISO14443-A
Mifare One S50,S70,UltraLight,MifarePro,ISO14443-B SR176, ISO15693 ,I
CODE SL2 and then other compatible card.
2YW-200 Series Module
Type Card
Protocol
Vcc Interface Card supported This Page
YW-201 ISO14443-A +5V IIC,UART(TTL) Mifare S50,S70,
Mifare Pro √
YW-202 ISO14443-A
ISO14443-B +3.3V~+5V IIC,UART(TTL)
Mifare S50,S70,
Mifare Pro,
ISO14443-B
SR176
YW-203 ISO15693 +3.3V~+5V IIC,UART(TTL) ICode SL2,
ISO15693
YW-204
ISO14443-A
ISO14443-B
ISO15693
+3.3V~+5V IIC,UART(TTL)
Mifare S50,S70,
Mifare Pro,
ISO14443-B
SR176,ICode
SL2, ISO15693
3YW-201 Characteristic
☞Completely operation of Mifare One through simple command set.
Contactless Card, RFID… Page 3 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
☞Communication Protocol:
1. UART: Baud Rate 19200bps。
2. IIC:Max rate 400Kbps。
☞Auto request card: When the card put into antenna, the pin “CARDIN”
will be low.
☞Package: DIP32.
☞Power supply :+4.5~+5.5V.
☞Read Card distance 5~10cm.(Depend on the antenna)
☞You can get C51 source code example with theh module.
4Function specification
4.1 Pin Function
Pic 1
Pin function [Table 1]:
Pin Function Description
1RX Antenna Receive
2 TGND Antenna GND
12 NC Not Use
13 NC Not Use
14 CARDIN Card In/Out Indicate(Only when auto request)
0:Card In. 1:Card Out.
15 TXD/SDA UART TXD/ IIC SDA
16 RXD/SCL UART RXD/ IIC SCL
17 VCC +5V VCC
Contactless Card, RFID… Page 4 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
18 GND GND
19 PORTSEL Communication Protocol Selector ( 0: IIC, 1:
UART )
20 NC Not Use
21 NC Not Use
31 TX1 Antenna Output 1
32 TX2 Antenna Output 2
Table 1
4.2 Dimension
Pic 2
5Protocols
5.1 UART Protocols of Commands
Uart Protocols of Commands use data blocks.The format of data block :
1) Format of TXD(MCU → YW-201 Module)
[STX] [LEN] [CMD] [DATA] [CHK] [ETX]
Description
0x02 Package
Length Commad
The
Content of
n bytes
CheckSum 0x03
Number of
Byte 1 1 1 n 1 1
Table 2
Contactless Card, RFID… Page 5 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
a) Asynchronism half duplex, 1 Start bit + 7 Data bits + 1 Stop bit.
b) The default transfer speed is 19200 bit/s.
c) Block Header STX=0x02, Block End ETX=0x03. From header to end ,but
not include the header STX and the end ETX, if there is 0x02,0x03
or 0x10 , then must add 0x10 before it.
d) Block Header STX=0x02.
e) Package Length: the byte from Length itself to Checksum, but not
include the added byte 0x10 due to 0x02,0x03 or 0x10.
f) Command: Refer to the Command List.
g) The Content of n bytes: the parameter.
h) CheckSum: XOR result from [Length] to then last byte of [Content],
but not include the added byte 0x10 due to 0x02,0x03 or 0x10.
i) Block End ETX=0x02.
Example:
CMD: 0x10,DATA:0x00
Block Header:0x02。
LEN:0x04(=1Byte(Len) +1Byte(CMD)+1Byte(DATA)+1Byte(CHK))
CMD:0x10,0x10. (Add 0x01 before 0x10)
DATA:0x00。
CHECKSUM:0x14(=0x04^0x10^0x00)
Package Send:0x02,0x04,0x10,0x10,0x00,0x14,0x03.
2) Respond Format(YW-201module →MCU)
[STX] [LEN] [CMD] [STATUS] [DATA] [CHK] [ETX]
Content
0x02 Package
Length Command
0x00:
Success
0xFF:Fail
The
Content of
n bytes
CheckSu
m
0x03
Num of
Byte 1 1 1 1 n 1 1
Table 3
Contactless Card, RFID… Page 6 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
a) Asynchronism half duplex, 1 Start bit + 7 Data bits + 1 Stop bit.
b) The default transfer speed is 19200 bit/s.
c) Block Header STX=0x02, Block End ETX=0x03. From header to end ,but
not include the header STX and the end ETX, if there is 0x02,0x03
or 0x10 , then must add 0x10 before it.
d) Block Header STX=0x02.
e) Package Length: the byte from Length itself to Checksum, but not
include the added byte 0x10 due to 0x02,0x03 or 0x10.
f) Command: Refer to the Command List.When the MCU send the command
to the module, the module send back this command to the MCU.
g) Status: Operation result. Success: 0x00. Fail: 0xFF.
h) During the communication, command content.
i) CheckSum: XOR result from [Length] to then last byte of [Content],
but not include the added byte 0x10 due to 0x02,0x03 or 0x10.
j) Block End ETX=0x02.
5.2 IIC Protocol
Table 4
1) Format of TXD(MCU →YW-201 Module)
[Address of
module](W/R) [LEN] [CMD] [DATA] [CHK]
Write:0xA0Content
Read:0xA1 Package Length Command
The
Content of
n bytes
CheckSum
Num of
Byte 1 1 1 n 1
a) Address of module (W/R):
b) When Write to module, theAddress is 0xA0.
c) When Read from module, theAddress is 0xA1.
d) Package Length: the byte from Length itself to Checksum.
Contactless Card, RFID… Page 7 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
e) Command: Refer to the Command List.
f) The Content of n bytes: the parameter.
g) CheckSum: XOR result from [Length] to then last byte of [DATA].
2) Respond Format(YW-201module →MCU)
[LEN] [CMD] [STATUS] [DATA] [CHK]
Content
Package Length Command 0x00:Success
0xFF: Fail
The
Content
of n bytes
CheckSum
Num of
Byte 1 1 1 n 1
Table 5
h) Package Length: the byte from Length itself to Checksum.
i) Command: Refer to the Command List.
j) Status: Operation result. Success: 0x00. Fail: 0xFF.
k) The Content of n bytes: the parameter.
l) CheckSum: XOR result from [Length] to then last byte of [DATA].
5.3 Switch of Uart and IIC
YW-201 Contactless card read/write module support UART and IIC, they can
be switched by the port PORTSEL
PORTSEL = 1(High), UART is selected.
PORTSEL = 0(Low), IIC is selected.
6Command List
[CMD
Name]
[Dir
]
[LEN
]
[CMD
]
[STATUS
and DATA] [Description]
System Command
1 Modue Send 0x04 0x01 0x00 4 combination with bit0 and bit1:
Contactless Card, RFID… Page 8 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
Contactless Card, RFID… Page 9 / 15
http://www.youwokeji.com.cn
0x01
0x02
0x03
Antenna Status(BIT0)
0:Turn off Antenna
1:Turn on Antenna
Auto Request(BIT1)
0:Turn off Auto Request
1:Turn on Auto Request
0x00
Setting
Retur
n 0x04 0x01
0xFF
Status:
0x00:Success
0xFF:Fail
Send 0x03 0x02
0x00
2 Power
Setting Retur
n 0x04 0x02
0xFF
Status:
0x00:Success
0xFF:Fail
Contactless card Command
0x00
Send 0x04 0x10
0x01
Request card mode:
0x00: request all card in antenna area
0x01: request card that have not halted in
antenna area
0x08 0x00
Seri
al
No
3 Request
Card
Retur
n
0x04
0x10
0xFF
Status:
0x00: Request success + Card Serial
No(4 bytes).
0xFF: Request Fail.
Send 0x0B 0x11 8Byte
Key Set(1Byte)+Block No(1Byte) +
Key(6Bytes)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7)
->0~31
0x14 0x00
Dat
a 0x00: Success, 16 bytes of data return.
4 Read
Block
Retur
n 0x04
0x11
0xFF 0xFF: Fail
5 Write
Block Send 0x1B 0x12 24bytes Key set(1Byte)+Block No(1Byte)+
Key(6Bytes)+ Data(16Bytes)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->

Contactless Card Read/Write Module(YW-201)User’s Manual
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7)
->0~31
0x00
Retur
n 0x04 0x12
0xFF
Status:
0x00:Success
0xFF:Fail
Send 0x0B 0x13 8bytes
Key Set(1Byte)+Index of Sector(1Byte)
+Key(6Bytes)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7 )
->0~31
0x44 0x13 0x00 Dat
a 0x00:success, 64bytes of data return.
6 Read
Sector
Retur
n 0x04 0x13 0xFF 0xFF:Fail
Send 0x0F 0x14 12Bytes
Key Set(1Byte)+Index of Block(1Byte)+
Key(6Bytes)+Purse Initial Value
(4Bytes,LSB)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7)
->0~31
0x00
7
Initiali
ze purse
Retur
n 0x04 0x14
0xFF
Status:
0x00:Success
0xFF:Fail
8 Read
purse Send 0x0B 0x15 8Bytes
Key Set(1Byte)+Index of Block(1Byte)+
Key(6Bytes)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7 )
->0~31
Contactless Card, RFID… Page 10 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
0x08 0x00 Dat
a 0x00: Success, 4bytes of purse value(LSB)
Retur
n 0x04
0x15
0xFF 0xFF: Fail
Send 0x0F 0x16 12Byes
Key Set(1Byte)+Index of Block(1Byte)+
Key(6Bytes) + value of
decrement(4Bytes,LSB)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7 )
->0~31
0x00
9
decremen
t
Retur
n 0x04 0x16
0xFF
Status:
0x00:Success
0xFF:Fail
Send 0x0F 0x17 12Bytes
Key Set(1Byte)+Index of Block(1Byte)+
Key(6Bytes) + value of
Increment(4Bytes,LSB)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7 )
->0~31
0x00
10
Incremen
t
Retur
n 0x04 0x17
0xFF
Status:
0x00:Success
0xFF:Fail
Send 0x0C 0x18 9Bytes
Key Set(1Byte)+Index of Block(1Byte)+
Index of Block Backup(1Byte)+Key(6Byte)
a.Key Set(1Byte):
Select Key A,B(BIT0)->0:Key A;1:Key B
Key Mode(BIT1)->
0:Use key passed.
1:Use key downloaded.
b.Index of Key Downloaded(BIT2~BIT7 )
->0~31
ps: the index of block and the backup
block must be in the same sector.
0x00
11 Purse
backup
Retur
n 0x0C 0x18 0xFF
Status:
0x00:Success
Contactless Card, RFID… Page 11 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
0xFF:Fail
Send 0x03 0x19
0x00
12 Card Halt
Retur
n 0x04 0x19
0xFF
Status:
0x00:Success
0xFF:Fail
Send 0x0A 0x1A
Index of
key(1Byte
,0~31)+
Key
(6Bytes)
0x00
13
Key
Downloa
d
Retur
n 0x04 0x1A
0xFF
Status:
0x00:Success
0xFF:Fail
Send 0x06 0x1B
Address(2Bytes)+Legnth(1Bytes)
Ps:
Address: High byte afront
Length: not more than 16
n+4 0x00
Dat
a 0x00:success, n(Length) bytes of data
return.
14
Read
RC500
EEPROM Retur
n 0x04
0x1B
0xFF 0xFF: fail
Send n+5 0x1C N bytes
data
Address(2Bytes)+Data(nBytes)
Ps:
Address: High byte afront
Data:not more than 16 bytes.
0x00
15
Write
RC500
EEPROM Retur
n 0x04 0x1C
0xFF
Status:
0x00:Success
0xFF:Fail
Table 6
Tips Turn on the antenna before the operation of contactless card.
Contactless Card, RFID… Page 12 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
7Command test sample
Samples below are based on uart protocol.
6.1.request card
Send:02 04 10 10 00 14 03
Receive:02 08 10 10 00 4D 56A2 57 F6 03
6.2.read block
Send:02 0B 11 00 3E FF FF FF FF FF FF 24 03
Receive:02 14 11 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 03
6.3.write block
Send:02 1B 12 00 3E FF FF FF FF FF FF 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 03
Receive:02 04 12 00 16 03
6.4.download key
Send:02 0A 1A 00 FF FF FF FF FF FF 10 10 03
Receive:02 0A 1A 00 FF FF FF FF FF FF 10 10 03
6.5.initial purse
Send:02 0F 14 00 3D FF FF FF FF FF FF 01 00 00 00 27 03
Receive:02 04 14 00 10 10 03
6.6.read purse
Send:02 0B 15 00 3D FF FF FF FF FF FF 23 03
Receive:02 08 15 00 10 02 00 00 00 1F 03
6.7.increment of purse
Send:02 0F 16 00 3D FF FF FF FF FF FF 01 00 00 00 25 03
Receive:02 04 16 00 12 03
6.8.decrement of purse
Send:02 0F 17 00 3D FF FF FF FF FF FF 01 00 00 00 24 03
Receive:02 04 17 00 13 03
6.9.purse backup
6.9.1 initial purse 1
Send:02 0F 14 00 3D FF FF FF FF FF FF 01 00 00 00 27 03
Receive:02 04 14 00 10 10 03
Contactless Card, RFID… Page 13 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
6.9.2 initial purse 2
Send:02 0F 14 00 3C FF FF FF FF FF FF 05 00 00 00 22 03
Receive:02 04 14 00 10 10 03
6.9.3 purse backup from 1 to 2
Send:02 0C 18 00 3D 3C FF FF FF FF FF FF 15 03
Receive:02 04 18 00 1C 03
6.9.4 read purse 2
Send:02 0B 15 00 3C FF FF FF FF FF FF 22 03
Receive:02 08 15 00 FF 04 00 00 E6 03
6.10.card halt
Send:02 10 03 19 1A 03
Receive:02 04 19 00 1D 03
6.11.read RC500EEPROM
Send:02 06 1B 00 70 10 10 7D 03
Receive:02 14 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 03
6.12.write RC500EEPROM
Send:02 15 1C 00 70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 79 03
Receive:02 04 1C 00 18 03
6.13.module IDLE
Send:02 10 03 10 02 01 03
Receive:02 04 10 02 00 06 03
6.14.module set
Send:02 04 01 00 05 03(turn off antenna)
Receive:02 04 01 00 05 03
Send:02 04 01 01 04 03(turn on antenna)
Receive:02 04 01 00 05 03
Contactless Card, RFID… Page 14 / 15
http://www.youwokeji.com.cn

Contactless Card Read/Write Module(YW-201)User’s Manual
8Application
Pic 3
9About the Antenna
For higher capability, we can select YW-300 antenna module on the
system of YW-201 Contactless card module.For more information about
YW-300 antenna module, please visit http://www.youwokeji.com.cn.
10 Order
Web:http://www.youwokeji.com.cn
Phone:+86-10-87171913
Cell phone:+86-13671114914
Email:[email protected]
Contactless Card, RFID… Page 15 / 15
http://www.youwokeji.com.cn
This manual suits for next models
3
Table of contents
Popular Control Unit manuals by other brands

Elkron
Elkron MR16 Installation and user manual

Honeywell
Honeywell VGF installation instructions

STI
STI CM Series operating instructions

EXFO
EXFO FVA-60B user guide

System Sensor
System Sensor M902M Installation and maintenance instructions

Grundfos
Grundfos CIM 150 PROFIBUS DP Functional profile and user manual