CN105553628A - Method and device for detecting serial communication baud rate - Google Patents

Method and device for detecting serial communication baud rate Download PDF

Info

Publication number
CN105553628A
CN105553628A CN201510880724.4A CN201510880724A CN105553628A CN 105553628 A CN105553628 A CN 105553628A CN 201510880724 A CN201510880724 A CN 201510880724A CN 105553628 A CN105553628 A CN 105553628A
Authority
CN
China
Prior art keywords
data
baud rate
data valid
communication apparatus
received signal
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.)
Granted
Application number
CN201510880724.4A
Other languages
Chinese (zh)
Other versions
CN105553628B (en
Inventor
刘中海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luoyang Institute of Electro Optical Equipment AVIC
Original Assignee
Luoyang Institute of Electro Optical Equipment AVIC
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Luoyang Institute of Electro Optical Equipment AVIC filed Critical Luoyang Institute of Electro Optical Equipment AVIC
Priority to CN201510880724.4A priority Critical patent/CN105553628B/en
Publication of CN105553628A publication Critical patent/CN105553628A/en
Application granted granted Critical
Publication of CN105553628B publication Critical patent/CN105553628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/20Arrangements for detecting or preventing errors in the information received using signal quality detector

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The invention relates to a method and device for detecting serial communication baud rate. The device comprise a programmable logic device which is configured with a data validity detector and a data width counter. The data validity detector is used for detecting whether an input signal of a communication device is in an idle state and determining whether the input signal of the communication device is in an effective state. When the data valid signal of the data validity detector is detected by the data width counter as being in an effective state, counting is started. According to the method, the time for character transmission is determined through detecting the validity of received signal of the communication device, and the baud rate is determined through measuring the transmitted character width of the serial communication. According to the device, there is no need to measure consumption time of data flow bits, the configuration requirement of a device is reduced, baud rate of an unknown device is quickly detected, and great convenience is brought for users.

Description

A kind of serial communication baud rate detection method and device
Technical field
The invention belongs to the communications field, be specifically related to a kind of serial communication baud rate detection method and device.
Background technology
In Industry Control, telecommunications dispatch control system and in some other equipment; the serial communication interfaces such as RS232/422/485 often can be used as control desk or monitor-interface; in use, do not know communication apparatus work baud rate sometimes and the running parameter of system cannot be correctly set.Whenever running into this situation, conventional method is looked for specification to check or looks for designer to inquire or attempt the baud rate commonly used one by one, and this method brings a lot of inconvenience to the use of communication apparatus.
Existing communication apparatus baud rate detection method is the time that the position by measuring communication apparatus Received signal strength consumes, obtain communication baud rate, thus require that checkout gear has high precision clock, as the patent documentation " a kind of Multi-path serial communication interface baud rate automatic-detection circuit and method " that application number is 201010614318.0, and the patent documentation " detecting the UART device and detection method to set up thereof that arrange function with baud rate " that application number is 200910065713.5 discloses a kind of by detecting rising edge, trailing edge determines data flow position, thus the data width in calculating setting-up time, due to rising edge and trailing edge will be judged, also require that checkout gear has high precision clock, so, high to the configuration requirement of device.
Summary of the invention
The invention provides a kind of serial communication baud rate detection method and device, require that checkout gear has the problem of high precision clock to solve existing communication apparatus baud rate detection method.
For solving the problems of the technologies described above, serial communication baud rate checkout gear of the present invention comprises a programmable logic device, described programmable logic device is configured with data valid detector and data width counter, described data valid detector detects whether communication apparatus input signal is idle condition, judge whether communication equipment input signal is " effectively " state, when described data width counter detects that the data valid signal of data valid detector is for " effectively " state, starts counting.
This device also comprises communication baud rate multilevel iudge device, and described communication baud rate multilevel iudge device is according to the count value of data width counter, and multilevel iudge goes out communication baud rate.
This device is arranged in the interface of supervisory control comuter.
Serial communication baud rate detection method comprises
1) carry out write operation to data valid detector corresponding data position, log-on data valid detector detects communication equipment Received signal strength;
2) carry out read operation to data valid detector corresponding data position, if the data valid signal of data valid detector is " effectively " state, data width rolling counters forward, until the data valid signal of data valid detector is engineering noise state;
3) read operation is carried out to data width counter corresponding data position, obtain the width gauge numerical value of data word, after comparison, judge the baud rate of communication equipment.
Described data valid detector comprises the step that communication equipment Received signal strength detects:
A) data valid signal is set to engineering noise state, detects and starts;
B) judge whether communication apparatus Received signal strength is idle condition, if not, then waits for, otherwise, carry out step c);
C) judge whether communication apparatus Received signal strength is effective status, if fruit is no, then wait for, otherwise data valid signal is set to " effectively " state;
D) continue to judge whether communication apparatus Received signal strength is effective status, if so, then waits for, otherwise data valid signal is set to engineering noise state, detects and terminate.
Describedly judge that whether communication apparatus Received signal strength is the method for idle condition and is: interval according to the first predeterminated voltage, when communication apparatus reception voltage signal value is positioned at the first predeterminated voltage interval, judge that communication apparatus Received signal strength is idle condition.
Describedly judge that whether communication apparatus Received signal strength is the method for effective status and is: interval according to the second predeterminated voltage, when communication apparatus reception voltage signal value is positioned at the second predeterminated voltage interval, judge that communication apparatus Received signal strength is effective status.
When write operation is carried out to data width counter corresponding data position, first to carry out clear operation.
Method of the present invention and device by the validity detecting communication apparatus Received signal strength judge its transmit time needed for word, and by the measurement to serial communication transmission word width, thus judge its baud rate, this device does not need the elapsed time of measurement data stream position, also without the need to judging rising edge and the trailing edge of data flow, the size judging magnitude of voltage is only needed to calculate data width, do not require that checkout gear has high precision clock, reduce the configuration requirement to device, and the fast detecting achieved unknown communication apparatus baud rate, bring great convenience to user of service.
Accompanying drawing explanation
Fig. 1 is communication baud rate self-reacting device principle schematic of the present invention.
Embodiment
Below in conjunction with accompanying drawing, do bright in detail further to technical scheme of the present invention.
Serial communication baud rate checkout gear embodiment
As shown in Figure 1, the device of the present embodiment comprises a programmable logic device, is configured with data valid detector 1, data width counter 2 in described programmable logic device.Data valid detector detects whether communication apparatus input signal is idle condition, judge whether communication equipment input signal is " effectively " state, when data width counter detects that the data valid signal of data valid detector is for " effectively " state, starts counting.
Wherein, data valid detector is for detecting communication apparatus status input signal, and setting data useful signal position; , data width counter is used for according to data valid signal position, counts valid data width.
Baud rate checkout gear is located in the communication interface of supervisory control comuter.
This device is provided with communication baud rate multilevel iudge device, and for the count value according to data width counter, multilevel iudge goes out communication baud rate, can certainly carry out manpower comparing and comparatively obtain baud rate.
This device can arrange serial communication transceiver 3 in the programmable logic device, also can be other individual components.
Serial communication baud rate detection method embodiment
The method, based on above-mentioned detection device, specifically comprises the following steps:
(1) write operation is carried out to data width counter 2 corresponding data position, reset, data width counter 2 enters count status, if " data are effective " signal that data valid detector 1 is sent here is " effectively " state, then data width counter 2 counts until " data are effective " signal becomes engineering noise state;
(2) carry out write operation to data valid detector 1 corresponding data position, log-on data valid detector 1 pair of communication apparatus Received signal strength " Rx " is detected;
(3) read operation is carried out to data valid detector 1 corresponding data position, judge whether detection completes, if do not complete, then waits for, if complete, performs next step according to corresponding data bit;
(4) read operation is carried out to data width counter 2 corresponding data position, obtain the width gauge numerical value of data word, after comparison, judge the baud rate of communication apparatus.
The effective detecting step of data of described data valid detector 1 comprises:
(1) " data are effective " signal setting is engineering noise state, start detection;
(2) judge that now whether communication apparatus input signal " Rx " is idle condition, if not, then waits for, if it is carries out next step;
(3) judge that now whether communication apparatus input signal " Rx " is effective status, if not, then waits for, if it is carries out next step;
(4) " data are effective " signal setting is " effectively " state, judges that now whether communication apparatus input signal " Rx " is effective status, if so, then waits for, if otherwise carry out next step;
(5) data valid signal is set to engineering noise state, and detection completes.
The detection of " data are effective " signal is described for RS-232-C standard below:
EIA-RS-232C has made regulation to electrical characteristic, logic level and various holding wire function.On TxD and RxD:
Logical one (MARK)=-3V ~-15V
Logical zero (SPACE)=+ 3 ~+15V
Namely can judge currently whether have transfer of data by detecting the voltage of " Rx " signal.When voltage can think " free time " state between-3 ~+3V.
To the differentiation of baud rate based on following foundation:
The form of serial data is: start bit+data bit+parity check bit+position of rest, wherein start bit 1bit, data bit 5 ~ 8bit, check digit 0,1bit, position of rest 1,1.5 and 2bit.The transmission word length of a serial communication is 7 ~ 12, and word length is changed to 0.5.The common baud rate transmission time is in table 1.
After completing once-through operation, the value in sense data width counter 2, and according to time of this dataword transfer, comparatively corresponding baud rate can be obtained with the numeric ratio in table 1.
Table 1 different baud rate word transmission required time table
The present embodiment judges the length of a word at the free time in the middle of transmitting based on two words, inapplicable for leisureless transmission.
In addition, baud rate is that 10.5 in the transmission time and 57600 of 7 to 8bit words in 38400 is basically identical to the transmission time of 12bit word, in use needs the width in conjunction with data bit to judge, otherwise may cause erroneous judgement.

