RE: Re: CRC problem
"Dave McLaughlin" <[email protected]>
| Newsgroups | gmane.comp.hardware.rabbit-semiconductor |
|---|---|
| Message-ID | <[email protected]> |
That would be the wrong CRC result as it would not match the D5F8 that is on the end of the telegram. Dave. From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: 18 March 2013 23:39 To: [email protected] Subject: [rabbit-semi] Re: CRC problem Try this: Copy this chain 503002080000024400003886030400000000010100 to http://www.lammertbies.nl/comm/info/crc-calculation.html. Select Input type= HEX, then press Calculate CRC buttton. Result is CRC-CCITT (0xFFFF) = 0x354E With DCrabbit: #use "crc32.lib" char chain[]={0x50, 0x30, 0x02, 0x08, 0x00, 0x00, 0x02, 0x44, 0x00, 0x00, 0x38, 0x86, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00}; void main() { printf("Result is %04X",crc16_calc(chain, 21, 0xFFFF)); // Result is 354E } --- In [email protected] <mailto:rabbit-semi%40yahoogroups.com> , "DonaldShimoda" <german.gentile@...> wrote: > > Hi, > Im trying to get a CRC16 routine but cannto find the rigth way to get it. > I have two samples of bytes comming from a device, Manual say if you apply crc16 to all that bytes you must get 0 as result, but dont work. > > That are the chains: > > 50 30 02 08 00 00 02 44 00 00 38 86 03 04 00 00 00 00 01 01 00 d5 f8 > > 51 30 02 08 00 00 02 07 00 00 84 81 03 04 00 00 00 00 01 01 00 4b ed > > last two are the hex crc values. > > As im reading this from a device, i make a loop and try 3 crc routines working on other situations, and changes the inital value to 0x0000 and 0xFFFF in every test, and increment base from 0x0000 to 0xFFFF but in that situation dont work. I cant fond a crc routine/base/initial combination returning zero for both chains... > > I even try the getcrc rabbit lib routine, no look. > > Also try this site, severlas crc routines calcule, dont work either > > http://www.lammertbies.nl/comm/info/crc-calculation.html > > Can somebody give me some clue on this? > > Best regards. > <http://groups.yahoo.com/group/rabbit-semi/post;_ylc=X3oDMTJxbTZwbGs4BF9TAzk 3MzU5NzE0BGdycElkAzIzMDczMTYEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzQxODAxBHNlYwN mdHIEc2xrA3JwbHkEc3RpbWUDMTM2MzYyNDcxNQ--?act=reply&messageNum=41801> Reply via web post <mailto:[email protected]?subject=Re%3A%20CRC%20problem> Reply to sender <mailto:[email protected]?subject=Re%3A%20CRC%20problem> Reply to group <http://groups.yahoo.com/group/rabbit-semi/post;_ylc=X3oDMTJlMDBsNDczBF9TAzk 3MzU5NzE0BGdycElkAzIzMDczMTYEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA250cGM Ec3RpbWUDMTM2MzYyNDcxNQ--> Start a New Topic <http://groups.yahoo.com/group/rabbit-semi/message/41799;_ylc=X3oDMTM2aTQxZW 01BF9TAzk3MzU5NzE0BGdycElkAzIzMDczMTYEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzQxOD AxBHNlYwNmdHIEc2xrA3Z0cGMEc3RpbWUDMTM2MzYyNDcxNQR0cGNJZAM0MTc5OQ--> Messages in this topic (3) Recent Activity: