DCC Error checking byte
Im wondering if someone could assist me in this area.
I am trying to figure out how to generate the error byte in a DCC pkacets.
With the general packet format (according to S9.2) the error byte is simply:
address_byte ^ data_byte
^ = XOR
My confusion is with extended packets.
RP9.2.1 says on page 2, line 97:
"The last byte of the packet is the Error Detection Byte, which is calculated the same as is done in the baseline packet
using all address, and all instruction bytes (see S-9.2). "
Now lets take an example from page 11 of RP9.2.1 where an extended packet has the following format:
10AAAAAA 0AAA11VV VVVVVVVV DDDDDDDD EEEEEEEE
(EEEEEEEE being the error byte.)
To generate the error byte do I perform the following?
10AAAAAA ^ 0AAA11VV ^ VVVVVVVV ^ DDDDDDDD
Or this (which I think will give me the same result anyway)
10AAAAAA ^ 0AAA11VV = temp
temp ^ VVVVVVVV = temp
temp ^ DDDDDDDD = EEEEEEEE
Are there any other ways to interpret the RP?
Last edited by basil4j : 02-12-2009 at 03:53 PM.