Claims (8)

1. a serial communication baud rate checkout gear, it is characterized in that, this device comprises a programmable logic device, described programmable logic device is configured with data valid detector and data width counter, described data valid detector detects whether communication apparatus input signal is idle condition, judge whether communication equipment input signal is " effectively " state, when described data width counter detects that the data valid signal of data valid detector is for " effectively " state, starts counting.
2. serial communication baud rate checkout gear according to claim 1, it is characterized in that, this device also comprises communication baud rate multilevel iudge device, and described communication baud rate multilevel iudge device is according to the count value of data width counter, and multilevel iudge goes out communication baud rate.
3. serial communication baud rate checkout gear according to claim 1, it is characterized in that, this device is arranged in the interface of supervisory control comuter.
4. adopt a serial communication baud rate detection method for device described in claim 1, it is characterized in that, the method comprises the steps:
1) carry out write operation to data valid detector corresponding data position, log-on data valid detector detects communication equipment Received signal strength;
2) carry out read operation to data valid detector corresponding data position, if the data valid signal of data valid detector is " effectively " state, data width rolling counters forward, until the data valid signal of data valid detector is engineering noise state;
3) read operation is carried out to data width counter corresponding data position, obtain the width gauge numerical value of data word, after comparison, judge the baud rate of communication equipment.
5. serial communication baud rate detection method according to claim 4, it is characterized in that, described data valid detector comprises the step that communication equipment Received signal strength detects:
A) data valid signal is set to engineering noise state, detects and starts;
B) judge whether communication apparatus Received signal strength is idle condition, if not, then waits for, otherwise, carry out step c);
C) judge whether communication apparatus Received signal strength is effective status, if fruit is no, then wait for, otherwise data valid signal is set to " effectively " state;
D) continue to judge whether communication apparatus Received signal strength is effective status, if so, then waits for, otherwise data valid signal is set to engineering noise state, detects and terminate.
6. serial communication baud rate detection method according to claim 5, it is characterized in that, describedly judge that whether communication apparatus Received signal strength is the method for idle condition and is: interval according to the first predeterminated voltage, when communication apparatus reception voltage signal value is positioned at the first predeterminated voltage interval, judge that communication apparatus Received signal strength is idle condition.
7. serial communication baud rate detection method according to claim 5, it is characterized in that, describedly judge that whether communication apparatus Received signal strength is the method for effective status and is: interval according to the second predeterminated voltage, when communication apparatus reception voltage signal value is positioned at the second predeterminated voltage interval, judge that communication apparatus Received signal strength is effective status.
8. serial communication baud rate detection method according to claim 5, is characterized in that, when carrying out write operation to data width counter corresponding data position, first will carry out clear operation.
CN201510880724.4A 2015-12-05 2015-12-05 A kind of serial communication baud rate detection method and device Active CN105553628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510880724.4A CN105553628B (en) 2015-12-05 2015-12-05 A kind of serial communication baud rate detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510880724.4A CN105553628B (en) 2015-12-05 2015-12-05 A kind of serial communication baud rate detection method and device

