CN115733775A - Method for realizing automatic baud rate detection in digital asynchronous communication - Google Patents

Method for realizing automatic baud rate detection in digital asynchronous communication Download PDF

Info

Publication number
CN115733775A
CN115733775A CN202211315374.3A CN202211315374A CN115733775A CN 115733775 A CN115733775 A CN 115733775A CN 202211315374 A CN202211315374 A CN 202211315374A CN 115733775 A CN115733775 A CN 115733775A
Authority
CN
China
Prior art keywords
detection
brr
baud rate
value
data
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
Application number
CN202211315374.3A
Other languages
Chinese (zh)
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.)
Shanghai Huahong Integrated Circuit Co Ltd
Original Assignee
Shanghai Huahong Integrated Circuit Co Ltd
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 Shanghai Huahong Integrated Circuit Co Ltd filed Critical Shanghai Huahong Integrated Circuit Co Ltd
Priority to CN202211315374.3A priority Critical patent/CN115733775A/en
Publication of CN115733775A publication Critical patent/CN115733775A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)
  • Dc Digital Transmission (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a method for realizing automatic baud rate detection in digital asynchronous communication, which can detect the communication rate according to a received character and automatically set the value of a brr register under the condition that the communication rate of a system is not known in advance. The auto baud rate detection mode may be selected by the ABRMOD [1:0] field in a register prior to detection. There are four detection modes according to different character modes. In these auto baud rate modes, the baud rate is measured multiple times during the reception of data, and the results of each measurement can be recorded, with successive corrections to improve accuracy. The technology has practical application value in the field of digital communication.

Description

Method for realizing automatic baud rate detection in digital asynchronous communication
Technical Field
The invention relates to a baud rate detection technology in the field of digital asynchronous communication, in particular to a baud rate detection technology which is suitable for detecting the baud rate of data with unknown communication rate in a universal asynchronous receiver.
Background
In asynchronous communication, in the serial transmission process of data, the transmission baud rate between two devices needs to be kept the same to ensure the normal operation of transmission. When receiving data with unknown communication rate, the baud rate of the data transmitted by the other party needs to be known. At this time, communication baud rate detection is usually performed on the received data, and the receiving rate is adjusted according to the detection result. For the detection of the communication baud rate, the data frames as few as possible need to be used, the detection accuracy is improved as much as possible, and the detected result is fed back in time. Because the baud rate is unknown, an initial brr value needs to be set, but a sampling pulse generated by the brr value is temporarily unavailable, and the start and the end of one bit can be judged only according to a rising edge and a falling edge. Since the start bit is low, the width from the first falling edge to the first rising edge is a one-bit duration for data whose first bit is not "0". The usual automatic baud rate detection will use this calculated baud rate as the subsequent receiver baud rate. This patent has optimized automatic baud rate detection, and the upset characteristics of rational utilization initiating bit and data bit provide multiple detection mode in order to improve the accuracy, can refresh brr value many times in a frame data simultaneously to improve and detect feedback efficiency.
Disclosure of Invention
a) In the process of asynchronous communication, automatic baud rate detection needs to be performed on a system with unknown communication rate. The result is usually obtained by measuring the beginning and ending edges of the start bit. The invention provides four detection modes (modes 0-3) by introducing an automatic baud rate detection method with a selectable mode, fully utilizes the conversion characteristics of different types of data, can improve the accuracy of baud rate detection to the greatest extent according to actual requirements, feeds back the detection result to the system at the fastest speed, and has ideal effect through simulation.
b) The schematic block diagram of the invention is shown in fig. 1. The method comprises the detection of rising edges and falling edges on a receiving bus, a clock period number and data transmission bit number counter, a calculation conversion logic module from the counter to a brr value and a sampling pulse generation logic module. The mode selection will decide to select the start edge "edge 1" and the end edge "edge N" for detection, and will also decide the target value of the data bit counter abrbyte _ cnt. The clock period counting value selects x1 or x1/2 or x1/8 according to the bit number contained between the selected 'edge 1' and the selected 'edge N' to obtain a brr value, and the sampling pulse is timely adjusted by the sampling pulse generation logic module after the value is fed back to the sampling pulse generation logic module. In the case where the selection patterns are different, data for detecting the baud rate is also different, and the flip characteristic of each bit thereof matches the pattern. The times of updating brr registers in the next frame data in different modes are different from 1 time to 3 times, and the detection accuracy is relatively high in the mode with more updating times. Each update brr takes effect immediately and subsequent bit sampling is performed based on the updated value. After the data frame used for detection is received, the automatic baud rate detection process is also ended, and brr keeps the last updated value and continues to be used for receiving subsequent normal data.
Drawings
FIG. 1: automatic baud rate detection principle block diagram
FIG. 2 is a schematic diagram: different-mode automatic baud rate detection schematic diagram
FIG. 3: simulation result diagram for different-mode automatic baud rate detection
Detailed Description
FIG. 1 is a schematic block diagram of the present invention, including edge detection, a clock cycle counter abr _ cnt, a data bit number counter abrbyte _ cnt, and a conversion logic block for converting the counter to brr values. According to mode selection, counting the number of clock cycles and the number of bits between two specific edges, feeding back a brr value obtained through calculation to a sampling pulse generation logic module, and adjusting the generation of sampling pulses according to brr value in time by the sampling pulse generation logic module and using the sampling pulses to sample bus data.
The sampling pulse signal is widely applied to communication protocols such as UART (universal asynchronous receiver transmitter) and the like, the communication baud rate is defined as the ratio of the communication clock frequency to brr, and the communication baud rate can be adjusted by modifying the value of brr when the clock frequency is fixed. When receiving data with a temporarily unknown communication rate, automatic baud rate detection can be performed by receiving data with a specific format, and then the value of brr is changed according to the detection result to match the generation rate of the receiver sampling pulse. The invention provides four modes (modes 0-3) for automatic baud rate detection, and the baud rate precision obtained by using different modes for automatic detection is slightly different. There is an initial value for brr before detection, and a sample pulse can be generated with the initial value of brr, but this sample pulse is not used until brr is first updated. In the first detection, no interference edge appears in the middle after a specific edge is selected in any mode, the bit number between the interference edges is determined, the number of clock cycles in the counting period between the selected specific rising edge and the selected specific falling edge is mainly determined, and the two clock cycles are combined to obtain a new brr value for updating. Not the first detection, brr has been updated at least once, and the resulting sampling pulses are relatively accurate and can be used to count the number of bits transmitted. When the length of the selected detection interval is increased, edges similar to the ending edge may appear between the starting edge and the ending edge, and the current transmitted bit number can be obtained by using the data bit counter, so that misjudgment is prevented.
As shown in fig. 2, 1) mode 0: for a word with a first bit of "1", in this mode, the start bit has a falling edge at the beginning and a rising edge at the end, and the interval from the falling edge to the rising edge is measured, i.e. the duration of the start bit is measured, and the value of the brr register is updated at the end of the start bit. 2) Mode 1: for characters beginning with "10xx", the beginning bit has a falling edge at the beginning, and a falling edge occurs when the end of the "1" of the first bit of the data bit is switched to "0", and the interval from the falling edge to the falling edge is measured, that is, the duration of the beginning bit and the first data bit is measured, i.e., the value of brr is updated after the end of the first data bit. 3) Mode 2: in this mode, "0x7F" is received when LSB takes priority, and "0xFE" is received when MSB takes priority. When the start Bit is finished, a brr value BR corresponding to one baud rate is calculated firstly by using the starting falling edge and the finishing rising edge of the start Bit, updating is carried out, then BR value sampling is used when all 1 bits 0-Bit6 are received, when the Bit6 is finished, the falling edge occurs again, BR6 is calculated by using the falling edge at the start of the start Bit and the falling edge at the beginning as a new brr value for updating, and then BR6 is used for receiving. 4) Mode 3: in this mode, "0x55" is received with the LSB prioritized, and "0xAA" is received with the MSB prioritized. In the same mode 2, the brr value is updated for the first time to become BR at the end of the start Bit, in the same mode 1, the brr value is updated for the second time to become BR0 at the end of Bit0, and finally, at the end of Bit6, BR6 is obtained and updated according to the falling edge at the start of the start Bit and the falling edge at the end of Bit 6. During the period of Bit0 sampling, BR is used, the samples of Bit1-Bit6 are BR0, and Bit6 is sampled by BR 6. In mode 3, after the auto baud rate is complete, additional checks are made on the received data. If the received data is not "0x55" (LSB first), or "0xAA" (MSB first), an error is generated, marking ABRE position 1 with an error.
As shown in fig. 3, four modes of automatic baud rate detection simulation are performed during UART communication. Before the start of auto baud rate detection, brr is set to 598, and then reception of characters of the format corresponding to each mode is started. Simulation results show that the brr value is updated after the corresponding edge, and in a mode where there are multiple updates, there is a small difference in the brr value obtained each time. Therefore, the detection accuracy of the baud rate can be effectively improved by improving the detection interval.

