DLPU057A March 2018 – April 2022
The checksum and data length computed will not take into account the presence of START CHARACTER and any ESCAPE CHARACTERs present in the byte stream. START CHARACTERs are not included when the checksum is computed. ESCAPE CHARACTERs are replaced with interpreted data for checksum computation.
For example, if master needs to send backlight value 0xA55A (42330) (see Section 3.2.1 for description of Backlight command), the original data without start and escape characters look like:
CMD | LEN | D0 | D1 | CKSUM |
0x00 | 0x02 | 0xA5 | 0x5A | 0x01 |
Since the byte stream contains 0xA5 and 0x5A they need to be properly masked. Besides, the START CHARACTER should also be send before the actual CMD Byte. Note that the checksum did not change (the START and ESCAPE characters were not added to the checksum).
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 |
START | CMD | LEN | D0 | D0 | D1 | D1 | CKSUM |
0xA5 | 0x00 | 0x02 | 0x5A | 0X00 | 0x5A | 0x5A | 0x01 |
On receiving the above byte stream, Piccolo treats Byte 3 and Byte 4 together as a single byte which has value 0xA5 and Byte 5 and Byte 6 together as a single byte which has value 0x5A.
More examples can be found in Section 4.2.