Asynchronous transmission device
By introducing a configuration module into the asynchronous transmission device and adjusting the baud rate of asynchronous transmission, the problem of low transmission rate of traditional UART is solved, high-speed data transmission is achieved, and it is suitable for high-speed communication scenarios.
Patent Information
- Application Number
- CN202111617907.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-27
AI Technical Summary
The transmission rate of traditional UART is low and is affected by the distance between the sending and receiving lines, making it difficult to meet high-speed communication needs.
Design an asynchronous transmission device that combines the main control module and the configuration module, configures the baud rate of asynchronous transmission through the transmission bus, and adjusts the baud rate of the data sending module and data receiving module, thereby increasing the transmission rate. The device includes a clock generation module, an asynchronous management module and a cache module. Data transmission is in frames, and the frame interval is not less than the preset time. The main control module configures the clock frequency and frequency division coefficient through the transmission bus to realize the baud rate. Flexible adjustment.
The transmission rate of the asynchronous transmission device is significantly improved, and the maximum data transmission rate can reach more than 16Mbps, which reduces the interrupt response load of the main control module and is suitable for high-speed data transmission scenarios.
Smart Images

Figure CN114356816B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic information technology, and in particular to an asynchronous transmission device. Background Art
[0002] UART (Universal Asynchronous Receiver / Transmitter) is a general term for asynchronous serial communication ports. UART is usually integrated into the connection of other communication interfaces, and is physically manifested as an independent modular chip or as a peripheral device integrated into a microprocessor. In microcontrollers, the speed at which UART transmits data ranges from a few hundred bits per second to 1.5Mb; in embedded designs, UART is used for communication between the host and auxiliary devices. For example, when embedded in the ElanSC520 microcontroller, the communication speed can be as high as 1.152Mbps.
[0003] However, the transmission rate of conventional UART is low and is also affected by the distance of the sending and receiving lines. Summary of the invention
[0004] The main technical problem solved by the present application is to provide an asynchronous transmission device, which can adjust the baud rate of the asynchronous transmission device, thereby facilitating improving the transmission rate of the asynchronous transmission device.
[0005] In order to solve the above technical problems, the present application provides an asynchronous transmission device, which includes: a main control module and a transmission bus connected to each other; a data sending module and a data receiving module, which are respectively connected to the transmission bus through a data interface to transmit and receive data through the transmission bus; a configuration module, including a configuration input end and a configuration output end, the configuration input end is connected to the transmission bus through the configuration interface, and the configuration output end is respectively connected to the data sending module and the data receiving module; wherein the main control module configures the baud rate of the asynchronous transmission through the transmission bus.
[0006] Among them, the configuration module includes: a clock generation module, including a first configuration input terminal and a first configuration output terminal, and the first configuration input terminal is connected to the transmission bus through a configuration interface, the first configuration output terminal is respectively connected to the data sending module and the data receiving module, and the main control module configures the clock frequency through the transmission bus; an asynchronous management module, including a second configuration input terminal and a second configuration output terminal, and the second configuration input terminal is connected to the transmission bus through a configuration interface, the second configuration output terminal is respectively connected to the data sending module and the data receiving module, and the main control module configures the division coefficient and the multiplication coefficient through the transmission bus.
[0007] Among them, the asynchronous transmission device also includes a cache module, and the cache module is connected to the transmission bus; wherein, the data receiving module and / or the data sending module exchanges data with the cache module through the transmission bus in frames, and each frame of data includes at least one byte, there is a frame interval between adjacent frames, and the duration of the frame interval is not less than a preset duration.
[0008] The preset duration is based on the baud rate configuration, and the preset duration is not shorter than the duration of one frame of data.
[0009] The data receiving module is used to encapsulate a number of frame data based on the total number of received bytes and cache them in the cache module when the interval between the current time and the reception time of the latest byte is not less than a preset time.
[0010] Among them, the data receiving module encapsulates several frame data based on the preset maximum frame length and the total number; wherein, when the total number is not greater than the preset maximum frame length, the data receiving module is used to encapsulate the received bytes into one frame data, and set the frame length register in the configuration module to the total number; when the total number is greater than the preset maximum frame length, the data receiving module is used to encapsulate the received bytes into multiple frames of data according to the preset maximum frame length, and set the frame length register in the configuration module to the preset maximum frame length.
[0011] Among them, the data receiving module includes an asynchronous receiving module, a data reassembly module and a first cache module connected in sequence; among them, the asynchronous receiving module is used to obtain bytes, the data reassembly module is used to encapsulate and reassemble the received bytes to obtain several frames of data, and the first cache module is used to cache several frames of data.
[0012] The asynchronous receiving module includes a receiving unit, a receiving state unit, a first checking unit and a data output unit which are connected in sequence, and the receiving state unit and the first checking unit jointly control obtaining a signal from the interface unit.
[0013] The data sending module is used to take out each frame of data from the cache module, split each frame of data into bytes for transmission, and wait for the length of the frame interval before sending the next frame of data when the current frame of data is sent.
[0014] Among them, the data sending module includes a second cache module, a data splitting module and an asynchronous sending module connected in sequence; among them, the second cache module is used to cache each frame data, the data splitting module is used to pull a number of bytes from the second cache module based on the bit width of the second cache module, and the asynchronous sending module is used to send each byte.
[0015] The asynchronous transmission module includes a data input unit, a second verification unit, a transmission state unit and a transmission unit connected in sequence, wherein the transmission state unit and the second verification unit jointly control the transmission of signals to the transmission unit.
[0016] The data receiving module collects a preset value of level signals in each data bit period, and determines the final level of the corresponding data bit period based on the respective proportions of high level and low level in the preset value of level signals.
[0017] Among them, the data sending module, data receiving module and configuration module are IP cores.
[0018] Among them, the asynchronous transmission device is implemented by a programmable system chip, and the data sending module, data receiving module and configuration module are implemented by the programmable logic part of the programmable system chip, the main control module is implemented by the processing system part of the programmable system chip, and the transmission bus is implemented by the on-chip bus of the programmable system chip.
[0019] In the above scheme, the main control module realizes data interaction with the data sending module and the data receiving module through the transmission bus. By setting a configuration module in the asynchronous transmission device, the main control module can configure the baud rate of the asynchronous transmission through the configuration module, thereby adjusting the baud rate of the asynchronous transmission device, and further regulating the transmission rate of the asynchronous transmission device. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a structural diagram of an embodiment of an asynchronous transmission device provided by the present application;
[0021] Figure 2 It is a structural diagram of an embodiment of an asynchronous receiving module provided by the present application;
[0022] Figure 3 It is a schematic diagram of an embodiment of an asynchronous transmission data format provided by the present application;
[0023] Figure 4 It is a schematic diagram of an embodiment of a data stream received by a data receiving module provided in the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] It should be noted that if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0026] See also Figure 1 , Figure 1 1 is a schematic diagram of the structure of an embodiment of an asynchronous transmission device provided by the present application. The asynchronous transmission device 100 includes a main control module 10, a transmission bus 20, a data sending module 30, a data receiving module 40 and a configuration module 50. The main control module 10 and the transmission bus 20 are connected to each other, and the data sending module 30 and the data receiving module 40 are connected to the transmission bus 20 through a data interface 60, so that the main control module 10 can realize data intercommunication with the data sending module 30 and the data receiving module 40 through the transmission bus 20. The configuration module 50 includes a configuration input terminal 51 and a configuration output terminal 52. The configuration input terminal 51 is connected to the transmission bus 20 through the configuration interface 70. Since the transmission bus 20 is connected to the main control module 10, the main control module 10 can perform parameter configuration on the configuration module 50 through the transmission bus 20. The specific configuration parameters are not limited and can be specifically set according to actual use needs. For example, the main control module 10 configures the clock frequency, division coefficient or multiplication coefficient through the transmission bus 20; the configuration output terminal 52 is respectively connected to the data sending module 30 and the data receiving module 40, so that the main control module 10 configures the working mode of the data sending module 30 and the data receiving module 40 through the transmission bus 20 or monitors the working status of the data sending module 30 and the data receiving module 40.
[0027] Among them, in this embodiment, the main control module 10 configures the baud rate of asynchronous transmission through the transmission bus 20. That is to say, the setting of the configuration module 50 enables the main control module 10 to configure the parameters of the configuration module 50 through the transmission bus 20, thereby realizing the control of the baud rate of the transmission of the data sending module 30 and the data receiving module 40, so that the asynchronous transmission device 100 can be configured to any different baud rate. For example, when the data transmission rate of the data sending module 30 and the data receiving module 40 is too low, the main control module 10 can be used to control the baud rate of the data sending module 30 and the data receiving module 40 through the transmission bus 20 to increase, thereby increasing the data transmission rate of the data sending module 30 and the data receiving module 40, so that the data sending module 30 and the data receiving module 40 can be used to transmit data at high speed (for example, it can be used in application scenarios with a baud rate of more than 1MB).
[0028] In one embodiment, the main control module 10 may include but is not limited to an ARM (Advanced RISC-Machines) processor, etc. The ARM processor has small size, low power consumption, low cost and excellent performance.
[0029] In one embodiment, the transmission bus 20 may include but is not limited to AXI (i.e., Advanced eXtensible Interface), etc., which is not limited here. In one embodiment, the data interface 60 may include but is not limited to AXI-HP interface, etc., which is not limited here. In addition, the configuration interface 70 may include but is not limited to AXI-Lite interface, etc., which is not limited here.
[0030] Please continue reading Figure 1In one embodiment, the configuration module 50 includes a clock generation module 53 and an asynchronous management module 54. The clock generation module 53 includes a first configuration input terminal 531 and a first configuration output terminal 532, and the first configuration input terminal 531 is connected to the transmission bus 20 through the configuration interface 70, and the first configuration output terminal 532 is respectively connected to the data sending module 30 and the data receiving module 40, so that the main control module 10 can configure the clock generation module 53 through the transmission bus 20 to configure any clock frequency. Among them, the size of the clock frequency is not adjusted, and it can be specifically configured according to actual use needs, for example, it is configured to a clock frequency of 48MHz. The asynchronous management module 54 includes a second configuration input terminal 541 and a second configuration output terminal 542, and the second configuration input terminal 541 is connected to the transmission bus 20 through the configuration interface 70, and the second configuration output terminal 542 is respectively connected to the data sending module 30 and the data receiving module 40, so that the main control module 10 configures the asynchronous management module 54 through the transmission bus 20 to configure the frequency division coefficient and the frequency multiplication coefficient. The frequency division coefficient and the frequency multiplication coefficient are not set, and can be specifically configured according to actual use needs, for example, the frequency division coefficient and the frequency multiplication coefficient are configured to be 16. In other words, the main control module 10 can adjust the clock frequency, the frequency division coefficient and the frequency multiplication coefficient through the transmission bus 20, and the user can flexibly adjust the clock frequency, the frequency division coefficient and the frequency multiplication coefficient according to needs.
[0031] In a specific embodiment, baud rate = clock frequency / frequency division coefficient × frequency multiplication coefficient, the main control module 10 can adjust the clock frequency, frequency division coefficient and frequency multiplication coefficient through the transmission bus 20, thereby adjusting the baud rate of the data sending module 30 and the data receiving module 40, and then adjusting the data transmission rate of the data sending module 30 and the data receiving module 40. The clock frequency of the traditional UART transceiver module is low, so that its data transmission rate is low. Compared with the traditional UART transceiver module, the baud rate of the data receiving module 40 and the data sending module 30 of the present application is larger and can be flexibly adjusted. In a specific embodiment, the maximum data transmission rate of the data sending module 30 and the data receiving module 40 can reach more than 16Mbps, and its maximum data transmission rate is limited by the maximum clock frequency of the current clock generation module 53.
[0032] In one embodiment, the clock generation module 53 may include, but is not limited to, PLL (Phase Locked Loop), MMCM (Mixed-Mode Clock Manager), etc., which are not limited here. The working principle of the clock generation module 53 can refer to relevant technical details such as PLL, MMCM, etc., and the words are not repeated here.
[0033] Please continue reading Figure 1In one embodiment, the asynchronous transmission device 100 further includes a cache module 80, which is connected to the transmission bus 20; wherein the data receiving module 40 exchanges data with the cache module 80 through the transmission bus 20 in units of frames. After receiving a frame unit of data, the data receiving module 40 will generate an interrupt and cache the data in the cache module 80, and the main control module 10 will respond to the interrupt and take out the corresponding data from the cache module 80 to facilitate subsequent data processing. Since the traditional UART transceiver module exchanges data with the cache module 80 through the transmission bus 20 in units of bytes, interrupts will be generated frequently, so that the main control module 10 needs to respond to these interrupts frequently, resulting in an overload of the main control module 10; for example, taking the data receiving rate of the data receiving module 40 as 4Mbps, an interrupt will be generated every 4μs, so that the main control module 10 has to respond to an interrupt every 4μs. Therefore, compared with the traditional UART transceiver module, exchanging data with the cache module 80 via the transmission bus 20 in frames can greatly reduce the interrupt response time of the main control module 10, avoid the main control module 10 from frequently responding to these interrupts, and reduce the load of the main control module 10. In a specific embodiment, the cache module 80 may include but is not limited to DDR (Double Data Rate), such as DDR3, DDR4, etc., which are not limited here.
[0034] It can be understood that in other embodiments, the data sending module 30 can also exchange data with the cache module 80 through the transmission bus 20 in frames, or the data sending module 30 and the data receiving module 40 can simultaneously exchange data through the transmission bus 20 in frames. No specific limitation is made here and it can be specifically set according to actual usage needs.
[0035] Each frame of data includes at least one byte, there is a frame interval between adjacent frames, and the duration of the frame interval is not less than the preset duration. The data receiving module 40 receives data in frames, and a frame interval is set between two adjacent frames of data, that is, a timeout mechanism. After the data receiving module 40 receives the current frame of data, it will wait for at least one frame interval time before transmitting the next frame of data, that is, after the data receiving module 40 receives the current frame of data, the idle state will continue for at least one frame interval time before transmitting the next frame of data; similarly, when the data sending module 30 sends data in frames, after the data sending module 30 sends the current frame of data, it will wait for at least one frame interval time before sending the next frame of data.
[0036] Optionally, the length of each frame of data, i.e., the number of bytes included in each frame of data, and the preset duration are not limited, and can be specifically set according to actual use needs. In one embodiment, the preset duration can be a default value, such as setting the preset duration to 150 μs. In other embodiments, the preset duration is set based on the baud rate, and the preset duration is not shorter than the duration of a frame of data, wherein the duration of a frame of data is not limited, and can be specifically set according to the baud rate. For example, when the baud rate is large, the duration of a frame of data is relatively set to be smaller, and when the baud rate is small, the duration of a frame of data is relatively set to be larger.
[0037] Please continue reading Figure 1 In one embodiment, the data receiving module 40 is used to encapsulate a number of frame data based on the total number of bytes received when the interval between the current time and the time when the latest byte is received is not less than the preset time, and cache it in the value cache module 80. That is to say, during the idle waiting time of the data receiving module 40, the frame data will not continue to be transmitted, but data in single-byte units will be received, and a number of frame data will be encapsulated based on the total number of bytes received within the interval, and the number of frame data will be cached in the value cache module 80; when the data receiving module 40 caches a number of frame data in the cache module 80, an interrupt will be generated, specifically, the data receiving module 40 caches the data in a certain cache space of the cache module 80 in units of frames through the data interface 60, and an interrupt will be generated at this time to notify the main control module 10, and the main control module will respond to this interrupt and take out the corresponding frame data from the cache module 80 to facilitate subsequent data processing.
[0038] In a specific embodiment, the data receiving module 40 encapsulates a plurality of frame data based on a preset maximum frame length and a total number; wherein, when the total number is not greater than the preset frame length, the data receiving module 40 is used to encapsulate the received bytes into one frame of data, and sets the frame length register in the configuration module 80 to the total number; for example, the preset frame length is 1024 bytes, and when the interval between the current moment and the reception moment of the latest byte of the data receiving module 40 is not less than the preset duration, the total number of received bytes is 1023, so the data receiving module 40 encapsulates the received 1023 bytes into one frame of data, and sets the frame length register value in the configuration module 50 to 1023. When the total number is greater than the preset maximum frame length, the data receiving module 40 is used to encapsulate the received bytes into multiple frames of data according to the preset maximum frame length, and set the frame length register in the configuration module 50 to the preset maximum frame length; for example, the preset frame length is 1024 bytes, and when the interval between the current moment and the reception moment of the latest byte of the data receiving module 40 is not less than the preset length, the total number of received bytes is 1028, so the data receiving module 40 encapsulates the first 1024 bytes into one frame of data, and automatically divides the received bytes exceeding 1024 into frames as the next frame of data. At this time, the frame length register value in the configuration module 50 is set to 1024.
[0039] Please continue reading Figure 1 In one embodiment, the data receiving module 40 includes an asynchronous receiving module 41, a data reassembly module 42 and a first buffer module 43 which are connected in sequence. The asynchronous receiving module 41 is used to obtain byte data, the data reassembly module 42 is used to encapsulate and reassemble the received bytes to obtain a number of frame data, and the first buffer module 43 is used to cache a number of frame data. Specifically, the asynchronous receiving module 41 transmits the byte data to the data reassembly module 42 after receiving the byte data; when the interval between the current time and the receiving time of the latest byte is not less than the preset time, the data reassembly module 42 encapsulates a number of frame data based on the total number of received bytes and transmits it to the first buffer module 43; the first buffer module 43 caches the received frame data, and when the first buffer module 43 caches the first frame data, an interrupt is generated and the frame data is cached to the buffer module 80 through the transmission bus 20 to notify the main control module 10, and the main control module 10 responds to the interrupt and takes out the corresponding frame data from the buffer module 80 to facilitate the subsequent processing of the frame data.
[0040] In one embodiment, the first buffer module 43 may include, but is not limited to: FIFO (First Input First Output) memory, etc. The FIFO memory has large capacity, small size and low price, and has the characteristics of flexibility, convenience and high efficiency, and is suitable for high-speed data acquisition, high-speed data processing, high-speed data transmission, etc. In a specific embodiment, the data receiving module 40 may include two first buffer modules 43, one first buffer module 43 is used to exchange a number of frames of data, and the other first buffer module 43 is used to cache the length of a frame of data.
[0041] In one embodiment, in order to fully utilize the bandwidth of the transmission bus 20 and avoid wasting resources, a frame of data can be gradually cached in the cache module 80 in units of 8 bytes. Since the bit width of the AXI-HP port of the transmission bus 20 is 64 bits, a frame of data cannot be cached in the cache module 80 at the same time, but caching a frame of data in units of one byte in the cache module 80 will cause a waste of bandwidth of the transmission bus 20 and a slow cache speed. Therefore, in this embodiment, 8 bytes of data are spliced into 1 64-bit data, so that a frame of data is gradually cached in the cache module 80.
[0042] See also Figure 2 , Figure 21 is a schematic diagram of the structure of an embodiment of an asynchronous receiving module provided by the present application. In one embodiment, the asynchronous receiving module 41 includes a receiving unit, a receiving state unit, a first checking unit and a data output unit connected in sequence. The receiving state unit and the first checking unit jointly control the acquisition of signals from the interface unit. Specifically, since some level signals may indicate a start state or an end state, the level signal cannot be transmitted to the asynchronous transmission device 100 as valid data, so the receiving state unit will check the level signal. If the level signal is in an error state (for example, a start state or an end state, etc.), the previously received data is cleared, and the first checking unit or other modules are notified that the previous data is incorrect and no further transmission is required, thereby realizing that the receiving unit and the receiving state unit jointly control the acquisition of the level signal from the receiving unit; the first checking unit is configured as odd check by default, and can also be set to even check as needed to check the correctness of the data transmitted to the first checking unit, and after the check is correct, the data is transmitted to the data output unit, so that the subsequent main control module 10 can obtain the data. In a specific embodiment, when the first check unit detects that the data is erroneous, the main control module 10 is notified to inform the main control module 10 that an 8-bit data is erroneous. In other specific embodiments, each 8-bit data may be numbered, for example, the first 8-bit data is marked as 1, the second 8-bit data is marked as 2, etc., and when the main control module 10 does not receive the 8-bit data marked as 2 subsequently, it is determined that the 8-bit data marked as 2 is erroneous. In other embodiments, after the main control module 10 determines that the erroneous 8-bit data corresponds to the number, the main control module 10 may be notified to retransmit the 8-bit data.
[0043] See also Figure 3 , Figure 3 1 is a schematic diagram of an embodiment of the asynchronous transmission data format provided by the present application. In one embodiment, the receiving unit of the asynchronous receiving module 41 is mainly implemented around the receiving state unit, and the clock used is 16 times the current baud rate, that is, 16 times sampling. In other embodiments, the baud rate can also be adjusted by the main control module 10.
[0044] Please continue reading Figure 1In one embodiment, the data sending module 30 exchanges data with the cache module 80 through the transmission bus 20 in units of frames. The data sending module 30 is used to take out each frame of data from the cache module 80, split each frame of data into bytes for output, and wait for the length of the frame interval before sending the next frame of data when the current frame of data is sent. In other words, the data sending module 30 will not continue to send frame data during the frame interval, but will wait for the length of the frame interval before sending the next frame of data. Specifically, the main control module 10 will cache the frame data to be sent to a certain cache space of the cache module 80, and then notify the data sending module 30. At this time, the data sending module 30 will take out each frame of data from the cache module 80, split each frame of data into bytes, and output data in bytes.
[0045] In one embodiment, the data transmission module 30 includes a second cache module 31, a data splitting module 32 and an asynchronous transmission module 33 connected in sequence. The second cache module 31 is used to cache each frame of data; the data splitting module 32 is used to pull a number of bytes of data from the second cache module 31 based on the bit width of the second cache module 31; and the asynchronous transmission module 33 is used to send each byte of data. In a specific embodiment, the second cache module 31 takes out and caches each frame of data from the cache module 80, and then transmits it to the data splitting module 32; the data splitting module 32 pulls a number of bytes of data from the second cache module 31 according to the bit width of the second cache module 31, for example, if the bit width of the second cache module 31 is 64 bits, then 8 bytes of data are pulled from the second cache module 31; the asynchronous transmission module 33 transmits each byte of data pulled out, and after the transmission of each byte of data pulled out is completed, it pulls a number of bytes of data from the data splitting module 32.
[0046] It can be understood that in other specific embodiments, the second cache module 31 takes out and caches each frame data from the cache module 80, and then transmits it to the data splitting module 32; the data splitting module 32 splits each frame data into single byte data; the asynchronous sending module 33 transmits each byte data until the transmission is completed.
[0047] In one embodiment, the second buffer module 31 may include but is not limited to: FIFO (First Input First Output) memory, etc. The FIFO memory has large capacity, small size and low price, and has the characteristics of flexibility, convenience and high efficiency, and is suitable for high-speed data acquisition, high-speed data processing, high-speed data transmission, etc. In a specific embodiment, the data transmission module 30 may include two second buffer modules 31, one second buffer module 31 is used to buffer a number of frames of data, and the other second buffer module 31 is used to buffer the length of a frame of data, realizing the clock domain AXI-CLK to sys - clk conversion.
[0048] Please continue reading Figure 2 In one embodiment, the asynchronous transmission module 33 includes a data input unit, a second check unit, a transmission state unit and a transmission unit connected in sequence, and the transmission state unit and the second check unit jointly control the transmission of signals to the transmission unit. Specifically, the data input unit receives data and transmits it to the second check unit; the second check unit is configured as odd check by default, and can also be configured as even check as needed to check the correctness of the data transmitted to the second check unit, and transmits the data to the transmission state unit after the check is correct. Since some level signals may indicate a start state or an end state, this level signal cannot be transmitted as valid data, so the transmission state unit will check the level signal. If the level signal is an error state (for example, a start state or an end state, etc.), the previously received data is cleared, and the second check unit and other modules are notified that the previous data is wrong and no further transmission is required, thereby realizing the second check unit and the transmission state unit jointly controlling the transmission of signals to the transmission unit. In a specific embodiment, when the second check unit detects that the data is wrong, it will notify the main control module 10 to inform the main control module 10 that there is an 8-bit data error. In other specific implementations, each 8-bit data may be numbered, for example, the first 8-bit data is marked as 1, the second 8-bit data is marked as 2, etc. When the sending unit does not receive the 8-bit data marked as 2, it is determined that the 8-bit data marked as 2 is erroneous. In other implementations, after the sending unit determines that the erroneous 8-bit data corresponds to the number, it may notify the asynchronous sending module 33 to retransmit the 8-bit data.
[0049] Please continue reading Figure 3 In one embodiment, the sending unit of the asynchronous sending module 33 is mainly implemented around the sending state unit, and the clock used is 16 times the current baud rate, that is, 16 times sampling. In other embodiments, the baud rate can also be adjusted by the main control module 10. Among them, the baud rates of the asynchronous receiving module 41 and the asynchronous sending module 33 are consistent.
[0050] See also Figure 4 , Figure 4 1 is a schematic diagram of an embodiment of a data stream received by a data receiving module provided by the present application. In one embodiment, the data receiving module 40 collects a preset value of level signals in each data bit period, and determines the final level of the corresponding data bit period according to the respective proportions of high level and low level in the preset value of level signals. The size of the preset value is not limited and can be specifically set according to actual use needs. For example, the preset value is 16. For example, Figure 3As shown, taking the preset value of 16 as an example, the asynchronous receiving module 41 of the data receiving module 40 will monitor at all times. When a low level is detected, it indicates that data transmission has started. When the data receiving module 40 collects 16 level signals, the values of the high level and the low level in the level signal are counted. If the proportion of the high level in the 16 level signals is greater than the proportion of the low level, for example, 9 collected data are 1 and 7 collected data are 0, it means that the received data bit is 1, that is, the final level of the data bit period is a high level; and if the proportion of the high level in the 16 level signals is lower than the proportion of the low level, for example, 9 collected data are all 0 and 7 collected data are 1, it means that the received data bit is 0, that is, the final level of the data bit period is a low level. The data receiving module 40 adopts a voting mechanism of "minority obeys majority", regardless of the distribution of the level, but takes the level with a large proportion as the current level, thereby improving the fault tolerance of the data, reducing the high bit error rate caused by the cable long-distance transmission signal loss and high-speed signal reflection, that is, improving the bit error resistance.
[0051] In one implementation scenario, the data sending module 30, the data receiving module 40 and the configuration module 50 are IP cores (i.e., intellectual property cores), and thus can be authorized for use.
[0052] In one implementation scenario, the asynchronous transmission device 100 is implemented by a programmable system on chip (PSOC), and the data transmission module 30, the data receiving module 40 and the configuration module 50 are implemented by the programmable logic (PL) part of the programmable system on chip, the main control module 10 is implemented by the processing system (PS) part of the programmable system on chip, and the transmission bus 20 is implemented by the on-chip bus of the programmable system on chip. Exemplarily, the on-chip bus may include but is not limited to AXI, etc., which is not limited here. Therefore, through the high-end processor on the PS side (such as a dual-core ARM cortex A9 core), complex voice processing algorithms such as voice recognition, synthesis, enhancement, and data exchange of multi-member dialogues can be supported, which is conducive to improving versatility and flexibility. In addition, since the PSOC platform usually has a wealth of interfaces, such as network port, USB (Universal Serial Bus), serial port, CAN (Controller Area Network), PCIE (Peripheral Component Interconnect Express, high-speed serial computer expansion bus standard), SRIO (Serial Rapid I / O), etc., it can be applied to different scenarios, that is, it can be used as a plug-in card or as an independent board with special functions.
[0053] In a specific implementation scenario, the asynchronous transmission device 100 can be implemented based on a Xilinx core board, whose size does not exceed 40mm*35mm, and can realize 5 16-way I2S IP core functions. The hardware cost of the core board is relatively low, so it is beneficial to reduce hardware costs, while reducing hardware size and hardware power consumption.
[0054] In a specific implementation scenario, the above IP core can also be implemented in any FPGA (Field Programmable Gate Array), or can also be embedded in a general-purpose processor as a dedicated hard core tape-out.
[0055] Different from the prior art, the present application provides an asynchronous transmission device, which includes: a main control module and a transmission bus connected to each other; a data sending module and a data receiving module, which are respectively connected to the transmission bus through a data interface to transmit and receive data through the transmission bus; a configuration module, including a configuration input end and a configuration output end, the configuration input end is connected to the transmission bus through a configuration interface, and the configuration output end is respectively connected to the data sending module and the data receiving module; wherein the main control module configures the baud rate of asynchronous transmission through the transmission bus. The main control module realizes data interaction with the data sending module and the data receiving module through the transmission bus, and by setting the configuration module in the asynchronous transmission device, the main control module can configure the baud rate of asynchronous transmission through the configuration module, thereby adjusting the baud rate of the asynchronous transmission device, and then regulating the transmission rate of the asynchronous transmission device.
[0056] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An asynchronous transmission device, characterized in that: include: Interconnected master control modules and transmission buses; A data sending module and a data receiving module are respectively connected to the transmission bus through a data interface to transmit and receive data through the transmission bus; A configuration module, comprising a clock generation module and an asynchronous management module, wherein the clock generation module comprises a first configuration input terminal and a first configuration output terminal, and the first configuration input terminal is connected to the transmission bus through a configuration interface, and the first configuration output terminal is respectively connected to the data sending module and the data receiving module, and the main control module configures the clock frequency through the transmission bus, and the asynchronous management module comprises a second configuration input terminal and a second configuration output terminal, and the second configuration input terminal is connected to the transmission bus through the configuration interface, and the second configuration output terminal is respectively connected to the data sending module and the data receiving module, and the main control module configures the frequency division coefficient and the frequency multiplication coefficient through the transmission bus; The main control module configures the baud rate of the asynchronous transmission through the transmission bus, and the baud rate=clock frequency / division coefficient×multiplication coefficient.
2. The device according to claim 1, characterized in that The asynchronous transmission device further comprises a cache module, and the cache module is connected to the transmission bus; The data receiving module and / or the data sending module exchanges data with the cache module through the transmission bus in frames, and each frame of data includes at least one byte. There is a frame interval between adjacent frames, and the duration of the frame interval is not less than a preset duration.
3. The device according to claim 2, characterized in that The preset duration is configured based on the baud rate, and the preset duration is not shorter than the duration of a frame of data.
4. The device according to claim 2, characterized in that The data receiving module is used to encapsulate a number of frame data based on the total number of bytes received and cache them in the cache module when the interval between the current time and the latest reception time of the byte is not less than the preset time.
5. The device according to claim 4, characterized in that The data receiving module obtains the plurality of frames of data based on a preset maximum frame length and the total number of encapsulations; Among them, when the total number is not greater than the preset maximum frame length, the data receiving module is used to encapsulate the received bytes into one frame of data, and set the frame length register in the configuration module to the total number; when the total number is greater than the preset maximum frame length, the data receiving module is used to encapsulate the received bytes into multiple frames of data according to the preset maximum frame length, and set the frame length register in the configuration module to the preset maximum frame length.
6. The device according to claim 4, characterized in that The data receiving module comprises an asynchronous receiving module, a data reassembly module and a first buffer module which are connected in sequence; The asynchronous receiving module is used to obtain the bytes, the data reassembly module is used to encapsulate and reassemble the received bytes to obtain the plurality of frames of data, and the first buffer module is used to buffer the plurality of frames of data.
7. The device according to claim 6, characterized in that The asynchronous receiving module includes a receiving unit, a receiving state unit, a first checking unit and a data output unit which are connected in sequence, and the receiving state unit and the first checking unit jointly control obtaining a signal from the receiving unit.
8. The device according to claim 2, characterized in that The data sending module is used to take out each frame of data from the cache module, split each frame of data into bytes for transmission, and wait for the length of the frame interval before sending the next frame of data when the current frame of data is completely sent.
9. The device according to claim 8, characterized in that The data sending module includes a second buffer module, a data splitting module and an asynchronous sending module which are connected in sequence; The second cache module is used to cache each frame of data, the data splitting module is used to pull a number of bytes from the second cache module based on the bit width of the second cache module, and the asynchronous sending module is used to send each of the bytes.
10. The device according to claim 9, characterized in that The asynchronous transmission module includes a data input unit, a second verification unit, a transmission state unit and a transmission unit which are connected in sequence, wherein the transmission state unit and the second verification unit jointly control the transmission of a signal to the transmission unit.
11. The device according to claim 1, characterized in that The data receiving module collects a preset value of level signals in each data bit period, and determines a final level corresponding to the data bit period based on the respective proportions of high level and low level in the preset value of the level signals.
12. The device according to claim 1, characterized in that The data sending module, the data receiving module and the configuration module are IP cores.
13. The device according to claim 1, characterized in that The asynchronous transmission device is implemented by a programmable system chip, and the data sending module, the data receiving module and the configuration module are implemented by the programmable logic part of the programmable system chip, the main control module is implemented by the processing system part of the programmable system chip, and the transmission bus is implemented by the on-chip bus of the programmable system chip.
