CN116126766A - Asynchronous communication data sampling method, device, equipment and medium - Google Patents

Asynchronous communication data sampling method, device, equipment and medium Download PDF

Info

Publication number
CN116126766A
CN116126766A CN202111369269.3A CN202111369269A CN116126766A CN 116126766 A CN116126766 A CN 116126766A CN 202111369269 A CN202111369269 A CN 202111369269A CN 116126766 A CN116126766 A CN 116126766A
Authority
CN
China
Prior art keywords
communication data
data
sampling
signal
communication
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
CN202111369269.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.)
CRM ICBG Wuxi Co Ltd
Original Assignee
CRM ICBG Wuxi 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 CRM ICBG Wuxi Co Ltd filed Critical CRM ICBG Wuxi Co Ltd
Priority to CN202111369269.3A priority Critical patent/CN116126766A/en
Publication of CN116126766A publication Critical patent/CN116126766A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
    • G06F13/4226Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus with asynchronous protocol
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4027Coupling between buses using bus bridges
    • G06F13/405Coupling between buses using bus bridges where the bridge performs a synchronising function

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Transmission Systems Not Characterized By The Medium Used For Transmission (AREA)

Abstract

The invention provides a method, a device, equipment and a medium for sampling asynchronous communication data; wherein the method comprises the following steps: sequentially delaying the original communication data to obtain first to fourth communication data after sequential delay; extracting data change signals in the original communication data, and extracting corresponding data change signals in the first communication data and the third communication data to construct a change detection signal; in the system clock domain, according to the time sequence relation between the current sampling signal and the change detection signal, selecting second communication data or fourth communication data as a sampling data source to sample data; on the premise of ensuring the accuracy of data sampling, the asynchronous communication process can be realized without frequency division processing on the count overflow rate, so that the reduction of the communication transmission rate caused by the frequency division coefficient can be avoided, and the communication rate in asynchronous transmission is improved.

Description

