文件名称:9.17
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2013-02-26
- 文件大小:
- 11kb
- 下载次数:
- 0次
- 提 供 者:
- 徐*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
1.串口中断允许自动接收总线上的信息,当接收的字节后超过3.5个字节时间没有新的字节认为本次接收完成,接收完成标志置1 如果接收完成标志已经置1又有数据进来则丢弃新来的数据。
2.串口接收数据的处理, 当接收完成标志置1进入接收数据处理, (1)首先判断接收的第一位数据与本机地址是否相同,如果不相同清空接收缓存不发送任何信息 (2)接收的第一位数据与本机地址相同,则对接收缓存中的数据进行crc16校验,如果接收的校验位与本校验结果不相同清空接收缓存不发送任何信息;(3)如果crc16校验正确则根据数据串中的命令码进行相应的处理。-Serial port interrupt allowed to automatically receive bus information bytes received over 3.5 bytes time no new bytes that the receiving completed receive completion flag is set to 1 Receive complete flag has been set, there are The data come in the new data is discarded. Serial receive data processing, when receiving the completion flag is set to 1 into the reception data processing, (1) first determines whether the address of the received first data with the machine the same, if not identical, to empty the receiving buffer does not send any information (2 ) received first one of the data is the same as the machine address crc16 checksum on the data in the reception buffer, if the received parity bit with the check result is not the same to clear the receive buffer does not send any message (3) If crc16 checksum is correct, according to the command code data string processing.
2.串口接收数据的处理, 当接收完成标志置1进入接收数据处理, (1)首先判断接收的第一位数据与本机地址是否相同,如果不相同清空接收缓存不发送任何信息 (2)接收的第一位数据与本机地址相同,则对接收缓存中的数据进行crc16校验,如果接收的校验位与本校验结果不相同清空接收缓存不发送任何信息;(3)如果crc16校验正确则根据数据串中的命令码进行相应的处理。-Serial port interrupt allowed to automatically receive bus information bytes received over 3.5 bytes time no new bytes that the receiving completed receive completion flag is set to 1 Receive complete flag has been set, there are The data come in the new data is discarded. Serial receive data processing, when receiving the completion flag is set to 1 into the reception data processing, (1) first determines whether the address of the received first data with the machine the same, if not identical, to empty the receiving buffer does not send any information (2 ) received first one of the data is the same as the machine address crc16 checksum on the data in the reception buffer, if the received parity bit with the check result is not the same to clear the receive buffer does not send any message (3) If crc16 checksum is correct, according to the command code data string processing.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
9.17\main.c
....\modbus.c
....\stm32f10x_it.c
....\网页程序.txt
9.17