1. Crc16

1.1. Function description:

This demo shows the calculation of 16 bits CRC.

Configure the size of the polynomial is 16 bits for CRC16 calculation.

  • Configure the CRC16.

  • Write data to CRC calculator to start hardware calculation.

  • Calculate the result of the CRC16 by software, then to compare with the hardware.

1.2. Detail configuration:

1.2.1. Crc16/ibm

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0

byte

byte

16 bits

0x8005

0

1.2.2. Crc16/maxim

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0

byte

byte

16 bits

0x8005

0xffff

1.2.3. Crc16/usb

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0xffff

byte

byte

16 bits

0x8005

0xffff

1.2.4. Crc16/modbus

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0xffff

byte

byte

16 bits

0x8005

0

1.2.5. Crc16/ccitt

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0

byte

byte

16 bits

0x1021

0

1.2.6. Crc16/ccitt-false

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0xffff

no

no

16 bits

0x1021

0

1.2.7. Crc16/x25

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0xffff

byte

byte

16 bits

0x1021

0xffff

1.2.8. Crc16/xmodem

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0

no

no

16 bits

0x1021

0

1.2.9. Crc16/dnp

Initial value

Reverse input

Reverse output

Polynomial size

Coefficients

Xor value

0

byte

byte

16 bits

0x3d65

0xffff

1.3. Test result:

If the output result is same as the result calculated by software according to the theory, then print "pass", or print "fail".

1.4. IO connection:

None