Internet PLC Forum

General => Technical support => Topic started by: pixelfantastic on May 16, 2011, 11:25:53 AM

Title: need to calculate CRC - CCITT
Post by: pixelfantastic on May 16, 2011, 11:25:53 AM
hi,

i need to calculate a CCITT type crc checksum
...does anyone here know if its possible in Tbasic please?

(The C code is attached in case there are any maths geniuses here)
Thank you
Barrie


Title: Re:need to calculate CRC - CCITT
Post by: garysdickinson on May 16, 2011, 05:16:16 PM
Short answer, yes.  TBASIC supports enough bit operators to allow you to write code equivalent to the C example. The TBASIC version will be a bit less eloquent then the C version.

The is some built-in support for calculating CRCs in TBASiC. I suspect that it uses the same feedback terms as the CRC16-CCITT

Unfortunately I'm away form my computers and can't give you an example.

Gary d
Title: Re:need to calculate CRC - CCITT
Post by: garysdickinson on May 16, 2011, 05:32:27 PM
Look at the TBASIC function, CRC16.  This will probably do the trick.

Gary d