Claims (3)

1. The method for realizing automatic baud rate detection in a digital asynchronous communication system is characterized by comprising a clock period counter and a data bit number counter BBR value calculation conversion logic module, a BBR register and a sampling pulse generation logic module, wherein the baud rate of received data can be detected in real time, the corresponding register is updated to update sampling pulses, four detection modes are divided, wherein the 2 nd to 4 th modes need to update brr registers for multiple times, and the generation method comprises the following steps:
1) When the detection mode updates the brr value only once, the clock period counting and the bit number counting are carried out from the starting edge of the start bit to the corresponding ending edge, and the sampling pulse is updated immediately after the brr value is obtained through calculation;
2) When the detection mode needs to update brr values for multiple times, the method for obtaining brr for the first time is the same as that in 1), then the clock period counter and the data bit number counter are not cleared to continue counting, and brr is recalculated and updated once a specified edge is reached.
2. The method of claim 1, wherein the corresponding detection mode is configured according to the character characteristics to be received, and the baud rate value is refreshed 1-3 times in one frame of data, thereby realizing detection with different accuracy.
3. The method of claim 1, wherein for each of the 2 nd to 4 th detection modes, the baud value is updated a plurality of times in a frame of the detection data, and a new value is used to generate the sampling pulse immediately after each update.
CN202211315374.3A 2022-10-26 2022-10-26 Method for realizing automatic baud rate detection in digital asynchronous communication Pending CN115733775A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211315374.3A CN115733775A (en) 2022-10-26 2022-10-26 Method for realizing automatic baud rate detection in digital asynchronous communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211315374.3A CN115733775A (en) 2022-10-26 2022-10-26 Method for realizing automatic baud rate detection in digital asynchronous communication

