>I'm in the middle of building a debugger for my VM and I am starting to use
>the interface to the debugger. The format of the messages back and forth
>from POSEr or the device, require a CRC16 checksum. I've tried to find
some
>on the net and have had a very difficult time. I found one, but I can't
>seem to make it work. Now I am not a C programmer so that I may not have
>translated the code properly. Would anyone have any info on how I can
>compute this ? Info a mere mortal could use.
>here is some code I found, but I don't think it works:
<snip>
unsigned short int get_crc_16 (int start, char *p, int n) {
<snip>
One of the most important things in your CRC16 computation is the value of
the "start" argument. This value represents the coefficients of the
polynomial that is used in the calculations, and if you start out with the
wrong one you are definitely hosed. As I recall, there are two popular
polynomials for a 16-bit CRC. The one that I am familiar with was just
referred to as "CRC16" and had a value of 0xA001 (don't hold me to this);
the other was referred to as CRC16-CCITT and was a slightly different value.
I used to understand the theory behind all this, but that was in a previous
life :-).
As someone mentioned, look at the POSE source code to determine what he is
using for a seed value.
Doug Gordon