Shop OBEX P1 Docs P2 Docs Learn Events
Creating a CRC for a serout command — Parallax Forums

Creating a CRC for a serout command

daveyamandaveyaman Posts: 2
edited 2005-01-07 02:11 in BASIC Stamp
I am using the Stamp2 as an interface for a RF device and i have created a program that sends and recieves serial data using the serout and serin command. The problam that i have run into is that i have the packet of information but i require a sub command that creates the crc for it

(Example of the 16 bit CRC FFFF hex that i require)

The data that i am using looks simlar to this and i require a crc to be made because the data stream is ever changing

0111000000006011432100FFFFFFFF_ _ _ _·· <--· CRC

I am not sure if this is possible but i was reading some archive messages and someone said that there was one. If anyone knows or has a sub routine that can do this i would be very thankfull.

Thank you in advance to anyone who can help me

David Rutherford· freaked.gif

Comments

  • BeanBean Posts: 8,129
    edited 2005-01-07 00:46
    There are several ways to calculate a checksum. I think the old xmodem file transfer protocol was an 8 bit checksum ???

    Is the checksum required by the hardware, or is something you are doing yourself to check the data packet ?

    Bean.
  • K de JongK de Jong Posts: 154
    edited 2005-01-07 01:04
    Hi,

    Here is some code for you I found in my archives. I have not used it myself but if you look at the author it must be good :-).

    Klaus
    3K
    Crc 3.3K
  • daveyamandaveyaman Posts: 2
    edited 2005-01-07 02:11
    First, yes the hardware that i am using does require a CRC


    and thank-you to K de Jong for the code i will try it tomorrow
Sign In or Register to comment.