在AVP28335(兼容德州仪器TMS320-28335) 上实现ModbusSlaveRTU-485源码及注释。

dsp28335 sci中用fifo完成485收发通信_嵌入式硬件通信接口协议-UART(一)协议基础... 文章首发于同名微信公众号:DigCore欢迎关注同名微信公众号:DigCore,及时获取最新技术博文。原文链接:https://mp.weixin.qq.com/s/Qmk0VEsPzlwYGhum42GdCQ(说明:此处的文章从微信公众号拷贝而来,图片或者排版上可能存在一定的瑕疵,欢迎点击原文链接阅读)一、 简介UART,全称UniversalAsynchrONous Receiver/Tran... 阅读详情

希望能给感兴趣的小伙伴以帮助。(这个程序是根据优快云中小伙伴的程序修改,在原来文件中发现很多坑 ,现在发现最主要的几个坑如下。

坑1:传输数据只能传输200个无符号<200的无符号整数;

坑2:3,4区数据寄存器只能放置<=400(dec)的数据,不能传输最大数为65535(dec);

坑3:传输数据时,Master一般要求加CRC16校验码的2个字节,原来源代码中故意少发两个字节,导致测试软件接收不到。

坑4:没有针对IEEE754 32位 浮点数表式方法的处理。

为了不让后面的小伙伴在这里在花费时间研究,我把已知的坑给填了,并源码放在这里。

呵呵,先给出2个截图,用来吹嘘一下这个程序真的可以用。

第一部分:截图看结果,真的可以用。

1、输入寄存器截图

2、保持寄存器截图

先给出两张图 每张图左边图是 AVP28335 系统的Slave 端数据,右边是Modscan32测试软件数据。 

第一张图是3区输入寄存器数据;第二张图是4区 保持寄存器数据。

地址:=1 显示数据 长度 100

下面将给出部署方法,有点困了,明天再说吧。:)

第二部分、此程序部署前提条件:

1、使用芯片德州仪器或湖南进芯28335的SCIC-串口;(SCIA SCIB 基本相同)

2、使用了收发控制管脚 GPIO61;(其实不使用更好处理)

3、外围电路采用 Max485芯片;(电气原理图省略,典型应用图纸图纸,算了,还是给一张图吧)

4、编译环境CCS15 芯片28335 编译器6.0.1

第三部分、编程,主要文件及部署方法:

1、创建头文件,该文件是Modbus 485 Slave 数据结构体文件:

文件名:MODBUS.h

文件内容:


#ifndef INCLUDE_MODBUS_H_
#define INCLUDE_MODBUS_H_

//SCIC-MODBUS 485 应用数据结构体

//MODBUS数据结构
typedef enum {
    MB_FUNC_READ_COIL = 1,
    MB_FUNC_READ_INPUT,
    MB_FUNC_READ_HOLDINGREGISTERS,
    MB_FUNC_READ_INPUTREGISTERS,
    MB_FUNC_FORCE_COIL,
    MB_FUNC_WRITE_HOLDINGREGISTER,
    MB_FUNC_FORCE_NCOILS = 15,
    MB_FUNC_WRITE_NREGISTERS = 16
} ModbusFunctionCode;

//MODBUS错误数据结构
typedef enum {
    MB_ERROR_ILLEGALFUNC = 1,
    MB_ERROR_ILLEGALADDR,
    MB_ERROR_ILLEGALDATA,
    MB_ERROR_SLVFAILURE,
    MB_ERROR_ACKNOWLEDGE,
    MB_ERROR_SLVBUSY,
    MB_ERROR_NEGACKNOWLEDGE,
    MB_ERROR_MEMPARITY,
    MB_ERROR_GATEWAYPATHUN
} ModbusError;

//状态机常数
typedef enum {
    MB_CREATE,
    MB_START,
    MB_TIMER_T35_WAIT,
    MB_IDLE,
    MB_RECEIVE,
    MB_PROCESS,
    MB_TRANSMIT,
    MB_DESTROY
} ModbusState;

//MODBUS数据结构
typedef struct ModbusData ModbusData;
struct ModbusData {
    Uint16 slaveAddress;
    Uint16 functionCode;
    Uint32 contentIdx;
    Uint32 numofregisters;
    Uint16 content[125];//20
    Uint16 size;
    Uint16 crc;
};

//P3方式互联网找的程序(modbus.c)
extern void SCIC_Modbus_Init(void);

//CoilsMap 数据结构
typedef struct ModbusCoilsMap ModbusCoilsMap;
struct ModbusCoilsMap{
    Uint16   dummy1;
//    Uint16   dummy2;
//    Uint16   dummy3;
//    Uint16   dummy4;
//    Uint16   dummy5;
//    Uint16   dummy6;
//    Uint16   dummy7;
//    Uint16   dummy8;
//    Uint16   dummy9;
//    Uint16   dummy10;
//    Uint16   dummy11;
//    Uint16   dummy12;
//    Uint16   dummy13;
//    Uint16   dummy14;
//    Uint16   dummy15;
//    Uint16   dummy16;
//    Uint16   dummy17;
//    Uint16   dummy18;
//    Uint16   dummy19;
//    Uint16   dummy20;
//    Uint16   dummy21;
//    Uint16   dummy22;
//    Uint16   dummy23;
//    Uint16   dummy24;
//    Uint16   dummy25;
//    Uint16   dummy26;
//    Uint16   dummy27;
//    Uint16   dummy28;
//    Uint16   dummy29;
//    Uint16   dummy30;
//    Uint16   dummy31;
//    Uint16   dummy32;
//    Uint16   dummy33;
//    Uint16   dummy34;
//    Uint16   dummy35;
//    Uint16   dummy36;
//    Uint16   dummy37;
//    Uint16   dummy38;
//    Uint16   dummy39;
//    Uint16   dummy40;
//    Uint16   dummy41;
//    Uint16   dummy42;
//    Uint16   dummy43;
//    Uint16   dummy44;
//    Uint16   dummy45;
//    Uint16   dummy46;
//    Uint16   dummy47;
//    Uint16   dummy48;
//    Uint16   dummy49;
//    Uint16   dummy50;
//    Uint16   dummy51;
//    Uint16   dummy52;
//    Uint16   dummy53;
//    Uint16   dummy54;
//    Uint16   dummy55;
//    Uint16   dummy56;
//    Uint16   dummy57;
//    Uint16   dummy58;
//    Uint16   dummy59;
//    Uint16   dummy60;
//    Uint16   dummy61;
//    Uint16   dummy62;
//    Uint16   dummy63;
//    Uint16   dummy64;
//    Uint16   dummy65;
//    Uint16   dummy66;
//    Uint16   dummy67;
//    Uint16   dummy68;
//    Uint16   dummy69;
//    Uint16   dummy70;
//    Uint16   dummy71;
//    Uint16   dummy72;
//    Uint16   dummy73;
//    Uint16   dummy74;
//    Uint16   dummy75;
//    Uint16   dummy76;
//    Uint16   dummy77;
//    Uint16   dummy78;
//    Uint16   dummy79;
//    Uint16   dummy80;
//    Uint16   dummy81;
//    Uint16   dummy82;
//    Uint16   dummy83;
//    Uint16   dummy84;
//    Uint16   dummy85;
//    Uint16   dummy86;
//    Uint16   dummy87;
//    Uint16   dummy88;
//    Uint16   dummy89;
//    Uint16   dummy90;
//    Uint16   dummy91;
//    Uint16   dummy92;
//    Uint16   dummy93;
//    Uint16   dummy94;
//    Uint16   dummy95;
//    Uint16   dummy96;
//    Uint16   dummy97;
//    Uint16   dummy98;
//    Uint16   dummy99;
//    Uint16   dummy100;
};

//InputsMap 数据结构
typedef struct ModbusInputsMap ModbusInputsMap;
struct ModbusInputsMap{
    Uint16     dummy1;
//    Uint16     dummy2;
//    Uint16     dummy3;
//    Uint16     dummy4;
//    Uint16     dummy5;
//    Uint16     dummy6;
//    Uint16     dummy7;
//    Uint16     dummy8;
//    Uint16     dummy9;
//    Uint16     dummy10;
//    Uint16     dummy11;
//    Uint16     dummy12;
//    Uint16     dummy13;
//    Uint16     dummy14;
//    Uint16     dummy15;
//    Uint16     dummy16;
//    Uint16     dummy17;
//    Uint16     dummy18;
//    Uint16     dummy19;
//    Uint16     dummy20;
//    Uint16     dummy21;
//    Uint16     dummy22;
//    Uint16     dummy23;
//    Uint16     dummy24;
//    Uint16     dummy25;
//    Uint16     dummy26;
//    Uint16     dummy27;
//    Uint16     dummy28;
//    Uint16     dummy29;
//    Uint16     dummy30;
//    Uint16     dummy31;
//    Uint16     dummy32;
//    Uint16     dummy33;
//    Uint16     dummy34;
//    Uint16     dummy35;
//    Uint16     dummy36;
//    Uint16     dummy37;
//    Uint16     dummy38;
//    Uint16     dummy39;
//    Uint16     dummy40;
//    Uint16     dummy41;
//    Uint16     dummy42;
//    Uint16     dummy43;
//    Uint16     dummy44;
//    Uint16     dummy45;
//    Uint16     dummy46;
//    Uint16     dummy47;
//    Uint16     dummy48;
//    Uint16     dummy49;
//    Uint16     dummy50;
//    Uint16     dummy51;
//    Uint16     dummy52;
//    Uint16     dummy53;
//    Uint16     dummy54;
//    Uint16     dummy55;
//    Uint16     dummy56;
//    Uint16     dummy57;
//    Uint16     dummy58;
//    Uint16     dummy59;
//    Uint16     dummy60;
//    Uint16     dummy61;
//    Uint16     dummy62;
//    Uint16     dummy63;
//    Uint16     dummy64;
//    Uint16     dummy65;
//    Uint16     dummy66;
//    Uint16     dummy67;
//    Uint16     dummy68;
//    Uint16     dummy69;
//    Uint16     dummy70;
//    Uint16     dummy71;
//    Uint16     dummy72;
//    Uint16     dummy73;
//    Uint16     dummy74;
//    Uint16     dummy75;
//    Uint16     dummy76;
//    Uint16     dummy77;
//    Uint16     dummy78;
//    Uint16     dummy79;
//    Uint16     dummy80;
//    Uint16     dummy81;
//    Uint16     dummy82;
//    Uint16     dummy83;
//    Uint16     dummy84;
//    Uint16     dummy85;
//    Uint16     dummy86;
//    Uint16     dummy87;
//    Uint16     dummy88;
//    Uint16     dummy89;
//    Uint16     dummy90;
//    Uint16     dummy91;
//    Uint16     dummy92;
//    Uint16     dummy93;
//    Uint16     dummy94;
//    Uint16     dummy95;
//    Uint16     dummy96;
//    Uint16     dummy97;
//    Uint16     dummy98;
//    Uint16     dummy99;
//    Uint16     dummy100;
};

//HoldingRegistersMap数据结构
typedef struct ModbusHoldingRegistersMap ModbusHoldingRegistersMap;
struct ModbusHoldingRegistersMap {
    Uint16  dummy1;
    Uint16  dummy2;
    Uint16  dummy3;
    Uint16  dummy4;
    Uint16  dummy5;
    Uint16  dummy6;
    Uint16  dummy7;
    Uint16  dummy8;
    Uint16  dummy9;
    Uint16  dummy10;
    Uint16  dummy11;
    Uint16  dummy12;
    Uint16  dummy13;
    Uint16  dummy14;
    Uint16  dummy15;
    Uint16  dummy16;
    Uint16  dummy17;
    Uint16  dummy18;
    Uint16  dummy19;
    Uint16  dummy20;
    Uint16  dummy21;
    Uint16  dummy22;
    Uint16  dummy23;
    Uint16  dummy24;
    Uint16  dummy25;
    Uint16  dummy26;
    Uint16  dummy27;
    Uint16  dummy28;
    Uint16  dummy29;
    Uint16  dummy30;
    Uint16  dummy31;
    Uint16  dummy32;
    Uint16  dummy33;
    Uint16  dummy34;
    Uint16  dummy35;
    Uint16  dummy36;
    Uint16  dummy37;
    Uint16  dummy38;
    Uint16  dummy39;
    Uint16  dummy40;
    Uint16  dummy41;
    Uint16  dummy42;
    Uint16  dummy43;
    Uint16  dummy44;
    Uint16  dummy45;
    Uint16  dummy46;
    Uint16  dummy47;
    Uint16  dummy48;
    Uint16  dummy49;
    Uint16  dummy50;
//    Uint16  dummy51;
//    Uint16  dummy52;
//    Uint16  dummy53;
//    Uint16  dummy54;
//    Uint16  dummy55;
//    Uint16  dummy56;
//    Uint16  dummy57;
//    Uint16  dummy58;
//    Uint16  dummy59;
//    Uint16  dummy60;
//    Uint16  dummy61;
//    Uint16  dummy62;
//    Uint16  dummy63;
//    Uint16  dummy64;
//    Uint16  dummy65;
//    Uint16  dummy66;
//    Uint16  dummy67;
//    Uint16  dummy68;
//    Uint16  dummy69;
//    Uint16  dummy70;
//    Uint16  dummy71;
//    Uint16  dummy72;
//    Uint16  dummy73;
//    Uint16  dummy74;
//    Uint16  dummy75;
//    Uint16  dummy76;
//    Uint16  dummy77;
//    Uint16  dummy78;
//    Uint16  dummy79;
//    Uint16  dummy80;
//    Uint16  dummy81;
//    Uint16  dummy82;
//    Uint16  dummy83;
//    Uint16  dummy84;
//    Uint16  dummy85;
//    Uint16  dummy86;
//    Uint16  dummy87;
//    Uint16  dummy88;
//    Uint16  dummy89;
//    Uint16  dummy90;
//    Uint16  dummy91;
//    Uint16  dummy92;
//    Uint16  dummy93;
//    Uint16  dummy94;
//    Uint16  dummy95;
//    Uint16  dummy96;
//    Uint16  dummy97;
//    Uint16  dummy98;
//    Uint16  dummy99;
//    Uint16  dummy100;
};

//InputRegistersMap数据结构
typedef struct ModbusInputRegistersMap ModbusInputRegistersMap;
struct ModbusInputRegistersMap {
    Uint16  dummy1;
    Uint16  dummy2;
    Uint16  dummy3;
    Uint16  dummy4;
    Uint16  dummy5;
    Uint16  dummy6;
    Uint16  dummy7;
    Uint16  dummy8;
    Uint16  dummy9;
    Uint16  dummy10;
    Uint16  dummy11;
    Uint16  dummy12;
    Uint16  dummy13;
    Uint16  dummy14;
    Uint16  dummy15;
    Uint16  dummy16;
    Uint16  dummy17;
    Uint16  dummy18;
    Uint16  dummy19;
    Uint16  dummy20;
    Uint16  dummy21;
    Uint16  dummy22;
    Uint16  dummy23;
    Uint16  dummy24;
    Uint16  dummy25;
    Uint16  dummy26;
    Uint16  dummy27;
    Uint16  dummy28;
    Uint16  dummy29;
    Uint16  dummy30;
    Uint16  dummy31;
    Uint16  dummy32;
    Uint16  dummy33;
    Uint16  dummy34;
    Uint16  dummy35;
    Uint16  dummy36;
    Uint16  dummy37;
    Uint16  dummy38;
    Uint16  dummy39;
    Uint16  dummy40;
    Uint16  dummy41;
    Uint16  dummy42;
    Uint16  dummy43;
    Uint16  dummy44;
    Uint16  dummy45;
    Uint16  dummy46;
    Uint16  dummy47;
    Uint16  dummy48;
    Uint16  dummy49;
    Uint16  dummy50;
    Uint16  dummy51;
    Uint16  dummy52;
    Uint16  dummy53;
    Uint16  dummy54;
    Uint16  dummy55;
    Uint16  dummy56;
    Uint16  dummy57;
    Uint16  dummy58;
    Uint16  dummy59;
    Uint16  dummy60;
    Uint16  dummy61;
    Uint16  dummy62;
    Uint16  dummy63;
    Uint16  dummy64;
    Uint16  dummy65;
    Uint16  dummy66;
    Uint16  dummy67;
    Uint16  dummy68;
    Uint16  dummy69;
    Uint16  dummy70;
    Uint16  dummy71;
    Uint16  dummy72;
    Uint16  dummy73;
    Uint16  dummy74;
    Uint16  dummy75;
    Uint16  dummy76;
    Uint16  dummy77;
    Uint16  dummy78;
    Uint16  dummy79;
    Uint16  dummy80;
    Uint16  dummy81;
    Uint16  dummy82;
    Uint16  dummy83;
    Uint16  dummy84;
    Uint16  dummy85;
    Uint16  dummy86;
    Uint16  dummy87;
    Uint16  dummy88;
    Uint16  dummy89;
    Uint16  dummy90;
    Uint16  dummy91;
    Uint16  dummy92;
    Uint16  dummy93;
    Uint16  dummy94;
    Uint16  dummy95;
    Uint16  dummy96;
    Uint16  dummy97;
    Uint16  dummy98;
    Uint16  dummy99;
    Uint16  dummy100;
    Uint16  dummy101;
    Uint16  dummy102;
    Uint16  dummy103;
    Uint16  dummy104;
    Uint16  dummy105;
    Uint16  dummy106;
    Uint16  dummy107;
    Uint16  dummy108;
    Uint16  dummy109;
    Uint16  dummy110;
    Uint16  dummy111;
    Uint16  dummy112;
    Uint16  dummy113;
    Uint16  dummy114;
    Uint16  dummy115;
    Uint16  dummy116;
    Uint16  dummy117;
    Uint16  dummy118;
    Uint16  dummy119;
    Uint16  dummy120;
    Uint16  dummy121;
    Uint16  dummy122;
    Uint16  dummy123;
    Uint16  dummy124;
    Uint16  dummy125;
    Uint16  dummy126;
    Uint16  dummy127;
    Uint16  dummy128;
    Uint16  dummy129;
    Uint16  dummy130;
    Uint16  dummy131;
    Uint16  dummy132;
    Uint16  dummy133;
    Uint16  dummy134;
    Uint16  dummy135;
    Uint16  dummy136;
    Uint16  dummy137;
    Uint16  dummy138;
    Uint16  dummy139;
    Uint16  dummy140;
    Uint16  dummy141;
    Uint16  dummy142;
    Uint16  dummy143;
    Uint16  dummy144;
    Uint16  dummy145;
    Uint16  dummy146;
    Uint16  dummy147;
    Uint16  dummy148;
    Uint16  dumm1y49;
    Uint16  dummy150;
    Uint16  dummy151;
    Uint16  dummy152;
    Uint16  dummy153;
    Uint16  dummy154;
    Uint16  dummy155;
    Uint16  dummy156;
    Uint16  dummy157;
    Uint16  dummy158;
    Uint16  dummy159;
    Uint16  dummy160;
    Uint16  dummy161;
    Uint16  dummy162;
    Uint16  dummy163;
    Uint16  dummy164;
    Uint16  dummy165;
    Uint16  dummy166;
    Uint16  dummy167;
    Uint16  dummy168;
    Uint16  dummy169;
    Uint16  dummy170;
    Uint16  dummy171;
    Uint16  dummy172;
    Uint16  dummy173;
    Uint16  dummy174;
    Uint16  dummy175;
    Uint16  dummy176;
    Uint16  dummy177;
    Uint16  dummy178;
    Uint16  dummy179;
    Uint16  dummy180;
    Uint16  dummy181;
    Uint16  dummy182;
    Uint16  dummy183;
    Uint16  dummy184;
    Uint16  dummy185;
    Uint16  dummy186;
    Uint16  dummy187;
    Uint16  dummy188;
    Uint16  dummy189;
    Uint16  dummy190;
    Uint16  dummy191;
    Uint16  dummy192;
    Uint16  dummy193;
    Uint16  dummy194;
    Uint16  dummy195;
    Uint16  dummy196;
    Uint16  dummy197;
    Uint16  dummy198;
    Uint16  dummy199;
    Uint16  dummy200;
    Uint16  dummy201;
    Uint16  dummy202;
    Uint16  dummy203;
    Uint16  dummy204;
    Uint16  dummy205;
    Uint16  dummy206;
    Uint16  dummy207;
    Uint16  dummy208;
    Uint16  dummy209;
    Uint16  dummy210;
    Uint16  dummy211;
    Uint16  dummy212;
    Uint16  dummy213;
    Uint16  dummy214;
    Uint16  dummy215;
    Uint16  dummy216;
    Uint16  dummy217;
    Uint16  dummy218;
    Uint16  dummy219;
    Uint16  dummy220;
    Uint16  dummy221;
    Uint16  dummy222;
    Uint16  dummy223;
    Uint16  dummy224;
    Uint16  dummy225;
    Uint16  dummy226;
    Uint16  dummy227;
    Uint16  dummy228;
    Uint16  dummy229;
    Uint16  dummy230;
    Uint16  dummy231;
    Uint16  dummy232;
    Uint16  dummy233;
    Uint16  dummy234;
    Uint16  dummy235;
    Uint16  dummy236;
    Uint16  dummy237;
    Uint16  dummy238;
    Uint16  dummy239;
    Uint16  dummy240;
    Uint16  dummy241;
    Uint16  dummy242;
    Uint16  dummy243;
    Uint16  dummy244;
    Uint16  dummy245;
    Uint16  dummy246;
    Uint16  dummy247;
    Uint16  dummy248;
    Uint16  dummy249;
    Uint16  dummy250;
};

