Forums
5
Product Forums
21
General Purpose MicrocontrollersGeneral Purpose Microcontrollers
i.MX Forumsi.MX Forums
QorIQ Processing PlatformsQorIQ Processing Platforms
Identification and SecurityIdentification and Security
Power ManagementPower Management
MCX Microcontrollers
S32G
S32K
S32V
MPC5xxx
Other NXP Products
Wireless Connectivity
S12 / MagniV Microcontrollers
Powertrain and Electrification Analog Drivers
Sensors
Vybrid Processors
Digital Signal Controllers
8-bit Microcontrollers
ColdFire/68K Microcontrollers and Processors
PowerQUICC Processors
OSBDM and TBDML
Solution Forums
4
Smart Home
Power & Energy
Mobile Robotics
Motor Control
Software Forums
16
MCUXpresso Software and ToolsMCUXpresso Software and Tools
CodeWarriorCodeWarrior
MQX Software SolutionsMQX Software Solutions
Model-Based Design Toolbox (MBDT)Model-Based Design Toolbox (MBDT)
FreeMASTER
eIQ Machine Learning Software
Embedded Software and Tools Clinic
S32 SDK
S32 Design Studio
GUI Guider
Zephyr Project
Voice Technology
Application Software Packs
Secure Provisioning SDK (SPSDK)
Processor Expert Software
MCUXpresso Training Hub
Topics
8
Mobile Robotics - Drones and RoversMobile Robotics - Drones and Rovers
NXP Training ContentNXP Training Content
University ProgramsUniversity Programs
Rapid IoT
NXP Designs
SafeAssure-Community
OSS Security & Maintenance
Using Our Community
Cloud Lab Forums
2
Hardware
Cloud Lab Knowledge Base
Knowledge Bases
2
ARM Microcontrollers
1
MCX Microcontrollers Knowledge Base
i.MX RT Crossover MCUs Knowledge Base
Ideas
Blogs
Forums
Knowledge Bases
NXP Tech Blog
NXP.COM
Sign In
FAQs
Language
English (US)
日本語 | Japanese
中文 | Chinese (Simplified)
Home
:
General Purpose Microcontrollers
:
LPC Microcontrollers
:
LPC800的CRC在各种配置下是如何计算的?求详解。
LPC800的CRC在各种配置下是如何计算的?求详解。
All community
This category
This board
Knowledge base
Users
Products
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
LPC800的CRC在各种配置下是如何计算的?求详解。
06-15-2016
11:18 AM
438 Views
lpcware
NXP Employee
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Content originally posted in LPCWare by hhxianzi on Sat Aug 31 04:57:03 CDT 2013
如题,在周立功网站上下载的LPC800例程里的CRC部分,代码如下:
/*********************************************************************************************************
** Function name: CRCInit
** Descriptions: CRC模块初始化
** input parameters: 无
** output parameters: 无
** Returned value: 无
*********************************************************************************************************/
void CRCInit (void)
{
LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 13); /* 打开CRC模块时钟 */
LPC_CRC->MODE = ((1 << 0) | /* 多项式选择为 CRC_16 */
(1 << 2) | /* IN_DATA 位序反转:YES */
(0 << 3) | /* IN_DATA 对1取补:NO */
(1 << 4) | /* CRC_SUM 位序反转:YES */
(0 << 5)); /* CRC_SUM 对1取补:NO */
LPC_CRC->SEED = 0x00000000; /* 种子值:0x0000 0000 */
}
/*********************************************************************************************************
** Function name: main
** Descriptions: CRC_16 例程:
** LED连接P0.7。
** 运行程序,进行CRC_16测试,若测试通过,点亮LED,若测试失败,LED闪烁。
** input parameters: 无
** output parameters: 无
** Returned value: 无
*********************************************************************************************************/
int main (void)
{
SystemInit(); /* 初始化目标板,切勿删除 */
GPIOInit(); /* GPIO初始化 */
CRCInit();
LPC_CRC->WR_DATA_WORD = 0x3534;
if (LPC_CRC->SUM != 0xD7D6) { /* 测试失败,LED闪烁 */
……
……
其中:LPC_CRC->SUM 应该是什么值?怎么计算的?
现在我的LED一直闪烁。
Labels
(1)
Labels
Labels:
中国用户论坛
0
Kudos
Reply
All forum topics
Previous Topic
Next Topic
1 Reply
06-15-2016
11:18 AM
378 Views
lpcware
NXP Employee
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Content originally posted in LPCWare by Irving on Mon Nov 25 20:35:32 CST 2013
[img=613x106]/zh-hans/system/files/u1296/CRC.JPG[/img]
请参照对应的CRC计算方式, 用户手册User Manual有简单的介绍! 关于CRC的详细介绍可找度娘或谷哥, 谢谢
0
Kudos
Reply
Post Reply