SRI512 ISO 14443 Type B CRC calculation
Doc ID 13263 Rev 5 43/47
Appendix A ISO 14443 Type B CRC calculation
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define BYTE unsigned char
#define USHORT unsigned short
unsigned short UpdateCrc(BYTE ch, USHORT *lpwCrc)
{
ch = (ch^(BYTE)((*lpwCrc) & 0x00FF));
ch = (ch^(ch<<4));
*lpwCrc = (*lpwCrc >> 8)^((USHORT)ch <<
8)^((USHORT)ch<<3)^((USHORT)ch>>4);
return(*lpwCrc);
}
void ComputeCrc(char *Data, int Length, BYTE *TransmitFirst, BYTE
*TransmitSecond)
{
BYTE chBlock; USHORTt wCrc;
wCrc = 0xFFFF; // ISO 3309
do
{
chBlock = *Data++;
UpdateCrc(chBlock, &wCrc);
} while (--Length);
wCrc = ~wCrc; // ISO 3309
*TransmitFirst = (BYTE) (wCrc & 0xFF);
*TransmitSecond = (BYTE) ((wCrc >> 8) & 0xFF);
return;
}
int main(void)
{
BYTE BuffCRC_B[10] = {0x0A, 0x12, 0x34, 0x56}, First, Second, i;
printf("Crc-16 G(x) = x^16 + x^12 + x^5 + 1”);
printf("CRC_B of [ ");
for(i=0; i<4; i++)
printf("%02X ",BuffCRC_B[i]);
ComputeCrc(BuffCRC_B, 4, &First, &Second);
printf("] Transmitted: %02X then %02X.”, First, Second);
return(0);
SRI512 command brief SRI512
44/47 Doc ID 13263 Rev 5
Appendix B SRI512 command brief
Figure 52. Initiate frame exchange between reader and SRI512
Figure 53. Pcall16 frame exchange between reader and SRI512
Figure 54. Slot_marker frame exchange between reader and SRI512
Figure 55. Select frame exchange between reader and SRI512
Figure 56. Completion frame exchange between reader and SRI512
AI10942
Reader
SRI512
SOF Chip_ID CRC
L
CRC
H
EOF
<-t
0
-> <-t
1
->
SOF 06h CRC
L
CRC
H
EOF00h
SOF 06h CRC
L
CRC
H
EOF
AI10943
Reader
SRI512
SOF Chip_ID CRC
L
CRC
H
EOF
<-t
0
-> <-t
1
->
04h
SOF X6h CRC
L
CRC
H
EOF
AI10944
Reader
SRI512
SOF Chip_ID CRC
L
CRC
H
EOF
<-t
0
-> <-t
1
->
AI10945
Reader
SRI512
SOF Chip_ID CRC
L
CRC
H
EOF
<-t
0
-> <-t
1
->
SOF 0Eh CRC
L
CRC
H
EOFChip_ID
SOF 0Fh CRC
L
CRC
H
EOF
AI10646
Reader
SRI512
No Response
SRI512 SRI512 command brief
Doc ID 13263 Rev 5 45/47
Figure 57. Reset_to_inventory frame exchange between reader and SRI512
Figure 58. Read_block frame exchange between reader and SRI512
Figure 59. Write_block frame exchange between reader and SRI512
Figure 60. Get_UID frame exchange between reader and SRI512
SOF 0Ch CRC
L
CRC
H
EOF
AI10947
Reader
SRI512
No Response
SOF
Data 1
AI10948c
Data 2Data 3 Data 4
Reader
SRI512
CRC
L
CRC
H
EOF
<-t
0
-> <-t
1
->
SOF 08h CRC
L
CRC
H
EOFAddress
Data 1
AI10949b
Data 2 Data 3 Data 4
Reader
SRI512
CRC
L
CRC
H
EOF
SOF 09h Address
No response
S
O
F
CRC
L
CRC
H
E
O
F
AI10950
Reader
SRI512
<-t
0
-> <-t
1
->
S
O
F
CRC
L
CRC
H
E
O
F
0Bh
UID
1
UID
2
UID
3
UID
4
UID
0
UID
5
UID
6
UID
7

SRI512-W4/1GE

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
IC RFID TRANSP 13.56MHZ DIE
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet