avatar

松果工作室

欢迎光临

  • 首页
  • freeRTOS
  • ESP
  • 开发手册
  • 快速笔记
  • 个人收藏
  • 工具
Home CRC校验
文章

CRC校验

Posted 2024-05-7 Updated 2024-05- 12
By YCP
2~3 min read

具体原理:

https://blog.csdn.net/resilient/article/details/117368600

Modbus int16 CRC

uint16_t crc16(uint8_t *addr,uint8_t num)
{
  int i,j,temp;
  uint16_t crc=0xFFFF;
  for(i=0;i<num;i++)
  {
    crc=crc^(*addr);
    for(j=0;j<8;j++)
    {
      temp=crc&0x0001;
      crc=crc>>1;
      if(temp)
      {
        crc=crc^0xA001;
      }
    }
    addr++;
  }
  return crc;
}
坑和笔记
Others
License:  CC BY 4.0
Share

Further Reading

Dec 23, 2024

其他笔记

EC800K AT连接移远云 配置过程 # 配置产品信息(初次连接需配置) AT+QIOTCFG="productinfo","pxxxxt","cDVTxxxxxxxxWGVB" # 连接开发者中心 AT+QIOTREG=1 # 查询当前连接状态(+QIOTSTATE: 8为正常) AT+QI

Jun 21, 2024

环形滤波算法

#include <stdio.h> #include <stdlib.h> #define BUFFER_SIZE 10 // 缓冲区大小 #define THRESHOLD 180

Jun 17, 2024

STM32 ADC采集的三种方式

采样周期 单个采集模式 ADC_Settings: 程序使用 uint16_t ADC_Read(

OLDER

电子管

NEWER

用串口中断解析Modbus数据

Recently Updated

  • ESP32(八) 简单的webserver
  • ESP32(七) NVS
  • ESP32(四) STA & AP
  • 多级菜单
  • ESP32(五) ESP32 OTA

Trending Tags

WCH Linux Elec freeRTOS STM ESP Flutter Others SwiftUI

Contents

©2025 松果工作室. Some rights reserved.

Using the Halo theme Chirpy