CRC-32的微控制器(爱特梅尔) [英] CRC-32 on MicroController (Atmel)

查看:288
本文介绍了CRC-32的微控制器(爱特梅尔)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在实施的上一个ATMEGA1280 CRC-32传入数据流(串行通信)和我有点迷失如何做到这一点在C中的嵌入式侧....如果任何人都可以点我反正在正确的方向和/或帮助我将不胜AP preciate吧...

I am currently trying to implement a CRC-32 for an incoming datastream (Serial communication) on an ATMEGA1280 and I am a little lost how to do this on the embedded side in C.... If anyone could point me in the proper direction and/or help in anyway i would greatly appreciate it...

推荐答案

您应该知道什么多项式你正在处理白衣。因此,它是不够的,知道你正在使用CRC,但你也应该知道多项式。

You should know what polynomial you are dealing whit. So it is not enough to know that you are using CRC, but you should also know polynomial.

您正在寻找的功能丝毫这种原型

You are looking for function whit this kind of prototype

 uint32_t crc(uint8_t * data, int len, uint32_t polynomial)

甚至更远,此功能还可以支持更新,如果你异步获取你的数据,因此对于恢复计算额外的参数。

Or even further, this function can also support updating if you getting your data asynchronously, so there is extra parameter for resuming computation.

白衣CRC32你流槽位CRC校验功能,你会得到一个用于数据损坏检查32位的数字。

Whit CRC32 you stream bits trough CRC function and you get 32 bit number that is used for data corruption checking.

我相信你一定能够找到CRC在线C $ C $角

I am sure you will be able to find C code of crc online.

编辑:

我的样子,那CRC32多项式是SOR的标准,通常是统一的。
这意味着,CRC32实施将采用正确的多项式。

i looks like, that CRC32 polynomial is sor of standard and is usually unified. That mean that CRC32 implementation will employ correct polynomial.

http://en.wikipedia.org/wiki/Computation_of_CRC

这篇关于CRC-32的微控制器(爱特梅尔)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