Analog digital control device and method, electronic equipment and readable storage medium
By averaging and comparing the digital signals from the analog-to-digital converter, the gain error problem is solved, the conversion accuracy is improved, and the application range is expanded.
Patent Information
- Application Number
- CN202510952213.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-11-18
AI Technical Summary
Existing analog-to-digital converters suffer from gain errors, resulting in low accuracy and limiting their application in high-precision scenarios.
By averaging the converted digital signal and comparing it with a preset value, the accuracy of analog-to-digital signal conversion is improved and gain error is reduced.
It improves the accuracy of analog-to-digital signal conversion, reduces gain error, and expands its application range in high-precision scenarios.
Smart Images

Figure CN120979449A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of analog-digital converters, and relates to an analog-digital control device and method, electronic equipment and a readable storage medium. BACKGROUND
[0002] An analog-digital converter, namely an A / D converter or ADC for short, generally refers to an electronic element for converting an analog signal into a digital signal. In the related products on the market, an analog-digital controller is usually combined with a successive approximation register (SAR) analog-digital converter or a delta-sigma analog-digital converter to perform conversion of an analog signal into a digital signal on a selectable analog input channel. The analog circuit converts the sampled signal according to a set reference voltage, and outputs the result to the analog-digital controller after the conversion is completed, and the analog-digital controller processes and stores the result.
[0003] However, the analog-digital conversion circuit in the prior art has a gain error, which may cause the result to deviate, and thus the accuracy of the analog-digital conversion result is low, and the analog-digital conversion result cannot be used in a high-precision scene, thereby limiting the application scenarios of the technology.
[0004] Therefore, it is necessary to provide an improved technical solution to overcome the above technical problems in the prior art. SUMMARY
[0005] The application aims to provide an analog-digital control device and method, electronic equipment and a readable storage medium, which improve the accuracy of conversion of an analog signal into a digital signal by performing average processing on the converted digital signal and comparing it with a preset value, and reduce the gain error.
[0006] To achieve the above purpose: In a first aspect, the application provides an analog-digital control device, which comprises an analog-digital conversion module and an analog-digital storage processing module connected to each other. The analog-digital conversion module is configured to convert a received analog signal into a digital signal and send it to the analog-digital storage processing module, and the analog-digital storage processing module is configured to perform average processing on the received digital signal and store it after determining that the value of the average-processed digital signal meets a preset signal value range.
[0007] In an embodiment, the analog-digital conversion module comprises a channel selection unit, a comparison unit and an algorithm unit. The channel selection unit is configured to select an input channel to be sampled and acquire an analog signal input through the input channel to be sampled; the comparison unit is configured to compare the analog signal with a digital signal; and the algorithm unit is configured to convert the analog signal into the digital signal based on an embedded algorithm.
[0008] In an embodiment, the analog-digital storage processing module is further configured to adjust a charging time of the input channel to be sampled through an embedded control command code.
[0009] In an embodiment, the analog-digital storage processing module comprises a trigger selection unit. The trigger selection unit is configured to select a unique trigger event according to a preset trigger priority when a plurality of trigger events are received.
[0010] In an embodiment, when the trigger selection unit does not receive a valid trigger event, the analog-digital control device is ensured to be inoperable.
[0011] In an embodiment, the analog-digital storage processing module further comprises a command selection unit. The command selection unit is configured to select a corresponding command according to the trigger event.
[0012] In an embodiment, the analog-digital storage processing module comprises a signal processing unit and a result storage unit. The signal processing unit is configured to acquire the digital signal and marker information data and perform average processing on the digital signal; and the result storage unit is configured to store the average-processed data signal and the marker information data.
[0013] In a second aspect, the present application provides an analog-digital control method, comprising: acquiring an analog signal; converting the analog signal into a digital signal; performing average processing on the digital signal; storing the average-processed digital signal in an analog-digital storage processing module after determining that a value of the average-processed digital signal meets a preset signal value range.
[0014] In a third aspect, the present application provides an electronic device, comprising a processor and a memory in communication connection with the processor; the memory stores computer execution instructions; and the processor executes the computer execution instructions stored in the memory to implement the method according to the second aspect.
[0015] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the method in the second aspect.
[0016] The application provides an analog-digital control device, method, electronic equipment and readable storage medium, which comprises an analog-digital conversion module and an analog-digital storage processing module connected with each other; the analog-digital conversion module is used for converting the received analog signal into a digital signal and sending the digital signal to the analog-digital storage processing module; the analog-digital storage processing module is used for performing average processing on the received digital signal and storing the digital signal after determining that the value of the digital signal after the average processing meets a preset signal value range. The application improves the conversion precision of the analog signal to the digital signal by performing average processing on the converted digital signal and comparing the digital signal with the preset value, and reduces the gain error. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0018] Figure 1 The structural schematic diagram of the analog-digital control device provided by the embodiments of the present application is shown in the figure. Figure 2 The flowchart of the analog-digital control method provided by the embodiments of the present application is shown in the figure. Figure 3 The structural schematic diagram of the electronic equipment provided by the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION
[0019] The exemplary embodiments will be described in detail herein with reference to the drawings. Unless otherwise indicated, the same numbers on different drawings represent the same or similar elements. The following exemplary embodiments are described in connection with the present application. However, they are not intended to represent all the aspects of the present application. Rather, they are merely examples with respect to apparatus and methods in accordance with some aspects of the present application as detailed in the appended claims.
[0020] It should be noted that, as used in this document, the terms "include," "includes," or "including" are used as the plain-English equivalents respectively of the terms "comprise," "comprises," or "comprising." Also, the use of "including" and "comprising" should be interpreted as specifying the presence of stated features or steps but not the absence of others.
[0021] It should be understood that, although terms such as first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one category of information from another category of information. For example, first information can also be referred to as second information, and similarly, second information can also be referred to as first information without departing from the scope of this document. Depending on the context, the word "if' as used herein can be interpreted as meaning "when" or "in response to determining" or "in response to ascertaining." Also, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes," "including," and the like, when used in this document, specify the presence of stated features, steps, operations, elements, components, items, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, items, and / or groups thereof. As used herein, the term "or" and "and / or" is interpreted as inclusive, or means either one or any combination of items. Therefore, "A, B, or C" or "A, B, and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B, and C." This definition applies to all uses of "or" and "and / or," unless a context dictates otherwise.
[0022] It should be understood that although each step in the flowchart in the embodiments of the present application is shown in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the figure can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0023] It should be noted that in this paper, step codes such as S201, S202 are used, the purpose is to more clearly and briefly express the corresponding content, and does not constitute a substantial limitation on the sequence. In specific implementation, a person skilled in the art can first execute S202 and then execute S201, etc., but these should be within the protection scope of the present application.
[0024] It should be understood that the specific embodiments described herein are merely used to explain the present application and do not limit the present application.
[0025] In the following description, the suffix such as "module", "component" or "unit" used to represent elements is only for the convenience of the description of the present application, and has no specific meaning. Therefore, "module", "component" or "unit" can be used mixedly.
[0026] As shown in Figure 1 The embodiment of the present application provides a structure schematic diagram of an analog-digital control device, which comprises an analog-digital conversion module 110 and an analog-digital storage processing module 120 connected with each other; the analog-digital conversion module 110 is used for converting the received analog signal into a digital signal and sending it to the analog-digital storage processing module 120; the analog-digital storage processing module 120 is used for performing average processing on the received digital signal and storing it after determining that the value of the average-processed digital signal meets a preset signal value range.
[0027] It can be understood that the conversion process of the analog signal into the digital signal is started by a software or hardware trigger event, and the results of multiple conversions on the channel are averaged after the start; the generated data is stored in the analog-digital storage processing module 120 after the conversion and average processing are completed; at the same time, the conversion result is compared with the set value of the two value registers, so as to determine whether the value of the average-processed digital signal meets the preset signal value range. Among them, the hardware average function and the comparison function can run in all conversion modes and configurations.
[0028] Preferably, when there is no effective trigger event or channel sampling, the reset signal in the analog-digital control device takes effect, ensuring that the circuit does not work, thereby effectively reducing the idle current; after the conversion of the analog signal to the digital signal is completed, the analog-digital control device resets the circuit.
[0029] In an embodiment, the analog-digital conversion module 110 comprises a channel selection unit 111, a comparison unit 112, and an algorithm unit 113; the channel selection unit 111 is configured to select an input channel to be sampled and obtain an input analog signal through the input channel to be sampled; the comparison unit 112 is configured to compare the analog signal with a digital signal; and the algorithm unit 113 is configured to convert the analog signal to the digital signal based on an embedded algorithm.
[0030] Preferably, the analog-digital conversion module provided in the present application comprises a successive approximation register (SAR) analog-digital conversion module, which obtains an approximate digital output by gradually approximating the value of an input signal, starting from the most significant bit (MSB), comparing and determining the digital value of each bit one by one, and using a successive approximation register to implement the conversion process.
[0031] It can be understood that the input channel is selected by the channel selection unit 111, the analog signal is sampled within a preset duration, and the sampled analog signal is converted to a digital signal by using an embedded successive approximation algorithm.
[0032] Further, the analog-digital conversion module 110 is embedded with a hardware averaging algorithm for calibrating the logic of the gain comparison unit 112, thereby improving the sampling and conversion accuracy.
[0033] Preferably, the analog-digital conversion module 110 can adjust the charging time of the input channel through an embedded control command code, thereby avoiding the fault of sampling voltage error caused by insufficient charging time of the input channel.
[0034] In an embodiment, the analog-digital storage processing module is further configured to adjust the charging time of the input channel to be sampled through an embedded control command code.
[0035] It can be understood that the charging time of the input channel is adjusted through an embedded control command code, thereby avoiding the sampling voltage error caused by insufficient charging time of the input channel.
[0036] In an embodiment, the analog-digital storage processing module 120 comprises a trigger selection unit 121; the trigger selection unit 121 is configured to select a unique trigger event according to a preset trigger priority when receiving a plurality of trigger events.
[0037] It can be understood that the preset trigger priority includes a priority judgment logic built in the trigger selection unit 121 and an internal trigger event generation unit. If multiple trigger events are detected, the trigger event with higher priority is served, and other trigger events remain in a suspended state.
[0038] In an embodiment, when the trigger selection unit does not receive a valid trigger event, the analog-digital control device is ensured to be inoperative.
[0039] It can be understood that when no valid trigger event or channel sampling is received, the analog-digital control device will ensure that the analog circuit is inoperative, thereby effectively reducing the idle current in the analog-digital control device; after the conversion of the analog signal to the digital signal is completed, the analog-digital control device will reset the circuit.
[0040] In an embodiment, the analog-digital storage processing module 120 further includes a command selection unit 122; the command selection unit 122 is configured to select a corresponding command according to the trigger event.
[0041] It can be understood that the analog-digital storage processing module 120 stores commands corresponding to possible received trigger events. When the trigger event is determined, the corresponding command is selected by the command selection unit 122 based on the selected trigger event, further optimizing the converted digital signal.
[0042] In an embodiment, the analog-digital storage processing module 120 includes a signal processing unit 123 and a result storage unit 124; the signal processing unit 123 is configured to obtain the digital signal and the marker information data, and perform average processing on the digital signal; the result storage unit 124 is configured to store the average-processed data signal and the marker information data.
[0043] It can be understood that the signal processing unit 123 includes multiple command buffers for average processing, providing configurable flexibility for channel scanning, loop sampling, and processing abnormal voltage, and realizing full mapping of the trigger source to an independent channel; after the average processing, the generated data is placed in the result storage unit 124 together with the marker information data including the trigger source, the command buffer, and the like.
[0044] Optionally, if the stored result exceeds a preset threshold, an interrupt or DMA can be selected.
[0045] Based on the same inventive concept as the foregoing embodiments, the present application provides an analog-digital control method, as shown in Figure 2 The method comprises the following steps: In step S201, an analog signal is obtained.
[0046] In step S202, the analog signal is converted into a digital signal.
[0047] In step S203, the digital signal is averaged.
[0048] In step S204, after determining that the value of the averaged digital signal is within the preset signal value range, the averaged digital signal is stored in the analog-digital storage processing module 120.
[0049] The specific step flow of the above method can refer to the description of the embodiments shown in Figure 1 The description of the embodiments shown in
[0050] Based on the same inventive concept as the foregoing embodiments, the embodiments of the present application provide an electronic device, as shown in Figure 3 The device includes a processor 301 and a memory 302 storing a computer program; wherein, Figure 3 The processor 301 shown in the figure is not used to refer to the number of processors 301 being one, but is only used to refer to the positional relationship of the processor 301 relative to other devices. In actual application, the number of processors 301 can be one or more; similarly, Figure 3 The memory 302 shown in the figure also has the same meaning, that is, it is only used to refer to the positional relationship of the memory 302 relative to other devices. In actual application, the number of memories 302 can be one or more. When the processor 301 runs the computer program, the application of the analog-digital control method described above is realized.
[0051] The device can also include at least one network interface 303. The various components in the device are coupled together through a bus device 304. It can be understood that the bus device 304 is used to realize the connection and communication between the components. The bus device 304 includes not only a data bus, but also a power supply bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the bus device 304 in Figure 3 The figure.
[0052] The memory 302 can be volatile memory or nonvolatile memory, or both. The nonvolatile memory can be read only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, ferroelectric random access memory (FRAM), a magnetic random access memory, and a magnetic disk storage and a magnetic tape storage. The volatile memory can be random access memory (RAM), which functions as external cache. Many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), SyncLink dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory 302 described in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memories.
[0053] Based on the same inventive concept as the foregoing embodiments, the embodiments also provide a computer readable storage medium, in which a computer program is stored, and the computer readable storage medium can be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, a compact disc read-only memory (CD-ROM), or the like. The computer readable storage medium can also be various devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, and the like. The computer program stored in the computer readable storage medium is run by a processor, and the above method is implemented. For specific step processes implemented by the computer program when executed by the processor, refer to the above description of the method. Figure 2 The description of the embodiments shown herein will not be repeated here.
[0054] In the present application, for the same or similar term concept, technical solution and / or application scenario description, generally only the first time is described in detail, and for the sake of brevity, the repeated description is generally not repeated, and for the understanding of the technical solutions of the present application, the same or similar term concept, technical solution and / or application scenario description which is not described in detail can be referred to the related description before.
[0055] In the present application, the description of each embodiment has its own emphasis, and the part not described or recorded in a certain embodiment can be referred to the related description of other embodiments.
[0056] Each technical feature of the above described embodiments can be combined arbitrarily, and for the sake of brevity, not all possible combinations of the technical features in the above described embodiments are described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0057] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An analog-digital control device, characterized in that, It includes interconnected analog-to-digital conversion modules and analog-to-digital storage and processing modules; The analog-to-digital conversion module is used to convert the received analog signal into a digital signal and send it to the analog-to-digital storage and processing module. The analog-to-digital storage and processing module is used to perform averaging on the received digital signal and store it after determining that the value of the averaged digital signal meets the preset signal value range.
2. The apparatus according to claim 1, characterized in that, The analog-to-digital conversion module includes a channel selection unit, a comparison unit, and an algorithm unit; The channel selection unit is used to select the input channel to be sampled and to acquire the input analog signal through the input channel to be sampled; the comparison unit is used to compare the analog signal with the digital signal; the algorithm unit is used to convert the analog signal into a digital signal based on a built-in algorithm.
3. The apparatus according to claim 2, characterized in that, The analog-to-digital storage processing module is also used to adjust the charging time of the input channel to be sampled through built-in control command codes.
4. The apparatus according to claim 1, characterized in that, The analog-to-digital storage processing module includes a trigger selection unit; The trigger selection unit is used to select a unique trigger event according to a preset trigger priority when multiple trigger events are received.
5. The apparatus according to claim 4, characterized in that, When the trigger selection unit does not receive a valid trigger event, it ensures that the analog-digital control device does not work.
6. The apparatus according to claim 4, characterized in that, The analog-to-digital storage processing module also includes a command selection unit; The command selection unit is used to select the corresponding command based on the triggering event.
7. The apparatus according to claim 1, characterized in that, The analog-to-digital storage and processing module includes a signal processing unit and a result storage unit; The signal processing unit is used to acquire the digital signal and the tag information data, and to perform averaging processing on the digital signal; the result storage unit is used to store the averaged data signal and the tag information data.
8. An analog-digital control method, characterized in that, include: Acquire analog signals; Convert the analog signal into a digital signal; The digital signal is then averaged. After determining that the value of the averaged digital signal conforms to the preset signal value range, the averaged digital signal is stored in the analog-to-digital storage and processing module.
9. An electronic device, characterized in that, include: A processor and a memory for storing executable instructions; wherein the processor is configured to execute the instructions to implement the analog-digital control method as described in claim 8.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by a processor, the analog-digital control method as described in claim 8 is implemented.