//MODBUS Slave数据结构
typedef struct ModbusSlaveStruc{
    ModbusState state;
    Uint16 rdata[51];       //30
    Uint16 sdata[251];      //100 //250
    Uint16 recvlen;
    Uint16 sendlen;
    ModbusCoilsMap coils,*pcoils;
    ModbusInputsMap inputs,*pinputs;
    ModbusHoldingRegistersMap holdingRegisters,*pholdingRegisters;
    ModbusInputRegistersMap inputRegisters,*pinputRegisters;
}MBSLSTRU;

#endif /* INCLUDE_MODBUS_H_ */

该文件定义了3个枚举数据,5个结构数据。 主要完成 MODBUS SLAVE 的帧结构,功能码01,02 ,03,04 数据结构,错误码帧,状态机数据结构。 一般情况创建项目后放在头文件目录中,便于引用。 

2,创建Modbus Slave RTU 源文件

MODBUS_COM.c

#include <DSP2833x_Device.h>
#include <DSP2833x_Examples.h>
#include <MODBUS.h>                                                            

//MODBUS SLAVE 数据结构体头文件
#include <string.h>                                                   //用于清零数组

extern void receieve_handler(MBSLSTRU *pModbusSlave);                 //数据接收处理
extern Uint16 CRC16 (Uint16 *nData, Uint16 wLength);                  //CRC16校验函数
extern uint32_t floatToIEEE754_H(float value);             //32位浮点数处理函数高16位
extern uint32_t floatToIEEE754_L(float value);             //32位浮点数处理函数低16位
//extern float ieee754ToFloat(uint32_t ieee);

