• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

633 crc generation...

Fletch

New member
I'm not a C programmer, but I've stubled through the WinTest source code. I believe I've found and understtod the CRC calculation. But I'm missing something, becuse my crc calculations don't match those I've see WinTest generating. Can someone take a look at the following and let me know where I'm stumbling?

Send ping packet from host to CFA633
Type: 0 ttcccccc
00000000
Data Length: 0
Packet to send: 0x0000 0x0000

Calculate the CRC
b1 = data
w1 = seed
w2 = w1 ^ b1
b2 = w2 & 0xFF
w3 = crcLookup(b2)
w4 = seed >> 8
crc = w4 ^ w3

First byte -> data = 0x0000 seed = 0xFFFF

b1 = 0x0000
w1 = 0xFFFF
w2 = 0xFFFF ^ 0x0000 = 0xFFFF
b2 = 0xFFFF & 0x00FF = 0x00FF
w3 = crcLookupTable(16) = 0x0F78
w4 = 0xFFFF >> 8 = 0x0
crc = 0x0000 ^ 0x0F78 = 0x0F78

Second Byte -> data = 0x0000 seed 0x0F78

b1 = 0x0000
w1 = 0x0F78
w2 = 0x0F78 ^ 0x0000 = 0x0F78
b2 = 0x0F78 & 0x00FF = 0x0078
w3 = crcLookupTable(120) = 0xFFCF
w4 = 0x0F78 >> 8 = 0x000F
crc = 0x000F ^ 0xFFCF = 0xFFC0

So my crc calculates to 0xFFC0 but WinTest is generating 0x0F47... can anyone tell me what I'm doing wrong? Thanks.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
USB LCD Displays - Graphic and Character LCDs with a Keypad
Top