Publications (2)

Publication Number Publication Date
CN105553628A true CN105553628A (en) 2016-05-04
CN105553628B CN105553628B (en) 2018-11-16

Family

ID=55832580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510880724.4A Active CN105553628B (en) 2015-12-05 2015-12-05 A kind of serial communication baud rate detection method and device

Country Status (1)

Country Link
CN (1) CN105553628B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106788920A (en) * 2016-12-19 2017-05-31 珠海格力电器股份有限公司 Baud rate deviation detection method and device and air conditioner indoor unit
CN110266405A (en) * 2019-05-10 2019-09-20 珠海格力电器股份有限公司 Equipment communication signal deviation detecting system
CN113238974A (en) * 2021-05-19 2021-08-10 青岛信芯微电子科技股份有限公司 Bus bandwidth efficiency statistical method, device, equipment and medium
CN116760508A (en) * 2023-08-18 2023-09-15 荣耀终端有限公司 Baud rate setting method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5982837A (en) * 1997-06-16 1999-11-09 Lsi Logic Corporation Automatic baud rate detector
CN1570899A (en) * 2004-04-25 2005-01-26 赵红刚 Method for automatic matching communication of computer and serial port external module
CN101626288A (en) * 2009-08-10 2010-01-13 中国航空工业集团公司洛阳电光设备研究所 UART device with Baud rate detection and set function and detection and set method thereof
CN102315983A (en) * 2010-12-30 2012-01-11 杭州鼎利环保科技有限公司 Circuit and method for automatically detecting Baud rate of multiple paths of serial communication interfaces
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
CN103618588A (en) * 2013-11-26 2014-03-05 中国科学院嘉兴微电子与系统工程中心 Automatic Baud rate detection method and detection module
CN203574663U (en) * 2013-11-26 2014-04-30 中国科学院嘉兴微电子与系统工程中心 Automatic baud rate detection module
CN105068966A (en) * 2015-08-19 2015-11-18 长沙威胜信息技术有限公司 Serial automatic identification method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5982837A (en) * 1997-06-16 1999-11-09 Lsi Logic Corporation Automatic baud rate detector
CN1570899A (en) * 2004-04-25 2005-01-26 赵红刚 Method for automatic matching communication of computer and serial port external module
CN101626288A (en) * 2009-08-10 2010-01-13 中国航空工业集团公司洛阳电光设备研究所 UART device with Baud rate detection and set function and detection and set method thereof
CN102315983A (en) * 2010-12-30 2012-01-11 杭州鼎利环保科技有限公司 Circuit and method for automatically detecting Baud rate of multiple paths of serial communication interfaces
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
CN103618588A (en) * 2013-11-26 2014-03-05 中国科学院嘉兴微电子与系统工程中心 Automatic Baud rate detection method and detection module
CN203574663U (en) * 2013-11-26 2014-04-30 中国科学院嘉兴微电子与系统工程中心 Automatic baud rate detection module
CN105068966A (en) * 2015-08-19 2015-11-18 长沙威胜信息技术有限公司 Serial automatic identification method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
周建华,万书芹,薛忠杰: ""一种新颖的UART 自适应波特率发生器的设计"", 《集成电路设计与开发》 *
赵琳娜,赵煌,李红征: ""UART波特率发生电路设计"", 《电子与封装》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106788920A (en) * 2016-12-19 2017-05-31 珠海格力电器股份有限公司 Baud rate deviation detection method and device and air conditioner indoor unit
CN106788920B (en) * 2016-12-19 2019-08-23 珠海格力电器股份有限公司 Baud rate deviation detection method and device and air conditioner indoor unit
CN110266405A (en) * 2019-05-10 2019-09-20 珠海格力电器股份有限公司 Equipment communication signal deviation detecting system
CN113238974A (en) * 2021-05-19 2021-08-10 青岛信芯微电子科技股份有限公司 Bus bandwidth efficiency statistical method, device, equipment and medium
CN116760508A (en) * 2023-08-18 2023-09-15 荣耀终端有限公司 Baud rate setting method and system
CN116760508B (en) * 2023-08-18 2023-11-07 荣耀终端有限公司 Baud rate setting method and system

