I'm trying to implement checksum for some commands to communicate with internal ROM using uart. eg: commad code 0x02 + 0xFD will give id of the device. How 0xFD is calculated?
From the data sheet:
All communications from the programming tool (PC) to the device are verified by:
1. checksum: received blocks of data bytes are XORed. A byte containing the computed
XOR of all previous bytes is added to the end of each communication (checksum byte).
By XORing all received bytes, data + checksum, the result at the end of the packet
must be 0x00
2. for each command the host sends a byte and its complement (XOR = 0x00)
3. UART: parity check active (even parity)