Products > Test Equipment
What is the HP 1630a learn string checksum algorithm?
<< < (3/3)
tv84:

--- Quote from: Andy Watson on January 01, 2023, 08:31:58 pm ---Yes, tried that. I tried most of the CRCs given on the wiki page, both reversed and inverted, none of them worked.

--- End quote ---

Agree. I've checked all combinations (ReflIn, ReflOut, XorIn, XorOut plus all polys) and it's impossible to calculate the CRC with the "normal" CRC algorithm.

The reason, as Andy say, it's here (in this instruction):

crc = (crc & 0xff00) ^ CRC_table[(crc ^ x) & 0xff];

The normal ReflIn CRC code uses:

crc = (crc >> 8) ^ CRC_table[(crc ^ x) & 0xff];

So, the higher byte is XORed in the "wrong" place.

2 possible reasons: programmer mistake or deliberate obfuscation by HP.

So, Andy's code is the correct solution.
cmax100000:
Thank you for all the work so far on this problem.  I am still struggling with this but my initial problem of knowing the poly value that was used to generate the CRC checksum is now something I can work with.

I haven't looked at much C code in the last 20 years so I need to make sure I am reading this string of C correctly:

In words, this line
 
"crc=(crc&oxff00)^hpcrc_table[(crc ^*buffer++)&0xff];"

is saying the new crc is equal to the old crc high byte xor'd with the crc low byte of the current buffer character,move the buffer pointer to the next character, and store the result in the high byte of the crc register.

If the words are correct, is it the software equivalent of a hardware crc by loading of the first two bytes of data, appending a 16 bit crc 0, shifting in the remaining data string in to the crc register from the right and running until the data is fully shifted in and then 16 more shifts and then taking the value of the crc register?

I am going to proceed with the answer provided by Andy as it solves my immediate problem but I remain foggy on this.


Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod