登录
首页 » c » STM32发送接收中断方式

STM32发送接收中断方式

于 2022-02-09 发布 文件大小:1.74 kB
0 80
下载积分: 2 下载次数: 1

代码说明:

常规串口发送没有采用中断方式,发送比较耗时。例如9600波特率,发送接近1k的数据需要耗时1秒,意味着这一秒main函数的内容都无法执行,对于通信比较多的程序而言,非中断方式是致命的。采用中断方式可以将方送接收时间忽略,不影响main运行。本程序需要一个定时器调度,可以按帧(即使没有任何标识符来区分)区分数据,帧与帧是按时间来区分的,时间间隔可以在定时器或计计数器变量修改,时间越短效率愈高,过高也会出错,把一帧数据当成多帧数据,使用时注意。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • MODBUS
    C#写了一款上位机监控软件,基于MODBUS RTU协议。 软件的基本结构: 采用定时器(Timer控件)为时间片。 串口采用serialPort1_DataReceived中断接收,并进行MODBUS格式判断。 把正确接收的数据取出,转换为有特定的结构体中。 数据通过时间片实时刷新。 MODBUS协议(C# write a PC monitoring software, based MODBUS RTU protocol. The basic structure of the software: using the timer (Timer Control) as a time slice. Serial port using serialPort1_DataReceived interrupt reception, and make judgments MODBUS format. Removing the correctly received data is converted to a specific structural body. Real-time data through the time slice refresh. MODBUS protocol)
    2013-07-09 14:32:22下载
    积分:1
  • MSCommtest3.0
    MSComm控件串口通信编程,第一次作业。(MSComm control serial communication programming, the first operation.)
    2011-12-05 22:14:26下载
    积分:1
  • AddressList
    UTM地图投影正解源码C#.cs将 变形前任一子区域与变形后散斑图像进行全场匹配或相关 运算,根据峰值相关系数确定该子区域在变形后的位置,由 此可以得到该块的平均位移。对变形前所有子区域进行类 似运算,就可以得到整个位移场。 (Journal of Huaiyin Institute of Technology)
    2012-04-05 10:35:29下载
    积分:1
  • TMT New
    说明:  这是个超级信号指标,使用比较直观,对初学者有帮助(This is a super signal indicator, which is more intuitive and helpful for beginners.)
    2019-01-24 19:35:21下载
    积分:1
  • omnet++中文使用手册
    说明:  OMNeT++是一款面向对象的离散事件网络模拟器,详细介绍了omnet++网络仿真模拟平台。(OMNeT++ is an object-oriented discrete event network simulator. The omnet++ network simulation platform is introduced in detail.)
    2019-10-08 18:27:49下载
    积分:1
  • mnote-carlo
    Matlab code for cell range calc using montecarlo
    2009-05-31 19:00:44下载
    积分:1
  • 430测量电容1.rar
    说明:  该程序注解清晰,自己用的程序,推荐大家下载。(Clear annotations, their own procedures, recommended download.)
    2020-06-18 09:00:03下载
    积分:1
  • linux,FTP下载
    linux,C,FTP操作源码,建立ftp连接,创建目录,下载文件,上传文件,断点续传等功能。 C代码实现,命令行操作。具体可参考源码。
    2022-07-26 04:22:51下载
    积分:1
  • PCA
    说明:  基于c8051f120内部PCA使用的C程序。内含6个.c文件。8bitPWM,16bitPWM,高速输出,频率,软件定时,捕获。(C8051f120-based C-program used within the PCA. Containing 6. C files. 8bitPWM, 16bitPWM, high-speed output, frequency, software timing, to capture.)
    2009-08-26 17:11:05下载
    积分:1
  • dxflib
    dxflib is an open source C++ library mainly for parsing DXFTM files. QCAD, CAM Expert and vec2web all use dxflib to import DXF files. dxflib can also write DXF files, but you need to have good knowledge of the DXF format to produce valid output.
    2009-08-26 22:41:00下载
    积分:1
  • 696518资源总数
  • 105570会员总数
  • 13今日下载