Also Published As

Publication number Publication date
CN105553628B (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN105553628A (en) Method and device for detecting serial communication baud rate
CN105068966A (en) Serial automatic identification method
CN101626288A (en) UART device with Baud rate detection and set function and detection and set method thereof
CN102315983B (en) Circuit and method for automatically detecting Baud rate of multiple paths of serial communication interfaces
CN101404556A (en) One-wire bus communication method
CN108011692A (en) A kind of data communications method for microcontroller
CN101710857A (en) Serial communication baud rate adaptive method and device thereof
CN102546084B (en) Anti-interference error-correcting and sampling system and method in process of receiving asynchronous serial communication data
KR101129748B1 (en) Optimizing exit latency from an active power management state
CN104008078A (en) Method for high-speed transmission between data transmission boards based on FPGA
JP2019134419A (en) Uart communication-speed automatic-switching method
CN201215974Y (en) Communication interface without polarity
CN203574663U (en) Automatic baud rate detection module
CN102970300B (en) A kind of asynchronous communication method
CN101442380B (en) Method and apparatus for testing error rate based on high speed serial interface encoded mode
US20140153623A1 (en) Device for auto baud rate detection
CN1333529C (en) Clock signal detection method and apparatus in electronic devices
CN105446925A (en) Method and device for improving data receiving correctness of serial port
CN201247487Y (en) Input device for multipath Weggen signal
CN103631740B (en) The circuit of SD card adaptation transmitter byte-aligned in the spi mode
CN104699651A (en) Method for sending and receiving data by meter RS-485
CN112013506B (en) Communication detection method and device and air conditioner
CN110989451B (en) Detection control method based on multi-point touch and remote control shared detection control system
CN100595745C (en) Rate verification of an incoming serial alignment sequence
CN201251585Y (en) Hand-hold current velocity calculating device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant