Datasheet

Β© 2020 Integrated Device Technology, Inc.
12
September 9, 2020
8. Calculating Checksum
The checksum used for data integrity is the 2’s complement (negative) of the 256-modulo (8-bit) sum of the data bytes (does not include I2C
address).
Figure 7 shows the 5 bytes read:
Example:
Byte 1, 0xCC (Checksum)
Byte 2, 0x01
Byte 3, 0x99
Byte 4, 0x01 or 0x00
Byte 5, 0x99 or 0x00
The 256-modulo (8-bit) sum is calculated as:
π‘ π‘’π‘š = 0π‘₯01 + 0π‘₯99 + 0π‘₯01 + 0π‘₯99 = 0π‘₯134
Validating the data payload is done by calculating the sum and adding it to the checksum. If the result is 0x00, then the data is valid.
π‘β„Žπ‘’π‘π‘˜π‘ π‘’π‘š + π‘ π‘’π‘š = 0π‘₯𝐢𝐢 + 0π‘₯134 = 0π‘₯00