//SCIC通信用
//#define ModbusSlaveAddress 1         //地址,本程序段用MOD_CODE替换,便于更改地址                                                     //MODBUS SLAVE RTU 地址
#define bufferdepth 0x10 //10     //20                                                  //BUFFER 发送起始深度 (0x10 = 16 字节)

//CycleQueue ScicRecvMsgQueue;
//struct ScicRecvMsgQueueStruc ScicRecvMsgBox[ScicRecvMsgLen], *pScicRecvMsgQueueStruc;

MBSLSTRU public_struc_modbus;                         //MODBUS SLAVE 数据结构体变量

U
TMS320F28335实现Modbus RTU通信完整入门项目 TMS320F28335 基于 C28x 内核,具备高性能浮点运算能力,主频可达 150MHz,支持单精度浮点运算,适用于实时控制与复杂算法处理。芯片集成了丰富的外设资源,包括:18 通道 PWM 输出,适用于电机控制16 通道 12 位 ADC,支持多路模拟信号采集两个 SCI(串口)接口,支持 Modbus RTU 等通信协议SPI、I2C、CAN 等多种通信接口52KB RAM + 256KB Flash 存储空间,支持程序本地运行。 阅读详情

相关推荐

TMS320F28335微控制器上的Modbus RTU实现

Modbus RTU(Remote Terminal Unit)是一种在串行通信中广泛使用的协议,主要应用于工业环境。它基于主从架构,允许主机与一个或多个从设备进行数据交换。Modbus RTU以其简洁性和高效性,成为过程控制领域内一个非常受欢迎的通信协议。TMS320F28335微控制器是德州仪器(Texas Instruments)推出的一款高性能的32位数字信号控制器(DSC),广泛应用于工业控制、电机驱动等领域。本节将深入探讨其硬件架构的两个主要方面:CPU核心与内存结构、外围设备和接口特性。

weixin_29607511的博客 1169

28335modbus.zip

很好28335modbus学习例程,适合初学DSP28335 modbusRTU 485通讯的人员 作为入门教材很好,增加一部分内容就可以作为实际应用

dsp28335 rs485 FIFO接收

dsp28335 rs485 FIFO接收

基于TMS320F28335的modbus主机

在TMS320F28335的硬件平台上实现的Modbus的主机协议栈.

28335_modbus-RTU.zip

28335_modbus-RTU,非常适合用于实际开发 增加适当的代码就可以用于实际应用,非常有实用价值,希望有相关应用的人员积极下载

很好28335modbus学习例程,适合初学DSP28335 modbusRTU 48

很好28335modbus学习例程,适合初学DSP28335 modbusRTU 485通讯的人员 作为入门教材很好,增加一部分内容就可以作为实际应用2

