文件名称:9.17
介绍说明--下载内容来自于网络,使用问题请自行百度
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
9.17/modbus.c
9.17/stm32f10x_it.c
9.17/网页程序.txt
9.17/
9.17/modbus.c
9.17/stm32f10x_it.c
9.17/网页程序.txt
9.17/
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.