Creating a CRC for a serout command
daveyaman
Posts: 2
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·
(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·
Comments
Is the checksum required by the hardware, or is something you are doing yourself to check the data packet ?
Bean.
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
and thank-you to K de Jong for the code i will try it tomorrow