CN106130856A - A kind of self adaptation baud rate RS485 communications protocol - Google Patents
A kind of self adaptation baud rate RS485 communications protocol Download PDFInfo
- Publication number
- CN106130856A CN106130856A CN201610675840.7A CN201610675840A CN106130856A CN 106130856 A CN106130856 A CN 106130856A CN 201610675840 A CN201610675840 A CN 201610675840A CN 106130856 A CN106130856 A CN 106130856A
- Authority
- CN
- China
- Prior art keywords
- data
- baud rate
- bus
- module
- reception module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/4013—Management of data rate on the bus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
Abstract
The present invention relates to a kind of self adaptation baud rate RS485 communications protocol, the RS485 transceiver being connected including clock detection module, data reception module, integrated treatment unit, data transmission blocks with standard RS485 bus;Described RS485 transceiver is connected with clock detection module, data reception module and data transmission blocks, and integrated treatment unit is connected with data reception module and data transmission blocks, and clock detection module is connected with data reception module, data transmission blocks.The present invention can make main equipment on RS485 system bus according to the time requirement of different task and data volume, different bus equipment is arranged and completes data transmission with different baud rates, and the baud rate required according to main equipment from equipment in bus and main equipment complete communication.
Description
Technical field
The invention belongs to RS485 communications protocol technical field, be specifically related to a kind of self adaptation baud rate RS485 communications protocol.
Background technology
RS485 bus is a kind of half-duplex serial data communication bus, it is adaptable to the networking of each equipment room of industry spot is even
Connect, develop on the basis of RS422, Electronic Industries Association work out and issue.RS485 interface uses balance driver and difference
Dividing receiver corporation, anti-common mode disturbances ability is strong, and transfer rate is fast, and bus allows the equipment up to 128 connected.
At present, apply widely in industry spot, but it is fixing to necessarily require the equipment in RS485 bus all to define
Baud rate carries out data communication, otherwise will be unable to ensure the normal communication of bus.And in special RS485 bus system logarithm
According to communication time require higher, and the data volume every time transmitted is different, uses fixing baud rate to be difficult to meet system requirements.
Therefore it is the most necessary for designing a kind of self adaptation baud rate RS485 communications protocol.
Summary of the invention
It is an object of the invention to solve above-mentioned technical problem and a kind of self adaptation baud rate RS485 communication association is provided
View, it is achieved with the way of different baud rate data in same RS485 bus, make RS485 bus communication more flexible.
For achieving the above object, the present invention adopts the following technical scheme that
A kind of self adaptation baud rate RS485 communications protocol, including:
Clock detection module, data reception module, integrated treatment unit, data transmission blocks are connected with standard RS485 bus
RS485 transceiver;Described RS485 transceiver is connected with clock detection module, data reception module and data transmission blocks, comprehensively
Processing unit is connected with data reception module and data transmission blocks, and clock detection module sends with data reception module, data
Module connects;
Described clock detection module identifies automatically for the baud rate of RS485 bus, completes the baud rate with main equipment and mates also
Set the baud rate of data reception module and data transmission blocks, bus is received and is switched to data reception module;
Described data reception module obtains bus after completing baud rate coupling and receives power, according to the ripple of clock detection module configuration
Special rate and device number match condition carry out the serioparallel exchange of data, write data into integrated treatment unit, connect completing data
After receipts, bus is received and is switched to clock detection module;
Described integrated treatment unit is for the data parsing to data reception module write, and sends out according to analysis result control data
Module is sent to return corresponding data content;
Described data transmission blocks, after completing baud rate coupling, waits transmission order and the data content of integrated treatment unit,
And complete data sending function with the baud rate of clock detection module coupling;Control the reiving/transmitting state of RS485 transceiver simultaneously,
Send period free time RS485 bus and be in reception state all the time.
Described clock detection module frequency on the basis of 100MHz clock, the clock matches sent according to main equipment in bus
The order of byte 0X55, completes the baud rate with main equipment and mates and set the baud of data reception module and data transmission blocks
Rate, receives bus and is switched to data reception module, make baud rate matching range between 1KHz~10MHz.
Described data parsing include data length examine, CRC check and bus line command analysis.
Described RS485 transceiver realizes the conversion to RS485 bus signal level, by standard RS485 level conversion is
LVTTL level format, completes the physical connection with data reception module and data transmission blocks.
Present invention can apply to many equipment industrial environment of communication time requirement, respectively control from equipment primary device
And communicate, this agreement may be implemented in same RS485 bus system, respectively from equipment can with different baud rates complete with
The communication of main equipment.
Accompanying drawing explanation
Fig. 1 is the theory diagram of a kind of self adaptation baud rate RS485 communications protocol of the present invention;
Fig. 2 is the self adaptation baud rate RS485 communications protocol workflow diagram of the present embodiment.
Detailed description of the invention
Below, in conjunction with example, substantive distinguishing features and the advantage of the present invention are further described, but the present invention not office
It is limited to listed embodiment.
Shown in Figure 1, a kind of self adaptation baud rate RS485 communications protocol, including:
Clock detection module, data reception module, integrated treatment unit, data transmission blocks are connected with standard RS485 bus
RS485 transceiver;Described RS485 transceiver is connected with clock detection module, data reception module and data transmission blocks, comprehensively
Processing unit is connected with data reception module and data transmission blocks, and clock detection module sends with data reception module, data
Module connects.
In the present invention, described clock detection module identifies automatically for the baud rate of RS485 bus, and default conditions bus connects
Receipts are connected to clock detection module.
Implement, described clock detection module frequency on the basis of 100MHz clock, send out according to main equipment in bus
Clock matches byte " 0X55 " order sent, completes the baud rate with main equipment and mates and set data reception module and data
The baud rate of sending module, by bus receive be switched to data reception module, make baud rate matching range 1KHz~10MHz it
Between.
Data reception module of the present invention obtains bus after completing baud rate coupling and receives power, according to clock detection mould
The baud rate of block configuration and device number match condition proceed by the serioparallel exchange of data, and write data into integrated treatment list
Unit, after completing data receiver, receives bus and is switched to clock detection module.
Integrated treatment unit of the present invention is for resolving the data of data reception module write, long including data
Degree is examined, CRC check and bus line command analysis, and controls data transmission blocks according to analysis result and return in corresponding data
Hold.
Data transmission blocks of the present invention complete baud rate coupling after, wait integrated treatment unit transmission order and
Data content, and complete data sending function with the baud rate of clock detection module coupling.Control the receipts of RS485 transceiver simultaneously
Hair-like state, is in reception state all the time sending period free time RS485 bus.
RS485 transceiver of the present invention realizes the conversion to RS485 bus signal level, is turned by standard RS485 level
It is changed to LVTTL level format, completes the physical connection with data reception module and data transmission blocks.
The present invention can be to be connected, by patrolling by logic gate array FPGA and RS485 transceiver on implementing
Collect programming and realize function in mode simple, direct.
Wherein, described logic gate array FPGA type selecting is EP3C5F256.
In the present invention, the parameter that wherein main equipment sends always collects data structure and the parameter from equipment return always collects data
Structure, can use following data structure:
Wherein, the parameter that main equipment sends always collect data include sometimes clock coupling, device number, data length, valid data and
CRC check;The parameter returned from equipment always collects number and includes device number, receives successfully, data length, valid data and CRC examine
Test, the byte of the most corresponding respective numbers, as implied above.
The workflow of the present invention is shown in Figure 2, and main equipment starts tranmitting data register, and clock detection module detects and carries out
Coupling, and judge whether device number mates, the most then receive data validation length, after receiving data success, carry out CRC check,
CRC check success then sends this device number, receives success and data, if receiving data failure, then sends this device number and connects
Receive unsuccessfully, unsuccessful in CRC check equally, send this device number and and reception failure, if it addition, device number does not mates,
Bus tracking is to terminating and come back for clock detection and mating.After this equipment sends this device number, receives success and data,
Judging that main equipment receives communication the most successful, successful then main equipment terminates this communication, otherwise main equipment flow process as described above
Step starts tranmitting data register.Described equipment refer to relative to main equipment from equipment.
The present invention can make main equipment on RS485 system bus according to the time requirement of different task and data volume, right
The setting of different bus equipment completes data with different baud rates and transmits, and the ripple required according to main equipment from equipment in bus
Special rate completes communication with main equipment.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For Yuan, under the premise without departing from the principles of the invention, it is also possible to make some improvements and modifications, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (4)
1. a self adaptation baud rate RS485 communications protocol, it is characterised in that including:
Clock detection module, data reception module, integrated treatment unit, data transmission blocks are connected with standard RS485 bus
RS485 transceiver;Described RS485 transceiver is connected with clock detection module, data reception module and data transmission blocks, comprehensively
Processing unit is connected with data reception module and data transmission blocks, and clock detection module sends with data reception module, data
Module connects;
Described clock detection module identifies automatically for the baud rate of RS485 bus, completes the baud rate with main equipment and mates also
Set the baud rate of data reception module and data transmission blocks, bus is received and is switched to data reception module;
Described data reception module obtains bus after completing baud rate coupling and receives power, according to the ripple of clock detection module configuration
Special rate and device number match condition carry out the serioparallel exchange of data, write data into integrated treatment unit, connect completing data
After receipts, bus is received and is switched to clock detection module;
Described integrated treatment unit is for the data parsing to data reception module write, and sends out according to analysis result control data
Module is sent to return corresponding data content;
Described data transmission blocks, after completing baud rate coupling, waits transmission order and the data content of integrated treatment unit,
And complete data sending function with the baud rate of clock detection module coupling;Control the reiving/transmitting state of RS485 transceiver simultaneously,
Send period free time RS485 bus and be in reception state all the time.
Self adaptation baud rate RS485 communications protocol the most according to claim 1, it is characterised in that described clock detection module
Frequency on the basis of 100MHz clock, the clock matches byte 0X55 order sent according to main equipment in bus, complete to set with main
The baud rate of data reception module and data transmission blocks is mated and set to standby baud rate, bus is received and is switched to data
Receiver module, makes baud rate matching range between 1KHz~10MHz.
Self adaptation baud rate RS485 communications protocol the most according to claim 1, it is characterised in that described data parsing includes
Data length is examined, CRC check and bus line command analysis.
Self adaptation baud rate RS485 communications protocol the most according to claim 1, it is characterised in that described RS485 transceiver is real
The now conversion to RS485 bus signal level, is LVTTL level format by standard RS485 level conversion, completes and data receiver
Module and the physical connection of data transmission blocks.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610675840.7A CN106130856A (en) | 2016-08-17 | 2016-08-17 | A kind of self adaptation baud rate RS485 communications protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610675840.7A CN106130856A (en) | 2016-08-17 | 2016-08-17 | A kind of self adaptation baud rate RS485 communications protocol |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106130856A true CN106130856A (en) | 2016-11-16 |
Family
ID=57278416
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610675840.7A Pending CN106130856A (en) | 2016-08-17 | 2016-08-17 | A kind of self adaptation baud rate RS485 communications protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106130856A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528478A (en) * | 2016-12-06 | 2017-03-22 | 天津北芯微科技有限公司 | Single-bus asynchronous serial port communication system and communication method thereof |
CN107612803A (en) * | 2017-11-02 | 2018-01-19 | 上海辛莫智能科技有限公司 | A kind of data conversion Biodge device |
CN110677334A (en) * | 2019-09-27 | 2020-01-10 | 株洲中车时代电气股份有限公司 | Adaptive configuration method and device for underwater robot system |
CN110697522A (en) * | 2019-09-19 | 2020-01-17 | 广州慧特安科技有限公司 | Method, system and storage medium for detecting elevator communication protocol |
CN114866367A (en) * | 2022-04-13 | 2022-08-05 | 深圳市三旺通信股份有限公司 | CAN equipment communication method and device, CAN optical modem equipment and medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102098055A (en) * | 2010-12-28 | 2011-06-15 | 上海磁浮交通发展有限公司 | Data baud rate adaptive digital-analogue conversion device |
CN103036823A (en) * | 2012-12-14 | 2013-04-10 | 中船重工(武汉)凌久电子有限责任公司 | Baud rate fast self-adaptive method based on field programmable gate array (FPGA), processor and receiving end |
CN103514127A (en) * | 2012-06-15 | 2014-01-15 | 中国航天科工集团第三研究院第八三五八研究所 | Implementation method for achieving self-adaption of baud rate |
CN103514724A (en) * | 2012-06-27 | 2014-01-15 | 苏州工业园区新宏博通讯科技有限公司 | Adaptive configuration method of data acquisition unit |
CN103684678A (en) * | 2012-11-01 | 2014-03-26 | 国网电力科学研究院 | Baud rate adaptive method for UART, device and UART |
CN103716219A (en) * | 2013-09-25 | 2014-04-09 | 华中科技大学 | Field bus communication system based on RS485 protocol |
CN104168080A (en) * | 2013-05-15 | 2014-11-26 | 上海贝尔股份有限公司 | Method and apparatus for baud rate self adaption, and equipment |
CN104360974A (en) * | 2014-10-29 | 2015-02-18 | 上海伽利略导航有限公司 | Method and device for automatically adjusting Baud rate of universal asynchronous receiver/transmitter (UART) |
-
2016
- 2016-08-17 CN CN201610675840.7A patent/CN106130856A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102098055A (en) * | 2010-12-28 | 2011-06-15 | 上海磁浮交通发展有限公司 | Data baud rate adaptive digital-analogue conversion device |
CN103514127A (en) * | 2012-06-15 | 2014-01-15 | 中国航天科工集团第三研究院第八三五八研究所 | Implementation method for achieving self-adaption of baud rate |
CN103514724A (en) * | 2012-06-27 | 2014-01-15 | 苏州工业园区新宏博通讯科技有限公司 | Adaptive configuration method of data acquisition unit |
CN103684678A (en) * | 2012-11-01 | 2014-03-26 | 国网电力科学研究院 | Baud rate adaptive method for UART, device and UART |
CN103036823A (en) * | 2012-12-14 | 2013-04-10 | 中船重工(武汉)凌久电子有限责任公司 | Baud rate fast self-adaptive method based on field programmable gate array (FPGA), processor and receiving end |
CN104168080A (en) * | 2013-05-15 | 2014-11-26 | 上海贝尔股份有限公司 | Method and apparatus for baud rate self adaption, and equipment |
CN103716219A (en) * | 2013-09-25 | 2014-04-09 | 华中科技大学 | Field bus communication system based on RS485 protocol |
CN104360974A (en) * | 2014-10-29 | 2015-02-18 | 上海伽利略导航有限公司 | Method and device for automatically adjusting Baud rate of universal asynchronous receiver/transmitter (UART) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528478A (en) * | 2016-12-06 | 2017-03-22 | 天津北芯微科技有限公司 | Single-bus asynchronous serial port communication system and communication method thereof |
CN106528478B (en) * | 2016-12-06 | 2019-04-30 | 天津北芯微科技有限公司 | A kind of monobus asynchronous serial communication system and its communication means |
CN107612803A (en) * | 2017-11-02 | 2018-01-19 | 上海辛莫智能科技有限公司 | A kind of data conversion Biodge device |
CN110697522A (en) * | 2019-09-19 | 2020-01-17 | 广州慧特安科技有限公司 | Method, system and storage medium for detecting elevator communication protocol |
CN110697522B (en) * | 2019-09-19 | 2022-03-25 | 广州慧特安科技有限公司 | Method, system and storage medium for detecting elevator communication protocol |
CN110677334A (en) * | 2019-09-27 | 2020-01-10 | 株洲中车时代电气股份有限公司 | Adaptive configuration method and device for underwater robot system |
CN110677334B (en) * | 2019-09-27 | 2021-08-24 | 株洲中车时代电气股份有限公司 | Adaptive configuration method and device for underwater robot system |
CN114866367A (en) * | 2022-04-13 | 2022-08-05 | 深圳市三旺通信股份有限公司 | CAN equipment communication method and device, CAN optical modem equipment and medium |
CN114866367B (en) * | 2022-04-13 | 2023-12-05 | 深圳市三旺通信股份有限公司 | CAN equipment communication method and device, CAN optical cat equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106130856A (en) | A kind of self adaptation baud rate RS485 communications protocol | |
CN101751361B (en) | Switchover method for controlling data transmission interface in mobile terminal and terminal equipment | |
US7308516B2 (en) | Bi-directional serial interface for communication control | |
WO2021128712A1 (en) | Battery address management method and battery management system | |
CN204928889U (en) | Many interfaces protocol converter | |
CN103986610A (en) | Communication interface matching method, device and controller | |
US10484100B2 (en) | Optical module, optical module system and monitor method using the same | |
CN104317762A (en) | Method for adaptively controlling transmitting and receiving directions of RS485 chip by aid of FPGA (field programmable gate array) | |
CN108365944A (en) | A kind of communication means of half-duplex bus, system and room control system | |
CN102929830A (en) | Software simulation rapid communication protocol | |
CN207530847U (en) | RFID intelligent gateway devices | |
CN102445981B (en) | Data transmission system and data transmission method | |
CN103885910B (en) | The method that many equipment carry out IIC communications under holotype | |
CN201820120U (en) | Self-adapting multibus execution mechanism controller | |
CN101882124B (en) | RS422/485 double-use signal converter capable of automatically judging connector | |
CN102904789B (en) | RS485 isolates communicating circuit and control method thereof | |
CN102868583A (en) | FlexRay bus joint with fault diagnosis function | |
CN113253652A (en) | Unit communication control device, method and unit | |
CN105938463A (en) | Method for communication between terminal and computer | |
CN105718400A (en) | SPI based communication method | |
CN201213037Y (en) | Infrared transmission apparatus | |
US20060250232A1 (en) | Door intercom communication system and method of using same | |
CN1708027A (en) | Method for transmitting Ethernet equipment duplex mode information | |
CN214954608U (en) | Communication control device of unit and unit | |
CN209767567U (en) | Multi-master RS485 bus system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161116 |
|
RJ01 | Rejection of invention patent application after publication |