J1939 message counter & checksum function
Would it be possible to have a standard funtion that we can select when required, the standard J1939 checksum and message counter as used in the TSC1 SPN 4206 & 4207.
The J1939 SAE spec suggest the CRC calculation to be
Checksum = (Byte1 + Byte2 + Byte3 + Byte4 + Byte5 + Byte6 + Byte7 + message counter & 0x0F + message ID low byte + message ID mid low byte + message ID mid high byte + message ID high byte)
Message Checksum = (((Checksum >> 6) & 0x03) + (Checksum >>3) + Checksum) & 0x07
Please sign in to leave a comment.
Comments
2 comments