| Newsgroups |
gmane.comp.hardware.rabbit-semiconductor |
| Message-ID |
<[email protected]> |
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], "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.
>