modbus_CCS开发modbus_dsp_dspmodbus_DSP28335modbus_

modbus dsp28335代码实现 03 16协议实现

DSP28335-485收发程序配置.rar_485_DSP28335-485_dsp28335_dsp28335 485_fi

DSP28335 485通信配置,采用FIFO缓冲,通过中断实现收发

在 Windows 系统下使用 VMware 安装 Ubuntu 24.04 LTS 系统

Ubuntu24.04桌面端官方下载:https://cn.ubuntu.com/download/desktop。

u014695938的博客 1万+

手把手教你用SpringBoot+Vue3+Docker从零搭建一个在线OJ系统(附完整源码)

本文详细介绍了如何使用SpringBoot、Vue3和Docker从零搭建一个在线OJ系统,涵盖前后端开发、判题机实现及Docker容器化部署。通过完整的源码和实战步骤,帮助开发者掌握OJ系统的核心架构与关键技术,适用于算法训练、编程竞赛等场景。

weixin_42648844的博客 296

统信UOS/麒麟Kylin OS下利用pyenv实现Python多版本开发环境搭建指南

本文详细介绍了在统信UOS和麒麟Kylin OS国产操作系统下使用pyenv搭建Python多版本开发环境的完整指南。从系统环境准备、pyenv定制安装到Python版本编译实战,提供了针对国产CPU架构的特殊优化方案和常见问题解决方法,帮助开发者高效管理不同Python版本需求。

sea99的博客 1050

从三个角度理解知识图谱

2012年谷歌首次提出“知识图谱”这个词,由此知识图谱在工业界也出现得越来越多,对于知识图谱以及相关概念的理解确实也是比较绕。自己在研究大数据独角兽Palantir之后开始接触知识图谱,也算对其有了一定了解,这里从三个角度总结一下怎么去理解知识图谱。 几个基本概念:本体、实体、知识库、知识图谱 1、本体是概念的集合,是大家都公认的概念框架,一般不会改变如“人”、“事”、“物”、 “地”、“组...

JavaChaoCo的博客 6899

工程师必收藏,Juniper(Junos)网络设备命令大全

不要直接删除配置 → 使用deactivate配置前先修改大配置用出现风险命令一律用写自动化时一律用格式真正会用 Juniper 的工程师,不是命令多,而是命令用得精。

网络技术联盟站 403

“/usr/lib/wsl/wsl-setup“ failed, exiting

WSL2安装Ubuntu时出现"wsl-setup failed"错误的解决方法 摘要:当Windows用户名包含中文字符时,安装WSL2+Ubuntu会出现"wsl-setup failed"错误。本文提供两种解决方案:1)修改中文用户名(风险较大);2)通过命令手动配置。推荐第二种方法:先使用"wsl -l -v"查看Ubuntu名称,再通过"wsl -d Ubuntu20.04 -e /bin/bash"命令启动WSL2系

猿小白的博客 993

2024年软考信息安全工程师备考历年真题汇总

信息安全工程师分属“信息系统”专业,位处中级资格,2016年下半年,第一次开考信息安全工程师(中级)考试。目前每年考试一次。已开考六次,2016年11月12日,2017年5月20日,2018年5月26日,2019年5月25日,2020年11月7日,2021年11月6日为第六次考试。 第五次和第六次考试,采用第二版教材。 2024年软考信息安全工程师备考历年真题汇总

月梦工作室 5100

【Coze搞钱实战】14. 抖音直播间自动回复机器人实战教程:三小时搭建智能客服,互动率提升150%(保姆级无代码指南)

摘要:抖音直播间高频问题重复回复、观众互动不及时是运营痛点。本文针对新手和进阶用户,提供无代码的自动回复机器人搭建方案:新手1小时完成基础配置(Coze+抖音对接),进阶用户通过促销倒计时、粉丝分层、热点借势三大策略提升互动率150%。方案基于某女装直播间实测数据(日UV 5W+),所有工具免费获取,步骤拆解到分钟级,附避坑指南与效果验证(某案例互动率从8%升至20%),读者可直接套用配置模板,无需代码基础即可落地。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 2457

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

上一篇: 随便聊一下 显控科技 控制屏 通过 RS485 接口 上位机 通讯 说明
下一篇: 看了2025的优快云首页我笑出了猪声:)))
FOOLCODE
博客等级 码龄19年 180粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值