A device and method for collecting data at low frequency
By using a combination of clock frequency upscaling module, clock frequency division module, data synchronization module and data acquisition module in the data acquisition device, low-multiple frequency data acquisition is achieved, solving the bit error problem in asynchronous data acquisition, reducing costs and simplifying The circuit design ensures the normal operation of the system.
Patent Information
- Application Number
- CN202011534716.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-12-23
AI Technical Summary
In the existing technology, during the asynchronous data acquisition process, bit errors are caused by data width delays between different chips or systems and jitter of chip pins, which affects the normal operation of subsequent chips or systems, and it is expensive and expensive to use high-frequency PLL to process data. Circuit timing closure is difficult.
A device that collects data at a low multiplier is used, including a clock frequency upscaling module, a clock frequency division module, a data synchronization module and a data acquisition module. Through the setting of 2 multiplication and 2 frequency division, the synchronization flag is adjusted according to the data bit level width to achieve Data acquisition avoids the use of high frequency PLL.
It effectively reduces costs, simplifies circuit timing closure, and ensures the accuracy of data collection and the normal operation of subsequent systems.
Smart Images

Figure CN113204262B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of digital information application, and in particular relates to a device and method for collecting data at a low frequency. Background Art
[0002] With the development of digital information technology, asynchronous data acquisition and processing can be seen everywhere, especially between different chips or systems, the width of the data sent through the line delay and the conversion of the chip pins have serious jitter, which will lead to large bit errors in the subsequent acquisition process, resulting in errors in the collected data, thus affecting the subsequent chip or system to work abnormally. The usual treatment method is to use a high-frequency PLL to generate a high-frequency clock, such as 4 times or 8 times the clock to process data, which leads to the need to purchase high-priced PLL chips or chips with integrated high-performance PLLs, resulting in high costs and difficulties in circuit timing convergence. Summary of the invention
[0003] In order to overcome the above-mentioned high purchase cost or difficulty in circuit timing convergence, the purpose of the present invention is to provide a device and method for synchronously collecting and restoring data with a frequency twice the effective width of a data bit.
[0004] The following technical solutions are adopted:
[0005] A device for collecting data at a low frequency comprises a clock frequency increasing module, a clock frequency dividing module, a data synchronization module and a data collection module, wherein:
[0006] The clock frequency increasing module increases the frequency of the input system clock signal, and the increased frequency signal is sent to the clock frequency dividing module and the data synchronization module;
[0007] The clock frequency division module divides the frequency of the up-converted signal and outputs the divided signal to the data acquisition module;
[0008] The data synchronization module is inputted by external input data, and outputs the synchronization flag First_flag to the clock frequency division module for self-calibration. The data synchronization module also outputs synchronization data and synchronization flag to the data acquisition module;
[0009] The data acquisition module includes a collector and a counter. After receiving the synchronization flag, the data acquisition module generates a collection flag receive_flag, which represents that the collection is valid, and then the counter starts counting.
[0010] Preferably, the clock frequency increasing module increases the frequency of the input clock signal by no more than 2 times.
[0011] Preferably, the system clock is 20MHz, the clock frequency increase module is 2 times the frequency, the clock frequency division module is 2 times the frequency, and the data synchronization module stores 3-bit data AP[2:0] and AN[2:0] through the rising edge and falling edge of the 40MHz clock respectively, and they are spliced with each other at intervals to form 6-bit bus data B0[5:0] = {AP[2], AN[2], AP[1], AN[1], AP[0], AN[0]}; AP[2:0] is also the synchronization data of the data acquisition module, and the synchronization mark is the first B0[3:0] which is 4'b1110 or 4'b1100.
[0012] Preferably, when the data bit level width of the input data of the data synchronization module is 50ns, the synchronization header output by the data synchronization module is 0x5F, and the data acquisition module starts to acquire data from AP[1].
[0013] Preferably, when the data bit level width of the input data of the data synchronization module is 25-45ns, after the rising edge extension of the 40MHz clock of the data synchronization module, that is, B0[5:0] is 6'b110011, the data acquisition module starts to collect data from AP[2].
[0014] Preferably, when the data bit level width of the input data of the data synchronization module is 55-75ns, after synchronization with the falling edge of the 40MHz clock of the data synchronization module and delaying by 1 count, B0[5:0] is 6'b000000, and the data acquisition module starts to collect data from AP[0].
[0015] Based on the above purpose, the present invention also provides a method for collecting data at a low frequency, using the above low frequency data collection device, comprising the following steps:
[0016] S10, the system clock is input into the clock frequency increasing module for frequency increasing;
[0017] S20, the up-converted signal is sent to the clock frequency division module and the data synchronization module; the clock frequency division module divides the up-converted signal and outputs it to the data acquisition module after the frequency division;
[0018] S30, the input of the data synchronization module is the external input data, and the synchronization flag First_flag is output to the clock frequency division module for self-calibration. The data synchronization module also outputs synchronization data and synchronization flag to the data acquisition module;
[0019] S40, after receiving the synchronization flag, the data acquisition module generates an acquisition flag receive_flag, indicating that the acquisition is valid, and then the counter starts counting.
[0020] Preferably, the system clock is 20MHz, the clock frequency increasing module increases the system clock by 2 times, the clock frequency dividing module divides the clock by 2, and the data synchronization module stores 3-bit data AP[2:0] and AN[2:0] at the rising and falling edges of the 40MHz clock respectively, and then splices them with intervals to form 6-bit bus data B0[5:0] = {AP[2], AN[2], AP[1], AN[1], AP[0], AN[0]}; AP[2:0] is also the synchronization data of the data acquisition module, and the synchronization mark is the first B0[3:0] which is 4'b1110 or 4'b1100.
[0021] Preferably, when the data bit level width of the input data of the data synchronization module is 25-45ns, after the rising edge extension of the 40MHz clock of the data synchronization module, that is, B0[5:0] is 6'b110011, the data acquisition module starts to collect data from AP[2].
[0022] Preferably, when the data bit level width of the input data of the data synchronization module is 55-75ns, after synchronization with the falling edge of the 40MHz clock of the data synchronization module and delaying by 1 count, B0[5:0] is 6'b000000, and the data acquisition module starts to collect data from AP[0].
[0023] The invention has the following beneficial effects: it avoids the high cost of using a high-frequency phase-locked loop to generate a high-frequency clock and the difficulty of circuit timing convergence. It only adjusts the synchronization mark according to the width of the data bit level being too wide or too narrow by setting the frequency multiplication and division by 2, starts data collection at different bus data bits, stores one byte every 8 bits in the data collection module, and starts the next synchronization head to collect the next frame until the collection of one frame is completed. It restores the original data efficiently and at a low cost to ensure the normal operation of the subsequent chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A structural diagram of a device for collecting data at a low frequency according to an embodiment of the device of the present invention;
[0025] Figure 2 A structural diagram of a clock frequency division module in a device for collecting data at a low frequency in an embodiment of the device of the present invention;
[0026] Figure 3 It is a structural diagram of a data synchronization module in a device for collecting data at a low frequency according to an embodiment of the device of the present invention;
[0027] Figure 4 A structural diagram of a data acquisition module in a device for collecting data at a low frequency according to an embodiment of the present invention;
[0028] Figure 5This is a data format diagram of the low frequency acquisition data of the embodiment of the present invention when the data bit level width is 46-54ns;
[0029] Figure 6 This is a data format diagram of the low frequency acquisition data when the data bit level width is 25-45ns according to an embodiment of the present invention;
[0030] Figure 7 The data format diagram of the low frequency acquisition data of the embodiment of the present invention when the data bit level width is 55-75ns
[0031] Figure 8 This is a flow chart of the steps of a method for collecting data at a low frequency according to an embodiment of the method of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] Device Embodiment
[0034] See also Figure 1 , a device for collecting data at a low frequency, comprising a clock frequency increasing module 10, a clock frequency dividing module 20, a data synchronization module 30 and a data collection module 40, wherein,
[0035] The clock frequency increasing module 10 increases the frequency of the input system clock signal, and the increased frequency signal is sent to the clock frequency dividing module 20 and the data synchronization module 30;
[0036] The clock frequency division module 20 divides the frequency of the up-converted signal and outputs the divided signal to the data acquisition module 40;
[0037] The input of the data synchronization module 30 is the external input data, and the synchronization flag First_flag is output to the clock frequency division module 20 for self-calibration. The data synchronization module 30 also outputs synchronization data and synchronization flag to the data acquisition module 40;
[0038] The data acquisition module 40 includes a collector and a counter. After receiving the synchronization flag, the data acquisition module 40 generates a collection flag receive_flag, which indicates that the collection is valid, and then the counter starts counting.
[0039] The data transmission is asynchronous transmission, and no additional acquisition clock or synchronization clock is provided. The data format is SYNC (8 bits) + valid data (40 bits) in one frame, see Table 1 for data format; the normal valid data width is 50ns; the default is high level, when a 50ns low level is transmitted, followed by a 50ns high level, a 50ns low level and a 250ns high level, that is, the SYNC synchronization header 0x5F, the starting transmission width is 50ns / bit data 40, the standard acquisition data is 0x5F_XX_XX_XX_XX_XX;
[0040] Table 1
[0041]
[0042] The acquisition method in the prior art is to use a high-frequency clock that is 4 or 8 times or more of the clock corresponding to the effective width of the data to collect data, thereby ensuring the correctness of the data. However, common devices do not have a high-frequency clock. The method in the prior art is to use a low-frequency clock to increase the frequency to a high frequency through a PLL, which has high requirements on circuit performance.
[0043] Ideally, the data bit level width is fixed at 50ns, so the corresponding 40MHz clock can also collect correct data. However, due to the influence of line delay parasitics, the effective width of the data will increase or decrease. The actual width of data transmission may be greater than 25ns and less than 75ns. But when it is not 50ns, use 40MHz clock to collect data. See Figure 4 When the data bit level is too narrow (between 25ns and 45ns), the sync header may be parsed as 0xDF. Figure 5 Because the data bit level is too wide (between 55 and 75ns), the synchronization header may be parsed as 0x1F, which will cause data frame loss, that is, normal data cannot be collected.
[0044] The clock frequency increasing module 10 of the present invention includes a phase-locked loop to achieve 2-time frequency, a clock frequency dividing module 20 to perform 2-frequency division, a data synchronization module 30 and a data acquisition module 40; the clock frequency increasing module 10 mainly provides a frequency increasing function, the clock frequency dividing module 20 provides frequency division and clock self-synchronization functions, the data synchronization module 30 synchronizes data and provides a flag function, and the data acquisition module 40 provides acquisition and acquisition counter functions, and can decode data.
[0045] Assume that the system clock is 20MHz, firstly, it is frequency-upgraded to 40MHz clock by clock frequency-up module 10, and when the output is stable, clock frequency-dividing module 20 starts to generate 2-frequency-divided clock Gen_clk; see Figure 2The clock division module 20 includes a D flip-flop 21 and an inverter 22. The input clock of the D flip-flop 21 is the 40mhz_clk output by the clock frequency increasing module 10. The output is the 2-frequency divided clock Gen_clk which is fed back to the D flip-flop 21 after passing through the inverter 22 to make the output stable.
[0046] See also Figure 3 The data synchronization module 30 includes a plurality of D flip-flops 21, a plurality of AND gates 31, an OR gate 32 and an inverter 22; see Figure 4 The data acquisition module 40 includes a counter 41, a plurality of AND gates 31, an OR gate 32, an NOR gate 33 and a D flip-flop 21. The data data is respectively input into the D flip-flop 21 in the data synchronization module 30 through the rising and falling edges of the 40MHz clock, i.e., 40mhz_clk, for storage, and the storage outputs 3-bit data AP[2:0] and AN[2:0]. AP[2:0] and AN[2:0] are spliced with each other to form 6-bit bus data B0[5:0]={AP[2], AN[2], AP[1], AN[1], AP[0], AN[0]}; AP[2:0] is the synchronization data of the data acquisition module 40; the data synchronization flag First_flag is the first B0[3:0] is 4'b1110 or 4'b1100, 4'b1110 and 4'b1100 are input or The output of gate 32 or gate 32 is input together with the output of counter 41 (0 at this time) into AND gate 31. The output of AND gate 31 is connected to a D flip-flop 21. The output of D flip-flop 21 is the synchronization flag First_flag. When the output of counter 41 is 47, after passing through inverter 22, it is input into AND gate 31 with First_flag. At this time, the data acquisition clock Gen_clk is reset, counter 41 starts counting, and the acquisition flag receive_flag becomes high (valid). The Gen_clk acquisition clock is self-calibrated according to the synchronization flag First_flag of data transmission. Counter 41 starts counting from when receive_flag becomes high, and is cleared when the count reaches decimal 47.
[0047] When the data bit level is too narrow (25 to 45 ns), refer to Figure 6 , the output of counter 41 is 0, the output of counter 41 and 6'b110011 are input into AND gate 31, and then stored by D flip-flop 21 and output narrow_flag, that is, data data is extended by the rising edge of clock 40mhz_clk in data synchronization module 30, that is, B0[5:0] is 6'b110011, that is, narrow_flag, and data is collected from AP[2], see Figure 4 narrow_flag and AP[2] input AND gate 31; when the data bit level is too wide (55~75ns), refer to Figure 7, the output of counter 41 is 1, the output of counter 41 and 6'b000000 are input into AND gate 31, and then stored by D flip-flop 21 and output wide_flag, that is, the data is synchronized by the falling edge of clock 40mhz_clk of data synchronization module 30, and after delaying 1 count, B0[5:0] is 6'b000000, that is, wide_flag, and data is collected from AP[0]. See Figure 4 wide_flag and AP[0] are input to AND gate 31; when the data bit level width is normal (46 to 54 ns), see Figure 5 , the output of the counter 41 is 47, narrow_flag and wide_flag are input into the AND gate together with AP[1] after passing through the NOR gate 33, that is, data collection starts from AP[1]. Figure 4 After the output of the AND gate 31 when the data bit level is too narrow, too wide or normal is input into an OR gate 32, it is input into a D flip-flop 21. The D flip-flop 21 outputs the collected data, storing one byte every 8 bits until one frame is collected, and then the next synchronization header is started to collect the next frame.
[0048] Based on the above purpose, the present invention also provides a method for collecting data at a low frequency. Figure 8 , the device for collecting data using the low frequency multiplication comprises the following steps:
[0049] S10, the system clock is input into the clock frequency increasing module for frequency increasing;
[0050] S20, the up-converted signal is sent to the clock frequency division module and the data synchronization module; the clock frequency division module divides the up-converted signal and outputs it to the data acquisition module after the frequency division;
[0051] S30, the input of the data synchronization module is the external input data, and the synchronization flag First_flag is output to the clock frequency division module for self-calibration. The data synchronization module also outputs synchronization data and synchronization flag to the data acquisition module;
[0052] S40, after receiving the synchronization flag, the data acquisition module generates an acquisition flag receive_flag, indicating that the acquisition is valid, and then the counter starts counting.
[0053] The method embodiment refers to the device embodiment and will not be described in detail.
[0054] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.
Claims
1. A device for collecting data at a low frequency, characterized in that: It includes a clock frequency increasing module, a clock frequency dividing module, a data synchronization module and a data acquisition module, among which: The clock frequency increasing module increases the frequency of the input system clock signal, and the increased frequency signal is sent to the clock frequency dividing module and the data synchronization module; The clock frequency division module divides the frequency of the up-converted signal and outputs the divided signal to the data acquisition module; The data synchronization module inputs external input data, outputs synchronization marks to the clock frequency division module for self-calibration, and also outputs synchronization data and synchronization marks to the data acquisition module; The data acquisition module includes a collector and a counter. After receiving the synchronization mark, the data acquisition module generates a collection mark, indicating that the collection is valid, and then the counter starts counting; The data synchronization module includes several D flip-flops, several AND gates, OR gates and inverters; the data acquisition module includes a counter, several AND gates, OR gates, NOR gates and D flip-flops. The data data is respectively input into the D flip-flops in the data synchronization module through the rising and falling edges of the 40MHz clock, i.e., 40mhz_clk, for storage, and the storage outputs 3-bit data AP[2:0] and AN[2:0]. AP[2:0] and AN[2:0] are spliced with each other at intervals to form 6-bit bus data B0[5:0]={AP[2],AN[2],AP[1],AN[1],AP[0],AN[0]}; AP[2:0] is the synchronization data of the data acquisition module; the data synchronization flag First_flag is the first B0 [3:0] is 4'b1110 or 4'b1100. 4'b1110 and 4'b1100 are input into OR gate 32. The output of OR gate 32 and the output of counter are input into AND gate together. The output of AND gate is connected to a D flip-flop. The output of D flip-flop is the synchronization flag First_flag. When the output of counter is 47, after the inverter, it is input into AND gate together with First_flag. At this time, data acquisition clock Gen_clk is reset, counter starts counting, acquisition flag receive_flag becomes high, Gen_clk acquisition clock is self-calibrated according to the synchronization flag First_flag of data transmission, counter starts counting from when receive_flag becomes high, and is cleared when counting reaches decimal 47.
2. The device for collecting data at a low frequency as claimed in claim 1, characterized in that: The clock frequency increasing module increases the frequency of the input clock signal by no more than 2 times.
3. The device for collecting data at a low frequency as claimed in claim 1, characterized in that: The system clock is 20MHz, the clock frequency increasing module is 2 times the frequency, and the clock frequency dividing module is 2 times the frequency.
4. The device for collecting data at a low frequency as claimed in claim 1, characterized in that: When the data bit level width of the input data of the data synchronization module is 50ns, the synchronization header output by the data synchronization module is 0x5F, and the data acquisition module starts to collect data from AP[1].
5. The device for collecting data at a low frequency as claimed in claim 1, characterized in that: When the data bit level width of the input data of the data synchronization module is 25-45ns, after the rising edge extension of the 40MHz clock of the data synchronization module, that is, B0[5:0] is 6'b110011, the data acquisition module starts to collect data from AP[2].
6. The device for collecting data at a low frequency as claimed in claim 1, characterized in that: When the data bit level width of the input data of the data synchronization module is 55-75ns, it is synchronized with the falling edge of the 40MHz clock of the data synchronization module and delayed by 1 count, B0[5:0] is 6'b000000, and the data acquisition module starts to collect data from AP[0].
7. A method for collecting data at a low frequency, using the device for collecting data at a low frequency as claimed in any one of claims 1 to 6, characterized in that: The following steps are involved: S10, the system clock is input into the clock frequency increasing module for frequency increasing; S20, the up-converted signal is sent to the clock frequency division module and the data synchronization module; the clock frequency division module divides the up-converted signal and outputs it to the data acquisition module after the frequency division; S30, the data synchronization module inputs the external input data, outputs the synchronization mark to the clock frequency division module for self-calibration, and the data synchronization module also outputs the synchronization data and the synchronization mark to the data acquisition module; S40, after receiving the synchronization mark, the data acquisition module generates an acquisition mark, indicating that the acquisition is valid, and then the counter starts counting.
8. The method for collecting data at a low frequency as claimed in claim 7, characterized in that: The system clock is 20MHz, the clock frequency increase module increases the system clock by 2 times, the clock frequency division module divides it by 2, and the data synchronization module stores 3-bit data AP[2:0] and AN[2:0] through the rising and falling edges of the 40MHz clock respectively, and they are spliced together at intervals to form 6-bit bus data B0[5:0] = {AP[2], AN[2], AP[1], AN[1], AP[0], AN[0]}; AP[2:0] is also the synchronization data of the data acquisition module, and the synchronization flag is the first B0[3:0] which is 4'b1110 or 4'b1100.
9. The method for collecting data at a low frequency as claimed in claim 8, characterized in that: When the data bit level width of the input data of the data synchronization module is 25-45ns, after the rising edge extension of the 40MHz clock of the data synchronization module, that is, B0[5:0] is 6'b110011, the data acquisition module starts to collect data from AP[2].
10. The method for collecting data at a low frequency as claimed in claim 8, characterized in that: When the data bit level width of the input data of the data synchronization module is 55-75ns, it is synchronized with the falling edge of the 40MHz clock of the data synchronization module and delayed by 1 count, B0[5:0] is 6'b000000, and the data acquisition module starts to collect data from AP[0].
