4370 views|6 replies

3320

Posts

0

Resources
The OP

CRC check problem [Copy link]

I experimented with the CRC16 routine of NXP810 and found that LPC_CRC->WR_DATA_WORD = 0x3534; if (LPC_CRC->SUM != 0xD7D6) { /* §°LED */ while (1) { LPC_GPIO_PORT->PIN0 &= ~LED; /* LED */ myDelay(100); /* ± 100ms */ LPC_GPIO_PORT->PIN0 |= LED; /* ¨LED */ myDelay(100); /* ± 100ms */ } } LPC_GPIO_PORT->PIN0 &= ~LED; /* ¨LED */ I have tried many algorithms, but I cannot find the value of 0XD7D6. Please help me, thank you!
This post is from NXP MCU

Latest reply

Are you talking about software or hardware computing?  Details Published on 2013-8-5 10:32

1w

Posts

132

Resources
2
First confirm whether the algorithm programming is correct.
This post is from NXP MCU
Personal signature上传了一些书籍资料,也许有你想要的:http://download.eeworld.com.cn/user/chunyang

4973

Posts

19

Resources
3
It is quite convenient to calculate CRC16 using software, but I have never tried using hardware. Let's see if the method is correct.
This post is from NXP MCU
Personal signature我的博客

3320

Posts

0

Resources
4
I just don't know how to calculate it.
This post is from NXP MCU

Comments

Are you talking about software or hardware computing?  Details Published on 2013-8-5 10:32

4973

Posts

19

Resources
5
Are you talking about software or hardware computing?
This post is from NXP MCU
Personal signature我的博客

3320

Posts

0

Resources
6
The value calculated by the hardware is correct, and I succeeded in the experiment. But I can't calculate the value calculated by the hardware using software. It seems that there is a big-endian mode and a little-endian mode.
This post is from NXP MCU

3320

Posts

0

Resources
7

The algorithm found

unsigned int CRC16_IBM(unsigned char *puchMsg, unsigned int usDataLen)
{
unsigned short wCRCin = 0x0000;
unsigned short wCPoly = 0x8005;
unsigned char wChar = 0;

while (usDataLen--)
{
wChar = *(puchMsg++);
InvertUint8(&wChar,&wChar);
wCRCin ^= (wChar << 8);
for(int i = 0;i < 8;i++)
{
if(wCRCin & 0x8000)
wCRCin = (wCRCin << 1) ^ wCPoly;
else
wCRCin = wCRCin << 1;
}
}
InvertUint16(&wCRCin,&wCRCin);
return (wCRCin) ;
}

This post is from NXP MCU
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list