LRI64-A1S STMICROELECTRONICS [STMicroelectronics], LRI64-A1S Datasheet - Page 34

no-image

LRI64-A1S

Manufacturer Part Number
LRI64-A1S
Description
Memory TAG IC, 64-bit Unique ID with WORM User Area 13.56MHz, ISO15693 and ISO18000-3 Mode 1 Compliant
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
LRI64-A1S/1GE
Manufacturer:
ST
0
LRI64
APPENDIX B. C-EXAMPLE TO CALCULATE OR CHECK THE CRC16
ACCORDING TO ISO/IEC 13239
The Cyclic Redundancy Check (CRC) is calculat-
ed on all data contained in a message, from the
start of the Flags through to the end of Data. This
CRC is used from VCD to LRI64 and from LRI64
to VCD.
To add extra protection against shifting errors, a
further transformation on the calculated CRC is
made. The One’s Complement of the calculated
Table 20. CRC Definition
CRC Calculation Example
This example in C language illustrates one method
of calculating the CRC on a given set of bytes
comprising a message.
#define POLYNOMIAL0x8408// x^16 + x^12 + x^5 + 1
#define PRESET_VALUE0xFFFF
#define CHECK_VALUE0xF0B8
#define NUMBER_OF_BYTES4// Example: 4 data bytes
#define CALC_CRC1
#define CHECK_CRC0
void main()
{
// calculate_or_check_crc = CHECK_CRC;// This could be an other example
34/38
ISO/IEC 13239
unsigned int current_crc_value;
unsigned char array_of_databytes[NUMBER_OF_BYTES + 2] = {1, 2, 3, 4, 0x91, 0x39};
int
int
int
calculate_or_check_crc = CALC_CRC;
if (calculate_or_check_crc == CALC_CRC)
{
}
else
{
}
current_crc_value = PRESET_VALUE;
for (i = 0; i < number_of_databytes; i++)
{
CRC Type
number_of_databytes = NUMBER_OF_BYTES;
number_of_databytes = NUMBER_OF_BYTES + 2;
current_crc_value = current_crc_value ^ ((unsigned int)array_of_databytes[i]);
for (j = 0; j < 8; j++)
{
// check CRC
if (current_crc_value & 0x0001)
Length
16 bits
number_of_databytes = NUMBER_OF_BYTES;
calculate_or_check_crc;
i, j;
X
16
+ X
12
+ X
Polynomial
5
+ 1
CRC Definition
= Ox8408
CRC is the value attached to the message for
transmission.
For checking of received messages the 2 CRC
bytes are often also included in the re-calculation,
for ease of use. In this case, given the expected
value for the generated CRC is the residue of
F0B8h
Direction
Backward
Preset
FFFFh
Residue
F0B8h

Related parts for LRI64-A1S