Asynchronous communication data sampling method, device, equipment and medium
Technical Field
The invention belongs to the technical field of electronic communication, and particularly relates to an asynchronous communication data sampling method, an asynchronous communication data sampling device, asynchronous communication data sampling equipment and an asynchronous communication data sampling medium.
Background
Asynchronous communication is a common communication mode between devices, and can simultaneously receive and transmit data.
In the asynchronous communication process based on a single counter, the data sampling mode is usually to configure a counting period T of the counter so as to determine a counting overflow rate of 1/T according to the counting period T; the counting overflow rate is subjected to frequency division processing by using a frequency divider, wherein the frequency division number is N, so that the baud rate after the frequency division processing is 1/(N.times.T), namely the duration of each 1bit of data in transmission is N.times.T, and the duration is the period of the baud rate; and for any received communication data, determining the change time of the data according to the start time T1 of the data transmission, and further determining the sampling time of the communication data to be T1+n T, wherein N < N, N is approximately equal to T/2, so as to ensure the accuracy of data sampling, and sampling is required to be performed at the middle position of the data during each data sampling.
Considering that after the receiving end synchronizes to the clock domain where the transmitting end works, a certain deviation still exists in the transceiving duration of single communication data, and along with the progress of the transmission process, the deviation between the receiving end and the transmitting end can be accumulated continuously; therefore, in order to ensure the correct sampling of each communication data, a frequency division coefficient with a larger value is generally configured, so that the maximum transmission rate in the asynchronous transmission process is influenced, the communication speed is reduced, and the communication efficiency is influenced; and the baud rate after the overflow rate frequency division processing is an integral multiple of the overflow rate and the multiple is larger, so that larger data sampling deviation can be generated when the baud rate with specific frequency is used for communication, and further data transmission errors or failures can be caused.
Disclosure of Invention
In view of the above drawbacks in the prior art, the present invention aims to provide a method, apparatus, device and medium for sampling asynchronous communication data, which are used for solving the problems of avoiding deviation accumulation and further affecting communication transmission speed due to the adoption of a larger frequency division coefficient setting in the existing asynchronous communication process.
To achieve the above and other related objects, the present invention provides, in a first aspect, a method for sampling asynchronous communication data, including: synchronizing the original communication data to a system clock domain to obtain first communication data; performing successive delay processing on the first communication data to sequentially obtain second communication data, third communication data and fourth communication data; when an original change signal is detected in the original communication data, respectively extracting corresponding first communication data change signals and third communication data change signals from the first communication data and the third communication data to construct a change detection signal based on the first communication data change signals and the third communication data change signals; acquiring a data sampling signal; and selecting a data source from the second communication data and the fourth communication data based on the time sequence relation between the data sampling signal and the change detection signal, and executing data sampling on the selected data source to obtain information corresponding to the original change signal.
In an embodiment of the present invention, the performing a successive delay process on the first communication data sequentially obtains second communication data, third communication data, and fourth communication data, including: processing the first communication data according to a first clock interval delay to obtain the second communication data; processing the second communication data according to a second clock interval delay to obtain the third communication data; and processing the third communication data according to a third clock interval delay to obtain the fourth communication data.
In an embodiment of the present invention, the first clock interval, the second clock interval, and the third clock interval each include any one integer number of clock signals from 2 to 5.
In an embodiment of the present invention, the constructing a change detection signal based on the first communication data change signal and the third communication data change signal includes: the first communication data change signal is set as a start bit signal and the third communication data change signal is set as a stop bit signal to obtain the change detection signal.
In an embodiment of the present invention, the determining a data source in the second communication data and the fourth communication data based on the time distribution characteristics of the data sampling signal and the change detection signal includes: detecting whether the sampling time of the data sampling signal is positioned after the starting time of the change detection signal and before the ending time of the change detection signal, and if so, selecting fourth communication data as the data source; if not, selecting the second communication data as the data source.
In an embodiment of the present invention, the asynchronous communication data sampling method further includes: and detecting the quality of sampled data after the data source is subjected to data sampling, and adjusting the sizes of the first clock interval, the second clock interval and the third clock interval according to the detection result.
The present invention provides in a second aspect an asynchronous communication data sampling method, comprising: the first communication data acquisition unit is used for synchronizing the original communication data to the system clock domain; the delay processing unit is used for executing successive delay processing on the first communication data so as to sequentially obtain second communication data, third communication data and fourth communication data; the edge detection unit is used for respectively extracting corresponding first communication data change signals and third communication data change signals from the first communication data and the third communication data when the original communication data detects the original change signals; a change detection signal construction unit configured to construct a change detection signal according to the first communication data change signal and the third communication data change signal; a sampling signal acquisition unit for acquiring a data sampling signal; a data source selecting unit, configured to select a data source from the second communication data and the fourth communication data according to a timing relationship between the data sampling signal and the change detecting signal; and the data sampling unit is used for performing data sampling on the selected data source so as to obtain information corresponding to the original change signal.
In an embodiment of the present invention, the delay processing unit includes: a clock interval determination submodule for determining a first clock interval, a second clock interval and a third clock interval respectively; a delay sub-module for processing the first communication data according to the first clock interval delay to obtain the second communication data; processing the second communication data according to a second clock interval delay to obtain the third communication data; and processing the third communication data according to a third clock interval delay to obtain the fourth communication number
In one embodiment of the present invention, the data source selecting unit includes: the detection sub-module is used for detecting whether the sampling time of the data sampling signal is positioned after the starting time of the change detection signal and before the ending time of the change detection signal so as to obtain a detection result; and the selecting submodule is used for selecting the second communication data or the fourth communication data as the data source according to the detection result.
In an embodiment of the present invention, the asynchronous communication data sampling device includes: the selected submodule comprises a level signal output submodule which is used for outputting different level signals according to the detection result obtained by the detection submodule so as to select the second communication data or the fourth communication data as the data source according to the different level signals.
The present invention provides in a third aspect an electronic device comprising: a processor, a communication interface, a memory, and a communication bus; the processor, the communication interface and the memory complete communication with each other through the communication bus; the memory is used for storing at least one instruction; the instructions cause the processor to perform the asynchronous communication data sampling method of any of the above.
The present invention provides in a fourth aspect a computer storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the asynchronous communication data sampling method as described in any one of the above.
As described above, the method, the device, the equipment and the medium for sampling asynchronous communication data provided by the invention can directly acquire the baud rate based on the counting overflow rate without frequency division processing on the counting overflow rate on the premise of ensuring the accuracy of data sampling, thereby not only avoiding the reduction of the communication transmission rate caused by larger frequency division coefficient, further improving the communication rate in asynchronous transmission, but also improving the flexible configuration of the baud rate parameter in the asynchronous communication process.
Drawings
FIG. 1 is a timing diagram of a method for sampling data in an asynchronous communication system according to the prior art;
FIG. 2 is a flow chart of an embodiment of the method for sampling asynchronous communication data according to the present invention;
FIG. 3 is a timing diagram of an asynchronous communication data sampling method according to an embodiment of the present invention (the sampling time of the sampling signal is before the start time of the change detection signal);
FIG. 4 is a timing diagram of an asynchronous communication data sampling method according to an embodiment of the present invention (the sampling instant of the sampling signal is after the termination instant of the change detection signal);
FIG. 5 is a timing diagram of an asynchronous communication data sampling method according to an embodiment of the present invention; (the sampling instants of the sampling signals lie within the time range of the change detection signal);
FIG. 6 is a schematic diagram of an embodiment of the asynchronous communication data sampling device according to the present invention;
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
Referring to fig. 1, a timing diagram of an asynchronous communication data sampling method in the prior art is shown. The asynchronous communication data sampling method is suitable for an asynchronous communication process of acquiring the baud rate based on a single counter.
Specifically, as shown in fig. 1, clk is a system working clock, tovfl is a counter overflow flag, when a receiving end detects a falling edge of a start bit in communication data rxd, a frequency division counter is enabled to start working, a monitor is enabled to monitor the count value rx_cnt in the counter, when the count value rx_cnt is monitored to reach a preset value, as shown in fig. 1, a clock signal rx_clk of the counter is set high to generate overflow interrupt, and the receiving end executes data sampling, so that stable data is captured.
In order to solve the technical problems in the prior art, the method can avoid reducing the communication rate of asynchronous communication and improve the flexibility of parameter setting such as baud rate while ensuring accurate data sampling in the asynchronous communication process; the invention provides an asynchronous communication data sampling method, an asynchronous communication data sampling device, asynchronous communication data sampling equipment and a computer readable storage medium, wherein original communication data is subjected to multiple delay processing to obtain a plurality of delayed communication data after sequential delay; constructing a change detection signal based on the delayed communication data; in the system clock domain, whether the sampling time of the current sampling point is in the time range of the change detection signal is detected, and whether the receiving end performs delay sampling on the original communication data is determined according to the detection result, so that frequency division processing on the counting overflow rate is not needed, and accurate sampling on the communication data can be realized.
Example 1
Referring to fig. 2, a flow chart of the asynchronous communication data sampling method according to an embodiment of the present invention is shown; as depicted in fig. 2, the method comprises:
s1, synchronizing received original communication data to a system clock domain when a working state is an idle state so as to obtain first communication data; performing successive delay processing on the first communication data to sequentially obtain second communication data to fourth communication data;
wherein the second communication data to the fourth communication data are sequentially relatively delayed.
Specifically, when the working state of the receiving end is an idle state, synchronizing a clock signal of original communication data reaching the receiving port to a system clock domain to obtain first communication data;
based on a preset first clock interval X1, carrying out delay processing on the first communication data to obtain second communication data; namely, in the system clock domain, the clock signal of the second communication data is delayed by X1 clock signals compared with the clock signal of the first communication data;
based on a preset second clock interval X2, carrying out delay processing on the second communication data to obtain third clock data; namely, in the system clock domain, the clock signal of the third communication data is delayed by X2 clock signals compared with the clock signal of the second communication data;
and, based on a preset third clock interval X3, performing deferral processing on the third communication data to obtain a fourth time Zhong Shuju; that is, in the system clock domain, the clock signal of the fourth communication data is delayed by X3 clock signals from the clock signal of the third communication data.
Optionally, the number of clock signals included in the first clock interval, the second clock interval and the third clock interval is any integer from 2 to 5, that is, the number of clock signals included in the first clock interval is any integer from 2 to 5, the number of clock signals included in the second clock interval is any integer from 2 to 5, and the number of clock signals included in the third clock interval is any integer from 2 to 5, so as to ensure that the clock interval between the sampling point time and the data change time is not less than 2, and reduce the error rate of the receiving end in the communication data receiving process.
Optionally, the number of clock signals included in the first clock interval, the second clock interval and the third clock interval is the same, and the number is any integer from 2 to 5.
Furthermore, the number of clock signals included in the first clock interval, the second clock interval and the third clock interval is partially different or is different, so that the sampling effect of the receiving end on communication data with different transmission rates is improved, and the application range of the method is further expanded.
S2, detecting the original communication data, and respectively extracting corresponding first communication data change signals and third communication data change signals from the first communication data and the third communication data when detecting that the original communication data has original change signals so as to construct change detection signals based on the first communication data change signals and the third communication data change signals;
specifically, in the idle state, edge detection is performed on the original communication data received by the receiving port; when detecting that a falling edge signal or a rising edge signal appears in the original communication data, extracting signal changes in the first communication data and the third communication data to obtain a first communication data change signal and a third communication data change signal corresponding to the change signal in the original communication data; the time for obtaining the change signals in the first communication data and the third communication data is T1 and T3 in sequence.
Constructing a change detection signal based on the change signal of the first communication data and the change signal of the third communication data; specifically, the first communication data change signal is set as a start bit signal of the change detection signal; and setting the third communication data change signal as a termination bit signal of the change detection signal to form the change detection signal; the duration of the change detection signal is T1 to T3.
Optionally, the change detection signal is a high level signal.
It should be noted that, after the receiving end detects that the first falling edge occurs in the original communication data, the counter starts to perform counting, and then starts to perform data sampling.
S3, acquiring a data sampling signal; and selecting a data source from the second communication data and the fourth communication data based on the time sequence relation between the sampling time and the change detection signal time according to the sampling time of the sampling signal in the system time domain, and executing data sampling on the selected data source to obtain information corresponding to the original change signal.
Specifically, as shown in fig. 3, in the system clock domain, when the sampling time of detecting the sampling point is before the corresponding start time of the change detection signal and the sampling time is not within the duration of the change detection signal, the time difference between the time of the sampling point and the change signal in the second communication data is greater than the preset time interval X, that is, the time interval between the sampling point and the data change in the second communication data is greater, the second communication data is selected as a sampling data source to perform subsequent data sampling;
as shown in fig. 4, in the system clock domain, when the sampling time of the sampling point is detected to be located after the corresponding termination time of the change detection signal and the sampling time of the sampling point is not located within the duration range of the change detection signal, the time difference between the sampling point and the change signal in the second communication data is greater than the preset time interval X, and similarly, the second communication data is selected as a sampling data source to perform subsequent data sampling;
as shown in fig. 5, in the system clock domain, when the sampling time of the sampling point is detected to be within the duration range of the change detection signal, that is, when the sampling point is within the high level range of the change detection signal, the time interval between the sampling point and the data change in the second communication data is small, so that the data sampling is performed, which may cause errors in the synchronization process of the communication data; in order to avoid error generation in the synchronization process, the fourth communication data is selected as a sampling data source to carry out subsequent data sampling so as to ensure that a larger time interval exists between a sampling point and a data change point in the communication data; the data sampling process performed by using the fourth communication data as a data source is the same as the data sampling process performed by using the second communication data as a data source, and will not be described herein.
For a better understanding of the asynchronous communication data sampling method according to the present invention, the following description will be given by combining the method into an asynchronous communication process:
the receiving end is in an idle state after reset, and when the third communication data is changed into a low level, the receiving end switches the working state to an initial state to form a change detection signal; in the initial state, sampling the second communication data when the sampling time of the detected sampling point is outside the duration time of the change detection signal; if the sampling data is 1, indicating that the received start bit has an error, returning the working state of the receiving end to the original idle state, and re-executing the process, namely, the steps S1 to S3; if the sampling data is 0, the working state of the receiving end is changed into a data receiving state, each data bit in the communication data is received, whether the check bit is reached or not is judged through counting of a counter, when the check bit is reached, the sampling data on the check bit is detected, after the transmission is completed after the detection is complete, the working state of the receiving end is returned to an idle state, and the process is re-executed, namely, the steps S1 to S3 are carried out, so that asynchronous transmission of the communication data is realized.
Optionally, the asynchronous communication data sampling method further includes: after the data source is subjected to data sampling, detecting the quality of sampled data, and adjusting the size of each clock interval according to the detection result.
Specifically, after a plurality of times of data sampling are performed on the second communication data or the fourth communication data, obtaining each sampled data; acquiring a sampling error rate of a data sampling process based on the original communication data and the sampling data; and detecting whether the sampling error rate is greater than a preset error rate threshold, if so, increasing the first clock interval, the second clock interval and the third clock interval to improve the quality of the sampling data.
In a specific embodiment, the implementation manner for obtaining the sampling error rate of the data sampling process based on the original communication data and the sampling data includes: comparing each sampled data with the corresponding original communication data, extracting the sampled data which is different from the original communication data as error data, and calculating the duty ratio of the number of the error data in the total data of the sampled data so as to obtain the sampling error rate.
Example 2
In order to solve the technical problems existing in the prior art, the invention provides an asynchronous communication data sampling device in the embodiment; referring to fig. 6, a schematic diagram of the structure of the asynchronous communication data sampling device in the present embodiment is shown; as shown in fig. 6, the asynchronous communication data sampling apparatus 100 includes: a first communication data acquisition unit 101, a delay processing unit 102, an edge detection unit 103, a change detection signal construction unit 104, a sampling signal acquisition unit 105, a data source selection unit 106, and a data sampling unit 107;
wherein, the first communication data obtaining unit 101 is configured to synchronize original communication data to a clock domain;
the delay processing unit 102 is configured to perform successive delay processing on the first communication data, so as to sequentially obtain second communication data to fourth communication data;
optionally, the delay processing unit 102 includes: a clock interval determination sub-module and a delay sub-module;
the clock interval determining submodule is used for determining the sizes of a first clock interval, a second clock interval and a third clock interval respectively;
the delay sub-module is used for carrying out delay processing on the first communication data according to the first clock interval so as to obtain the second communication data; processing the second communication data according to a second clock interval delay to obtain the third communication data; and processing the third communication data according to a third clock interval delay to obtain the fourth communication data.
The edge detection unit 103 is configured to extract, when the original communication data detects an original change signal, a corresponding first communication data change signal and a corresponding third communication data change signal from the first communication data and the third communication data, respectively;
the change detection signal construction unit 104 is configured to construct a change detection signal according to the first communication data change signal and the third communication data change signal;
specifically, the implementation process of the change detection signal constructing unit 104 for constructing the change detection signal is the same as that of the embodiment 1, and will not be described herein.
The sampling signal acquisition unit 105 is configured to acquire a data sampling signal;
the data source selecting unit 106 is configured to select a data source from the second communication data and the fourth communication data according to a timing relationship between the data sampling signal and the change detecting signal;
further, the data source selection unit 106 includes a detection submodule and a selection submodule;
the detection sub-module is used for detecting whether the sampling time of the data sampling signal is in the continuous time range of the change detection signal or not, and obtaining a detection result; the selecting submodule is used for selecting the second communication data or the fourth communication data as the data source according to the detection result.
Optionally, the selecting submodule includes a level signal outputting submodule, configured to output different level signals according to the detection result obtained by the detecting submodule, so as to select the second communication data or the fourth communication data as the data source according to the different level signals.
For example, when the detection sub-module obtains a detection result as follows: the sampling time of the data sampling signal is in the continuous time range of the change detection signal, the level signal output submodule outputs a high level signal, and the fourth communication data is selected as the data source; when the detection sub-module obtains the detection result as follows: the sampling time of the data sampling signal is outside the continuous time range of the change detection signal, and the output level of the level signal output sub-module is 0, so that the second communication data is selected as the data source; optionally, at the end of the single data acquisition, the level signal output submodule outputs a low level signal, that is, the selected submodule is in an idle state.
In this embodiment, the data sampling unit 107 is configured to perform data sampling on the selected data source to obtain information corresponding to the original variation signal.
Optionally, the asynchronous communication data sampling device further includes:
and the clock interval adjusting unit is used for detecting the quality of sampled data after the data sampling of the data source is executed, and adjusting the sizes of the first clock interval, the second clock interval and the third clock interval according to the detection result.
The implementation manner of detecting the quality of the sampled data and adjusting the size of the clock interval according to the detection result is the same as that in embodiment 1, and will not be described herein.
Example 3
The invention provides an electronic device in embodiment 3 for implementing data sampling in an asynchronous communication process.
The electronic device includes: a processor, a memory, a communication interface, and a system bus; the memory and communication interface are coupled to the processor via the system bus and communicate with each other, the memory being configured to store at least one instruction that causes the processor to perform the steps of the asynchronous communication data sampling method as described in embodiment 1 above.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field programmable gate arrays (Field Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Example 4
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when invoked by a processor, implements the steps of the asynchronous communication data sampling method described in embodiment 1 above. The computer readable storage medium may include random access memory (Random Access Memory, RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
In summary, according to the method, the device, the equipment and the medium for sampling asynchronous communication data provided by the invention, the original communication data is subjected to multiple delay processing to obtain multiple communication data after sequential delay; extracting a data change signal in the communication data; in a system clock domain, detecting whether a current sampling point is positioned in a certain time range of a data change signal, and determining delay communication data sampled by a receiving end according to a detection result so as to realize a data communication process on the premise of ensuring the accuracy of data sampling; the method can directly acquire the baud rate based on the counting overflow rate, does not need to carry out frequency division processing on the counting overflow rate, can realize flexible configuration of the baud rate commonly used in data communication, can avoid the reduction of the communication transmission rate caused by larger frequency division coefficient, and can further improve the communication rate in asynchronous transmission.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. Accordingly, it is intended that all equivalent modifications and variations of the invention be covered by the claims, which are within the ordinary skill of the art, be within the spirit and scope of the present disclosure.

Claims (12)

1. A method for sampling asynchronous communication data, comprising:
synchronizing the original communication data to a system clock domain to obtain first communication data; performing successive delay processing on the first communication data to sequentially obtain second communication data, third communication data and fourth communication data;
when an original change signal is detected in the original communication data, respectively extracting corresponding first communication data change signals and third communication data change signals from the first communication data and the third communication data to construct a change detection signal based on the first communication data change signals and the third communication data change signals;
acquiring a data sampling signal; and selecting a data source from the second communication data and the fourth communication data based on the time sequence relation between the data sampling signal and the change detection signal, and executing data sampling on the selected data source to obtain information corresponding to the original change signal.
2. The method for sampling asynchronous communication data according to claim 1, wherein the performing successive delay processing on the first communication data sequentially obtains second communication data, third communication data, and fourth communication data, comprises:
processing the first communication data according to a first clock interval delay to obtain the second communication data;
processing the second communication data according to a second clock interval delay to obtain the third communication data; the method comprises the steps of,
and processing the third communication data according to a third clock interval delay to obtain the fourth communication data.
3. The method of asynchronous communication data sampling according to claim 2, wherein the first clock interval, the second clock interval, and the third clock interval each comprise any one integer number of clock signals from 2 to 5.
4. The asynchronous communication data sampling method according to claim 1, wherein the constructing a change detection signal based on the first communication data change signal and the third communication data change signal comprises:
setting the first communication data change signal as a start bit signal and the third communication data change signal as a stop bit signal to obtain the change detection signal.
5. The method of claim 1, wherein determining a data source in the second communication data and the fourth communication data based on a time distribution characteristic of the data sampling signal and the change detection signal comprises:
detecting whether the sampling time of the data sampling signal is positioned after the starting time of the change detection signal and before the ending time of the change detection signal, if so, selecting the fourth communication data as the data source; if not, selecting the second communication data as the data source.
6. The method for sampling asynchronous communication data according to claim 1, further comprising: after the data source is subjected to data sampling, detecting the quality of sampled data, and adjusting the sizes of the first clock interval, the second clock interval and the third clock interval according to the detection result.
7. An asynchronous communication data sampling device, comprising:
the first communication data acquisition unit is used for synchronizing the original communication data to the system clock domain so as to acquire the first communication data;
the delay processing unit is used for executing successive delay processing on the first communication data to sequentially obtain second communication data, third communication data and fourth communication data;
an edge detection unit, configured to extract, when an original change signal is detected in the original communication data, a corresponding first communication data change signal and a corresponding third communication data change signal from the first communication data and the third communication data, respectively;
a change detection signal construction unit configured to construct a change detection signal according to the first communication data change signal and the third communication data change signal;
a sampling signal acquisition unit for acquiring a data sampling signal;
a data source selecting unit, configured to select a data source from the second communication data and the fourth communication data according to a timing relationship between the data sampling signal and the change detecting signal;
and the data sampling unit is used for performing data sampling on the selected data source so as to obtain information corresponding to the original change signal.
8. The asynchronous communication data sampling device according to claim 7, wherein the delay processing unit comprises:
the clock interval determining submodule is used for setting the sizes of the first clock interval, the second clock interval and the third clock interval respectively;
a delay sub-module for processing the first communication data according to the first clock interval delay to obtain the second communication data; processing the second communication data according to a second clock interval delay to obtain the third communication data; and processing the third communication data according to a third clock interval delay to obtain the fourth communication data.
9. The asynchronous communication data sampling device according to claim 7, wherein the data source selection unit comprises:
the detection sub-module is used for detecting whether the sampling time of the data sampling signal is positioned after the starting time of the change detection signal and before the ending time of the change detection signal so as to obtain a detection result;
and the selecting submodule is used for selecting the second communication data or the fourth communication data as the data source according to the detection result.
10. The asynchronous communication data sampling device according to claim 7, comprising: the selected submodule comprises a level signal output submodule which is used for outputting different level signals according to the detection result obtained by the detection submodule so as to select the second communication data or the fourth communication data as the data source according to the different level signals.
11. An electronic device, comprising: a processor, a communication interface, a memory, and a communication bus; the processor, the communication interface and the memory complete communication with each other through the communication bus; the memory is used for storing at least one instruction; the instructions cause the processor to perform the asynchronous communication data sampling method of any one of claims 1 to 6.
12. A computer storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the asynchronous communication data sampling method according to any one of claims 1 to 6.
CN202111369269.3A 2021-11-15 2021-11-15 Asynchronous communication data sampling method, device, equipment and medium Pending CN116126766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111369269.3A CN116126766A (en) 2021-11-15 2021-11-15 Asynchronous communication data sampling method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111369269.3A CN116126766A (en) 2021-11-15 2021-11-15 Asynchronous communication data sampling method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116126766A true CN116126766A (en) 2023-05-16

Family

ID=86306844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111369269.3A Pending CN116126766A (en) 2021-11-15 2021-11-15 Asynchronous communication data sampling method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116126766A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980294A (en) * 2023-06-28 2023-10-31 深圳精控集成半导体有限公司 Communication data receiving method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980294A (en) * 2023-06-28 2023-10-31 深圳精控集成半导体有限公司 Communication data receiving method and device, electronic equipment and storage medium
CN116980294B (en) * 2023-06-28 2024-04-30 深圳精控集成半导体有限公司 Communication data receiving method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109387776B (en) Method of measuring clock jitter, clock jitter measuring circuit, and semiconductor device
US7287105B1 (en) Asynchronous-mode sync FIFO having automatic lookahead and deterministic tester operation
US8386828B1 (en) Circuit for estimating latency through a FIFO buffer
CN109254941B (en) FPGA-based serial signal clock synchronization method, serial-to-parallel conversion method and device
CN101719858B (en) Synchronous processing method of bit timing of control area network (CAN) controller
CN115656776A (en) Delay deviation measuring method and device of digital channel and electronic device
CN116126766A (en) Asynchronous communication data sampling method, device, equipment and medium
CN109104763A (en) Synchronization signal control method and device
CN116338434A (en) Average power consumption measuring method and device
CN113204514B (en) Method for improving SPI interface frequency of chip
CN102651685B (en) Signal delay device and method
CN111446960B (en) Clock output circuit
CN114201276A (en) FIFO interrupt management based method
CN111641490B (en) High-precision phase calibration and time reference determination method for sampling clock
EP4227758A1 (en) Low overhead mesochronous digital interface
CN103714012B (en) Data processing method and device
WO2018002717A1 (en) Signal processing apparatus and method, and electronic device comprising the apparatus
US11054458B2 (en) Method and device for detecting faults in a transmission line
TWI668453B (en) Circuit and method for measuring signal period
Casparsen et al. Bluetooth Low Energy with Software-Defined Radio: Proof-of-Concept and Performance Analysis
CN102332975A (en) Method and device for self-adaptively sampling interface
CN116671193B (en) Sampling method, sampling circuit and clock synchronization method of distributed network
CN111208867B (en) DDR (double data Rate) read data integer clock cycle-based synchronization circuit and synchronization method
CN103677081A (en) Processing method and processing device for data signals
CN117092580A (en) Electric energy pulse output method and device for electric energy metering chip

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