Understanding CRC Principles and Applications in Microcontrollers

Understanding CRC Principles and Applications in Microcontrollers

转自 | 瑞萨嵌入式小百科 CRC:Cyclic Redundancy Check,即循环冗余校验码。 CRC是数据通信领域中最常用的一种查错校验码,其特征是信息字段和校验字段的长度可以任意选定。 循环冗余检查(CRC)是一种数据传输检错功能,对数据进行多项式计算,并将得到的结果附在帧的后面,接收设备也执行类似的算法,以保证数据传输的正确性和完整性。 —来自百度百科 学电子、计算机相关专业的同学都应该学习过CRC的基础原理。其原理说难不难,可以说就是一个公式。同时,说简单也不简单,这个公式里面包含的内容不简单。 点击查看大图 网络上关于CRC基础原理的内容比较多,可以搜索关键词“循环冗余校验”进行查询。 今天结合瑞萨RA MCU自带硬件CRC计算单元给大家讲讲其原理及监听应用。 瑞萨RA单片机硬件CRC计算单元采用固定的多项式发生器来计算8位或者32位数据的CRC校验值,对数据传输或数据存储的一致性、完整性进行验证。这篇文章重点介绍RA MCU中的CRC模块和使用方法。 RA MCU中的CRC 计算单元规格如下: 点击查看大图 注1. 该函数不能划分CRC计算中使用的数据。以8位或32位为单位写入数据。 CRC 计算单元框图如下: 那么接下来就是如何使用了,打开工程中的configuration.xlm文件,在Stacks窗口中,可以通过“New Stack → Monitoring → CRC (r_crc)”添加该模块。该模块的属性窗口如下: 点击查看大图 在应用程序中使用CRC模块的基本例程如下: void crc_example (){uint32_t length;uint32_t uint8_calculated_value;length = sizeof(g_data_8bit) / sizeof(g_data_8bit[0]);crc_input_t example_input ={.p_input_buffer = g_data_8bit,.num_bytes = length,.crc_seed = 0,};/* Open CRC module with 8 … Read more

Introduction to IoT Gateways: RTU and DTU

Introduction to IoT Gateways: RTU and DTU

The digital transformation of manufacturing enterprises has made the construction of industrial IoT platforms, wireless communication, and remote control indispensable. The essence of wireless communication lies in the collection, transmission, and feedback of information. Achieving these functions fundamentally relies on the mutual cooperation of relevant software and hardware control units, which are interdependent and form … Read more

Understanding Serial Communication in Embedded Systems

Understanding Serial Communication in Embedded Systems

Embedded electronic devices are collections of various circuits (processors or other integrated circuits). In order to exchange information between these independent circuits, they must follow the same communication protocol. To accommodate different needs, engineers have defined hundreds of thousands of communication protocols, which can generally be divided into two categories: parallel or serial. 1. Parallel … Read more

Getting Started with FreeRTOS: Detailed Queue Usage Examples

Getting Started with FreeRTOS: Detailed Queue Usage Examples

Introduction In the previous article, we explained the concept of queues and the related API functions. In this article, we will start learning how to use queues. 1. Basic Usage of Queues This example will create three tasks, two of which send data to the queue, and the other reads data from the queue. void … Read more

Understanding the MIPI Communication Protocol for Cameras

Understanding the MIPI Communication Protocol for Cameras

Learn together for a lifetime here is the Android programmer Recommended classic articles, by reading this article, you will gain the following knowledge points: 1. Introduction to the MIPI Protocol MIPI (Mobile Industry Processor Interface) is an abbreviation of Mobile Industry Processor Interface. MIPI is an open standard established by the MIPI Alliance for mobile … Read more

Building a Home Server with Thunderbolt Interface

Building a Home Server with Thunderbolt Interface

Click / the blue text above/ to follow me @EscapeNetToClass Thanks to this brother for the private message reminding me to research the “Ceph storage solution for mini-host clusters using Thunderbolt networking”! 1. Conclusion First Two Thunderbolt devices can directly connect the network through a dedicated cable (note that it is not USB-C); Using Thunderbolt … Read more

How to Set Up a BT Downloader with Raspberry Pi and OpenWrt

How to Set Up a BT Downloader with Raspberry Pi and OpenWrt

Submitted by Archer. Hello everyone, long time no see, I am Archer. Recently, I got some low-cost boards and also bought a Raspberry Pi 1 on Xianyu, which I have been keeping idle. I thought about flashing OpenWrt to use it as a high-performance soft router, but unfortunately, the performance is not enough. Under OpenWrt, … Read more

Creating a Weather Station with Unlimited Data Transmission Using Arduino

Creating a Weather Station with Unlimited Data Transmission Using Arduino

Let’s become technology enthusiasts together Author: iwoox This project uses Arduino open-source hardware to quickly create a weather station with unlimited data transmission capabilities. I previously created a weather station project with data logging functionality, and this is an upgraded and improved version. Step 1: Concept First, we need to add wireless data transmission functionality … Read more