I’m decoding the DCC-protocol. For This purpose, i programmed another microcontroller to generate a frame that has address 23 (green), data: 170 (blue) and yellow is a checksum. The checksum is the binary xor of data and address (189). A frame is preceded by a preamble. I’m able to detect this preamble. Afther the preamble, i’m shifting the bits of the packet in a dword variable.
Using a serial terminal, I discoverd someting strange. Using the print library I printed the frame dword variable in binary to the terminal. As you can figure out, the frame is correctly decoded by my Interrupt service routine. The strange thing is that the terminal tells me that the address is 47, the data byte 94 and the checksum 189 (instead of 23 and 170). So only the checksum is correct. When you write 47 and 94 in binary it’s easy to figure out that incorrect bits are used to calculate the value of address_byte and data_byte. Received frame: xxxxx000101110101010100101111011 (this frame is correct) Var bit*8 addres_byte at frame:19 00101111 (according to the terminal, address is 47 instead of 23). Var bit*8 data_byte at frame:10 01011110 (according to the terminal, data is 94 instead of 170). Var bit*8 checksum_byte at frame: 1 10111101 What’s going wrong? When compiling a program jaledit tell's me that i'm using version jalv24q5. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/jallib. For more options, visit https://groups.google.com/d/optout.
