Analog-to-digital converter precision control method, device, equipment and medium
By adjusting the input or output voltage of the analog-to-digital converter chip and adjusting the voltage conversion formula based on the actual reference voltage, the problem of insufficient ADC conversion accuracy is solved, and higher accuracy and accuracy are achieved.
Patent Information
- Application Number
- CN202411816250.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
There is room for improvement in conversion accuracy of existing analog-to-digital converters (ADCs), especially the floating reference voltage caused by manufacturing differences between different chips, affecting the accuracy of the conversion results.
By adjusting its internal input or output voltage for each chip, measuring the actual reference voltage, and adjusting the voltage conversion formula of the analog-to-digital converter based on this to eliminate individual chip differences.
It effectively improves the accuracy of the analog-to-digital converter, ensures the accuracy of the conversion results, and reduces errors caused by chip differences.
Smart Images

Figure CN119766239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to an analog-to-digital converter precision control method, device, equipment and medium. Background Art
[0002] Analog-to-Digital Converter (ADC) is an electronic device that converts analog signals into digital signals. In a microcontroller unit (MCU), ADC is usually used to convert external analog signals into digital signals so that the MCU can process and analyze them.
[0003] The process of ADC converting continuously changing analog signals into discrete digital signals usually includes steps such as sampling, holding, quantization and encoding. Nowadays, there is room for improvement in the accuracy of ADC. Summary of the invention
[0004] One of the purposes of the present invention includes, for example, providing an analog-to-digital converter accuracy control method, apparatus, device and medium to at least partially improve the accuracy of ADC use.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, an embodiment of the present invention provides an analog-to-digital converter accuracy control method, comprising:
[0007] For each chip in the analog-to-digital converter, adjusting the input voltage or output voltage inside the chip;
[0008] After the input voltage or output voltage is adjusted, measuring and recording the actual reference voltage of the analog signal in the internal channel of the chip;
[0009] Sampling based on the actual reference voltage to obtain a measurement value of the analog-to-digital converter;
[0010] Based on the actual reference voltage and the measured value, a voltage conversion formula of the analog-to-digital converter is adjusted.
[0011] In an optional implementation manner, adjusting the input voltage or output voltage inside the chip includes:
[0012] Determining a target voltage level of the chip;
[0013] The input voltage or the output voltage is adjusted with the target voltage level as the adjustment target.
[0014] In an optional implementation manner, the measuring and recording the actual reference voltage of the analog signal in the internal channel of the chip includes:
[0015] In the CP test mode, measuring the actual reference voltage of the analog signal in the internal channel of the chip;
[0016] The actual reference voltage is written into the information area of the chip.
[0017] In an optional implementation manner, writing the actual reference voltage into the information area of the chip includes:
[0018] The actual reference voltage is stored in a register set in the chip, and the register supports setting or reading the actual reference voltage.
[0019] In an optional implementation, adjusting the voltage conversion formula of the analog-to-digital converter based on the actual reference voltage and the measured value includes:
[0020] The actual reference voltage is used as a reference source, and the conversion voltage of the analog-to-digital converter is calculated in combination with the sampling accuracy of the analog-to-digital converter and the measurement value.
[0021] In an optional implementation manner, the actual reference voltage is used as a reference source, combined with the sampling accuracy of the analog-to-digital converter and the measured value, to calculate the conversion voltage of the analog-to-digital converter, including:
[0022] The actual reference voltage is used as a reference source, and the sampling voltage is calculated based on the following formula:
[0023]
[0024] Wherein, VCCA is the sampling voltage of the analog-to-digital converter; 4096 is the sampling accuracy of the analog-to-digital converter; ADC dout is the measured value of the analog-to-digital converter; VRFEFINT is the actual reference voltage of the analog-to-digital converter.
[0025] In an optional implementation manner, the sampling based on the actual reference voltage to obtain the measurement value of the analog-to-digital converter includes:
[0026] Periodically extracting samples from the analog signal stream of the internal channel of the chip based on the actual reference voltage;
[0027] The samples are quantized and encoded to obtain the measured values of the analog-to-digital converter.
[0028] In an optional implementation, the sampling frequency of the analog-to-digital converter is more than twice the highest frequency of the analog signal.
[0029] In a second aspect, an embodiment of the present invention provides an analog-to-digital converter precision control device, comprising:
[0030] An information acquisition module is used to adjust the input voltage or output voltage inside each chip in the analog-to-digital converter; after the input voltage or output voltage is adjusted, measure and record the actual reference voltage of the analog signal in the channel inside the chip;
[0031] The information processing module is used to perform sampling based on the actual reference voltage to obtain a measurement value of the analog-to-digital converter; and to adjust a voltage conversion formula of the analog-to-digital converter based on the actual reference voltage and the measurement value.
[0032] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the analog-to-digital converter accuracy control method described in any one of the aforementioned implementations is implemented.
[0033] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a computer program, and when the computer program is executed, the electronic device where the computer-readable storage medium is located is controlled to execute the analog-to-digital converter precision control method described in any one of the aforementioned implementation modes.
[0034] The beneficial effects of the embodiments of the present invention include, for example: for each chip in the analog-to-digital converter, the voltage conversion formula of the analog-to-digital converter is adjusted based on the actual reference voltage and the measurement value, thereby effectively eliminating the differences between individual chips in the analog-to-digital converter, performing voltage conversion based on the voltage conversion formula that conforms to the actual situation, and improving the accuracy of the analog-to-digital converter. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A schematic diagram of a reference source deviation impact specification table provided in an embodiment of the present invention is shown.
[0037] Figure 2 A schematic diagram of an application scenario provided by an embodiment of the present invention is shown.
[0038] Figure 3 A schematic flow chart of a method for controlling the precision of an analog-to-digital converter provided in an embodiment of the present invention is shown.
[0039] Figure 4A comparative flow chart of an existing flow provided by an embodiment of the present invention and a flow in an embodiment of the present invention is shown.
[0040] Figure 5 A schematic diagram of a voltage conversion table for precision control of an analog-to-digital converter provided by an embodiment of the present invention is shown.
[0041] Figure 6 An exemplary structural block diagram of an analog-to-digital converter precision control device provided by an embodiment of the present invention is shown.
[0042] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication module; 140 - analog-to-digital converter precision control device; 141 - information acquisition module; 142 - information processing module. DETAILED DESCRIPTION
[0043] The process of ADC converting continuously changing analog signals into discrete digital signals usually includes sampling, holding, quantization and encoding. Among them, sampling and holding are generally completed in the sample-and-hold circuit, while quantization and encoding are completed in the ADC. Sampling refers to the ADC sampling the continuously changing analog signal multiple times within a certain time interval to restore the signal waveform information without distortion under the condition of limited sampling rate.
[0044] The current common ADC accuracy reaches 12 bits, which means that the ADC can accurately identify 4096 different voltage levels. If the reference source is set to 1.2 volts, the ADC should theoretically be able to distinguish the smallest voltage change of about 1.2 volts divided by (2^{12}) ≈ 0.038 microvolts (μV).
[0045] However, it has been found that manufacturing differences between different chips may cause the internal reference voltage to fluctuate above or below the nominal value, such as 12 millivolts (±12mV). This means that if the actual reference voltage is higher or lower, such as 1.212 volts or 1.188 volts, the ADC conversion result will deviate from the ideal value. Due to the deviation from the ideal value, even at the same input voltage, there may be significant errors between the ADC readings of different chips, thus affecting the accuracy of a single sampling.
[0046] To assess the impact of this bias, it is usually necessary to consult the manufacturer's specification sheet for the effect of reference source bias (e.g. Figure 1 Given the differences in internal voltages between different chips, if the ADC conversion values are calculated uniformly according to the default values, conversion deviations will result.
[0047] Based on the above research, an embodiment of the present invention provides an analog-to-digital converter accuracy control solution, which extracts the measured internal voltage to adjust the voltage conversion formula of the ADC according to the internal voltage deviation of different chips to ensure the ADC conversion accuracy.
[0048] The defects existing in the above solutions are the results obtained by the inventors after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed in the embodiments of the present invention for the above problems below should all be the contributions made by the inventors in the invention process.
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.
[0051] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0053] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0054] Please refer to Figure 2, is a block diagram of an electronic device 100 provided in the present embodiment. The electronic device 100 in the present embodiment may be a server, a processing device, a processing platform, etc. capable of data interaction and processing. For example, it may be a control device that supports setting the ADC. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.
[0055] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), 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), etc.
[0056] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions.
[0057] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.
[0058] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0059] Please refer to Figure 3 , which is a flow chart of a method for controlling the precision of an analog-to-digital converter provided by an embodiment of the present invention, can be Figure 2 The electronic device 100 executes, for example, the processor 120 in the electronic device 100. The analog-to-digital converter precision control method includes S110, S120, S130 and S140.
[0060] S110 , for each chip in the analog-to-digital converter, adjusting an input voltage or an output voltage inside the chip.
[0061] S120, after the input voltage or the output voltage is adjusted, measuring and recording the actual reference voltage of the analog signal in the internal channel of the chip.
[0062] S130, performing sampling based on the actual reference voltage to obtain a measurement value of the analog-to-digital converter.
[0063] S140: Adjust the voltage conversion formula of the analog-to-digital converter based on the actual reference voltage and the measured value.
[0064] By cleverly obtaining the actual reference voltage and measurement value of each chip in the analog-to-digital converter and adjusting the voltage conversion formula of the analog-to-digital converter, the differences between individual chips in the analog-to-digital converter are effectively eliminated. Voltage conversion is performed based on a voltage conversion formula that conforms to the actual situation, ensuring the accuracy of the analog-to-digital converter.
[0065] In S110, the method of adjusting the input voltage or output voltage inside the chip can be flexibly selected. For example, when the chip supports multiple gear adjustments, the adjustment of the input voltage and output voltage can be selected according to the actual product requirements in each scenario. For another example, the target voltage gear of the chip can be determined, and the input voltage or output voltage can be adjusted with the target voltage gear as the adjustment target.
[0066] For example, taking a chip in an analog-to-digital converter that supports a gear adjustment interval of 1.1V-1.3V as an example, when the target voltage gear is 1.2V, the target voltage gear is taken as the center, and the closest voltage gear is selected from the gear adjustment interval to adjust the input voltage or output voltage. If there is a voltage gear equal to the target voltage gear in the gear adjustment interval, the input voltage or output voltage is adjusted directly with the target voltage gear, otherwise the target voltage gear is adjusted up and down, and the voltage gear closest to the target voltage gear is selected to adjust the input voltage or output voltage.
[0067] When the chip has an initial gear, such as gear 0, the input voltage or output voltage inside the chip is adjusted to a target voltage gear or a voltage gear near the target voltage gear based on S110.
[0068] Among them, a digital potentiometer, an analog potentiometer, etc. can be used to adjust the voltage, and a power management unit (Power Management Unit, PMU) can also be used to perform more precise voltage control.
[0069] After completing the input voltage or output voltage adjustment based on S110, in S120, the method of measuring the actual reference voltage of the analog signal in the internal channel of the chip can be flexibly selected. For example, the measurement can be based on a voltage reference source and an ADC. For another example, an external high-precision instrument can be used for measurement and then programmed. For another example, a built-in high-precision calibration circuit can be used for measurement. For another example, the actual reference voltage of the analog signal in the internal channel of the chip can be measured in the CP (Chip Probing) test mode.
[0070] The method of recording the actual reference voltage can be flexibly selected as long as the actual reference voltage can be set and read. For example, the actual reference voltage can be written into the information area of the chip, which cannot be operated by the customer but can be read as the actual calculation reference source of the ADC. For another example, the actual reference voltage can be stored in a register set in the chip, and the set register supports setting or reading the actual reference voltage.
[0071] Based on obtaining and recording the actual reference voltage in S120, the sampling in S130 can be implemented in the following way: after determining the actual reference voltage, periodically intercept samples from the analog signal stream of the internal channel of the chip, and quantize and encode the samples to obtain the measurement value of the analog-to-digital converter.
[0072] The ADC periodically captures an instantaneous sample from the analog signal stream, quantizes and encodes it to obtain a measured value.
[0073] Based on the different signal frequency requirements of each scenario, the sampling frequency can be flexibly selected, for example, the sampling frequency can be 3MHz. The sampling frequency determines the sampling rate of the ADC. Based on the Nyquist-Shannon sampling theorem, in order to prevent information loss (aliasing effect), the sampling frequency can be set to be greater than twice the highest frequency of the analog signal.
[0074] When the actual reference voltage and the measured value are obtained, the voltage conversion formula of the ADC can be adaptively adjusted based on the actual reference voltage, the measured value, the ADC accuracy, etc. For example, the actual reference voltage is used as a reference source, and the conversion voltage of the analog-to-digital converter is calculated in combination with the sampling accuracy of the analog-to-digital converter and the measured value.
[0075] For example, the actual reference voltage may be used as a reference source, and the sampled voltage may be calculated based on the following adjusted formula:
[0076]
[0077] Wherein, VCCA is the sampling voltage of the analog-to-digital converter; 4096 is the sampling accuracy of the analog-to-digital converter; ADCdout is the measured value of the analog-to-digital converter; VRFEFINT is the actual reference voltage of the analog-to-digital converter. Figure 4 , a comparative flow chart of an existing process and a process in an embodiment of the present invention is provided.
[0078] Please refer to Figure 5 The above measurement value is the discrete digital code obtained by ADC conversion, which can also be called DAC (digital-to-analog converter) value. The DAC value is used as the input of the digital-to-analog converter. The digital-to-analog converter converts the DAC value into a corresponding analog voltage and outputs a continuous analog voltage signal.
[0079] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing an analog-to-digital converter precision control device is provided below. Figure 6 , Figure 6 A functional module diagram of an analog-to-digital converter precision control device 140 provided in an embodiment of the present invention. The analog-to-digital converter precision control device 140 can be applied to Figure 2 The electronic device 100 is shown. It should be noted that the basic principle and technical effect of the analog-to-digital converter precision control device 140 provided in this embodiment are the same as those of the above embodiment. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiment. The analog-to-digital converter precision control device 140 includes an information acquisition module 141 and an information processing module 142.
[0080] The information acquisition module 141 is used to adjust the input voltage or output voltage inside each chip in the analog-to-digital converter; after the input voltage or output voltage is adjusted, the actual reference voltage of the analog signal in the channel inside the chip is measured and recorded.
[0081] The information processing module 142 is used to perform sampling based on the actual reference voltage to obtain a measurement value of the analog-to-digital converter; and adjust a voltage conversion formula of the analog-to-digital converter based on the actual reference voltage and the measurement value.
[0082] On the basis of the above, an embodiment of the present invention further provides a computer-readable storage medium, which includes a computer program. When the computer program is running, it controls the electronic device where the computer-readable storage medium is located to execute the above-mentioned analog-to-digital converter accuracy control method.
[0083] By adopting the above scheme in the embodiment of the present invention, by measuring the actual reference voltage of each chip in the ADC and writing it into the signal area of each chip, adjusting the voltage conversion formula of the ADC based on the actual reference voltage, the measured value, and the ADC accuracy, and using the written actual reference voltage as the reference source, the ADC internal channel voltage bias can be optimized, and the individual differences of each chip in the ADC can be effectively eliminated, and the sampling accuracy of a single sampling point of the ADC can be improved. This scheme has no abnormalities in wafer and customer verification, can be mass-produced and shipped, and is beneficial to promotion and application.
[0084] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0085] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0086] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for controlling the precision of an analog-to-digital converter, characterized in that: include: For each chip in the analog-to-digital converter, adjusting the input voltage or output voltage inside the chip; After the input voltage or output voltage is adjusted, measuring and recording the actual reference voltage of the analog signal in the internal channel of the chip; Sampling based on the actual reference voltage to obtain a measurement value of the analog-to-digital converter; Based on the actual reference voltage and the measured value, a voltage conversion formula of the analog-to-digital converter is adjusted.
2. The method for controlling the precision of an analog-to-digital converter according to claim 1, characterized in that: The adjusting the input voltage or output voltage inside the chip includes: Determining a target voltage level of the chip; The input voltage or the output voltage is adjusted with the target voltage level as the adjustment target.
3. The method for controlling the precision of an analog-to-digital converter according to claim 1, characterized in that: The measuring and recording of the actual reference voltage of the analog signal in the internal channel of the chip includes: In the CP test mode, measuring the actual reference voltage of the analog signal in the internal channel of the chip; The actual reference voltage is written into the information area of the chip.
4. The method for controlling the precision of an analog-to-digital converter according to claim 3, characterized in that: The step of writing the actual reference voltage into the information area of the chip comprises: The actual reference voltage is stored in a register set in the chip, and the register supports setting or reading the actual reference voltage.
5. The method for controlling the precision of an analog-to-digital converter according to claim 1, characterized in that: The voltage conversion formula of the analog-to-digital converter is adjusted based on the actual reference voltage and the measured value, including: using the actual reference voltage as a reference source, combining the sampling accuracy of the analog-to-digital converter and the measured value, and calculating the conversion voltage of the analog-to-digital converter.
6. The method for controlling the precision of an analog-to-digital converter according to claim 5, characterized in that: The step of using the actual reference voltage as a reference source, combining the sampling accuracy of the analog-to-digital converter and the measured value, and calculating the conversion voltage of the analog-to-digital converter comprises: The actual reference voltage is used as a reference source, and the sampling voltage is calculated based on the following formula: Wherein, VCCA is the sampling voltage of the analog-to-digital converter; 4096 is the sampling accuracy of the analog-to-digital converter; ADC dout is the measured value of the analog-to-digital converter; VRFEFINT is the actual reference voltage of the analog-to-digital converter.
7. The method for controlling the precision of an analog-to-digital converter according to claim 1, characterized in that: The sampling based on the actual reference voltage to obtain the measurement value of the analog-to-digital converter includes: Periodically extracting samples from the analog signal stream of the internal channel of the chip based on the actual reference voltage; The samples are quantized and encoded to obtain the measured values of the analog-to-digital converter.
8. The method for controlling the precision of an analog-to-digital converter according to claim 7, characterized in that: The sampling frequency of the analog-to-digital converter is more than twice the highest frequency of the analog signal.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the analog-to-digital converter accuracy control method according to any one of claims 1 to 8 when executing the program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program, and when the computer program is executed, the electronic device where the computer-readable storage medium is located is controlled to execute the analog-to-digital converter accuracy control method according to any one of claims 1 to 8.