Publications (1)

Publication Number Publication Date
CN115733775A true CN115733775A (en) 2023-03-03

Family

ID=85293915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211315374.3A Pending CN115733775A (en) 2022-10-26 2022-10-26 Method for realizing automatic baud rate detection in digital asynchronous communication

Country Status (1)

Country Link
CN (1) CN115733775A (en)

Similar Documents

Publication Publication Date Title
CN100575965C (en) A kind of method of measuring frequency of single-chip
CN111726115B (en) Frequency division and counting system and method for pulse signals of rotary pulse encoder
JP2001352350A (en) Measurement system and method by statistic eye-diagram of continuous bit stream
EP2965458B1 (en) Dithering circuit for sampling serial data transmission
CN102546084B (en) Anti-interference error-correcting and sampling system and method in process of receiving asynchronous serial communication data
US6163586A (en) Autobaud/autoecho method
JPH05197442A (en) Clock synchronizing method for receiving pulse- position coding signal
CN111786865B (en) Data processing method and equipment
EP0610592B1 (en) Demodulation circuit of communication control system
US20050156645A1 (en) Arrangement for correcting the phase of a data sampling clock signal during a period of sampling data in a received signal
CN115733775A (en) Method for realizing automatic baud rate detection in digital asynchronous communication
CN114422063A (en) Timestamp pulse synchronization method
US4644563A (en) Data transmission method and system
US5400022A (en) Pulse code bit cell demodulation
CN1316777C (en) Unit for determining samping phase
CN100426679C (en) Oversampling technique to reduce jitter
JP2702773B2 (en) Data monitoring device
JP2008532399A (en) Data transmission method, transmission side and reception side for the data transmission method
US20230033295A1 (en) Communication device, industrial machine, and communication method
SU1483466A1 (en) Piecewise linear interpolator
JPH04329721A (en) Data reception method
US5613104A (en) Serial transmission apparatus having an operation surely carried out even if a serial datum is represented by an unknown number of data bits
JPH0316054B2 (en)
SU646361A2 (en) Device for registering process parameters
CN101136919B (en) Pulse matching method used for baseband signal demodulation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination