Note: CRC Cyclic Redundancy error verification Calculation Method
The CRC-16 (Cyclic Redundancy error check) generates the CRC-16 validation byte as follows:
(1) load a 16-bit register. All digits are 1.
(2) The high byte of the 16-bit register is "exclusive" to the start 8-bit byte. Put the calculation result into this 16-bit register.
(3) shift the 16-bit register to the right by one.
(4A) if the number of digits removed from the right (flag bit) is 1, a polynomial 1010000000000001 is generated and the register is used for the "XOR" operation.
(4B) if the number of digits removed from the right is 0, return (3 ).
(5) Repeat (3) and (4) until 8 digits are removed.
(6) the other 8 digits and the 16-digit register perform the "XOR" operation.
(7) Repeat (3)-(6) until all bytes in the message are "exclusive or" with 16-bit registers, and are shifted 8 times.
(8) The content of this 16-bit register is a 2-byte CRC error check.