0% found this document useful (0 votes)
124 views

T55x7 Protocol PDF

The document describes the communication protocol for a T55x7 reader/writer including the command format, reader response format, example commands, and error codes. The communication is byte oriented using hexadecimal values with selectable baud rates from 9,600 to 115,200 bps. The command format includes a header, length, reader ID, command code, data, and checksum. The reader response echoes back similar fields with the addition of a status field. Example commands are given for write, protected write, wake up, direct access with/without password, page read, and reset operations.

Uploaded by

william081
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

T55x7 Protocol PDF

The document describes the communication protocol for a T55x7 reader/writer including the command format, reader response format, example commands, and error codes. The communication is byte oriented using hexadecimal values with selectable baud rates from 9,600 to 115,200 bps. The command format includes a header, length, reader ID, command code, data, and checksum. The reader response echoes back similar fields with the addition of a status field. Example commands are given for write, protected write, wake up, direct access with/without password, page read, and reset operations.

Uploaded by

william081
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

T55x7 reader/writer

Communication Protocol

Communication Setting
The communication protocol is byte oriented. Both sending and receiving bytes are in
hexadecimal format. The communication parameters are as follows
Baud rate : 9,600 ~ 115,200 bps / Data : 8 bits / Stop: 1 bit / Parity: None / Flow control : None
Command Format
header + length + reader ID + command code + command data + checksum
Header : 2 Byte , 0xAABB
Length : 2 Byte (word)
Reader ID : 2 Byte , 00 00
Command code : 2 Byte (word)
Command data : command data value (can be blank)
Checksum : 1 Byte (XOR from reader ID to command data)

Reader response format


header + length + reader ID + command code + status

+ return data + checksum

Header : 2 Byte , 0xAABB


Length : 2 Byte (word)
Reader ID : 2 Byte , random value if No specific
Command code : 2 Byte (word)
Status

: 1 Byte , 00 = success

Data : return data (can be blank)


Checksum : 1 Byte (XOR from reader ID to return data )

Command Set
void Standard_Write(unsigned char opcode ,unsigned char lock ,unsigned char *
Data ,unsigned char block )
Function

: write data

Parameter :
OPCODE

: operation code page , 0x10B(DEC 2 refer to page0) or 0x11B (page 1)

LOCK

: data lock , 0 = No , 1 = Yes

Data

: 4 Byte , data value

BLOCK

: Block number

Command code : (0x2001)


AA BB Len1 len2 00 00 01 20 opcode , lock , xx xx xx xx , block , xor ,

Sample :
AA BB, 0b 00, 00 00 ,01 20 ,02 , 00 , 11 11 11 11 , 01 , 22
AA BB 0b 00 00 00 01 20 02 00 11 11 11 11 01 22
Respond : aa bb len1 len2 , 00 00 , 01 20 , Status ,xor
void Protected_Write(unsigned

char opcode ,unsigned char * PassWord ,

unsigned char lock ,unsigned char * Data ,unsigned char block)


Function : write protect
Parameter :
OPCODE

: operation code page , 2(0x10B) or 3(0x11B)

Password : password data = BLOCK 7 data , 4 Byte


LOCK
Data

: data lock , 0 = No , 1 = Yes


: 4 Byte , data value

BLOCK : Block number


Command code : (0x2002)
AA BB Len1 len2 00 00, 02 20 opcode , PW1 PW2 PW3 PW4,lock , xx xx xx xx , block ,
xor ,
Sample :
AA BB, 10 00, 00 00 ,02 20 ,02 ,77 77 77 77 , 00 , 11 11 11 11 , 01 , 21
Respond : aa bb len1 len2 , 00 00 , 01 20 , Status ,xor (refer to return format)
void Wake_Up(unsigned char * PassWord)
Function : wake up Card
Parameter :
PassWord

: 4 Byte card password

command code : (0x2003)


AA BB , len1 len2 , 00 00 , 03 20 , Pw1 Pw2 Pw3 Pw4 ,xor
Sample

: aa bb , 09 00 ,00 00 ,03 20 , 77 77 77 77 , 23

Respond : aa bb len1 len2 , 00 00 , 01 20 , Status ,xor

void Direct_Access_PWD(unsigned char opcode ,unsigned char * PassWord ,


unsigned char block)
function : direct access password
Parameter :
OPCODE : operation code page , (0x10B) or (0x11B)
PassWord

: 4 Byte card password

BLOCK : Block number

Command code : (0x2004)


AA BB , len1 len2 , 00 00 , 04 20 , opcode , Pw1 Pw2 Pw3 Pw4 ,block , xor
Sample

: aa bb , 0b 00 ,00 00 ,04 20 , 02, 77 77 77 77 , 04 , xor

Respond : aa bb len1 len2 , 00 00 , 01 20 , Status ,xor


void Direct_Access(unsigned char opcode

,unsigned char block)

Function : Direct access


Parameter :
OPCODE

: OPCODE :

BLOCK

operation code page , (0x10B) or (0x11B)

Block number

Command code : (0x2005)


AA BB , len1 len2 , 00 00 , 05 20 , opcode , block , xor
Sample

: aa bb , 07 00 ,00 00 ,05 20 , 02, 04 , xor

Respond : aa bb len1 len2 , 00 00 , 01 20 , Status ,xor


void Page_Regular_Read(unsigned char opcode)
function : Page_Regular_Read . can switch to page 0 or page 1 , opcode == 10 = 2 =
page 0
paramter : opcode == 0x10B = 2 DEC = page 0
opcode == 0x11B = 3 DEC = page 1
command code : (0x2006)
AA BB , len1 len2 , 00 00 , 05 20 , opcode , xor
Sample

: aa bb , 06 00 ,00 00 ,06 20 , 02 , xor

Respond : aa bb len1 len2 , 00 00 , 06 20 , Status ,xor


void Reset_Command()
Function : Reset

R55x7 card

Command code : (0x2007)


AA BB , len1 len2 , 00 00 , 07 20 ,
Sample

xor

: aa bb , 05 00 ,00 00 ,07 20 , xor

Respond : aa bb len1 len2 , 00 00 , 07 20 , Status ,xor


Unsigned char T55x7_Read(unsigned char length , unsigned char * Data )
Function : read T55x7 card ;

00 = card correct

Parameter :
length : return data length ,4 multiple value , max. value 28
Data : return card data
Command code : (0x2008)

AA BB , len1 len2 , 00 00 , 08 20 ,
Sample

xor

: aa bb , 05 00 ,00 00 ,08 20 , xor

Respond : aa bb len1 len2 , 00 00 , 08 20 , Status , , , xor


(e.g.)
aa bb 22 00 7b 00 08 20 00 66 66 66 66 55 55 58 88 33 33 37 77 44 44 88 88 55 99 45
67 12 34 56 78 77 77 77 77 25 (read 28 byte data)
Pls refer to T55x7 datasheet in detail

Error code :
0x00 = success , non zero = error
Error code

Description

10

General error

11

Command cant be support

12

Parameter error

20

access card error

21

Card reset error

22

Verify error

23

Read card error

24

Write card error

You might also like