Reference voltage calibration method and device of analog-to-digital converter, equipment and medium

By obtaining and adjusting the reference voltage of the analog-to-digital converter, the problem of low accuracy of the reference voltage of the analog-to-digital converter during the microcontroller burning process is solved, and the success rate of burning is improved.

CN119315984APending Publication Date: 2025-01-14HUNAN PINTENG ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411385928.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The existing analog-to-digital converters have low accuracy in the reference voltage during the microcontroller recording process, resulting in failure of burning when the burning voltage exceeds the range.

Method used

By obtaining the initial reference voltage, burn voltage, and calibration voltage of the target analog-to-digital converter, converting it into a digital signal, and calculating the reference voltage from these signals, adjusting the initial reference voltage to improve its accuracy.

Benefits of technology

The accuracy of the analog-to-digital converter reference voltage is improved, avoiding burn-out failure and ensuring that the burn-out voltage is within the effective range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119315984A_ABST
    Figure CN119315984A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of analog-to-digital converters, and provides a reference voltage calibration method and device for an analog-to-digital converter, equipment and a medium, and the method comprises the steps: obtaining an initial reference voltage of a target analog-to-digital converter, a corresponding burning voltage and a calibration voltage; converting the burning voltage into a first voltage digital signal, and converting the calibration voltage into a second voltage digital signal; calculating a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating a second reference voltage according to the second voltage digital signal; and adjusting the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter. According to the reference voltage calibration method, the accuracy of the reference voltage of the analog-to-digital converter can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of analog-to-digital converters, and in particular to a reference voltage calibration method, device, equipment and medium for an analog-to-digital converter. Background Art

[0002] In computer professional terminology, LINK is a tool for microcontroller programming, debugging and burning; that is, it includes the link process at the software level, and also covers the hardware burning and debugging tools. It is an indispensable part of the microcontroller development process (hereinafter referred to as PT LINK).

[0003] ADC is the abbreviation of Analog-to-Digital Converter, which refers to an analog / digital converter, a device that converts continuously changing analog signals into discrete digital signals.

[0004] PT LINK requires high voltage when programming MTP and OTP type microcontroller chips. The success of programming is related to the high voltage line of the programming voltage (VPP). When the VPP voltage exceeds the programming voltage range, the programming will fail. This VPP programming voltage is output by adjusting the duty cycle of PWM to different voltages. After being converted into a digital signal by ADC, the program determines whether the current VPP voltage is within the programming range. If it is not within the range, it is adjusted. In this process, if the ADC reference voltage deviates, the VPP programming voltage will also deviate. Even if it is adjusted, there will be deviations. When it exceeds the programming voltage range, the programming will fail. It can be seen that the existing analog-to-digital converter has the problem of low accuracy of the reference voltage. Summary of the invention

[0005] The present application provides a reference voltage calibration method for an analog-to-digital converter, which can solve the problem of low accuracy of the reference voltage of the analog-to-digital converter.

[0006] In a first aspect, an embodiment of the present application provides a reference voltage calibration method for an analog-to-digital converter, the reference voltage calibration method comprising:

[0007] Obtain the initial reference voltage of the target analog-to-digital converter and the corresponding burning voltage and calibration voltage; the burning voltage is the voltage in the boost circuit, and the calibration voltage is the voltage in the calibration circuit;

[0008] Converting the burning voltage into a first voltage digital signal, and converting the calibration voltage into a second voltage digital signal;

[0009] Calculating a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating a second reference voltage according to the second voltage digital signal;

[0010] The initial reference voltage is adjusted according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter.

[0011] Optionally, the boost circuit includes a first capacitor, a second capacitor, a third capacitor, an inductor, a first resistor, a second resistor, a third resistor, a fourth resistor, a fifth resistor, a diode, a first switch tube, a second switch tube, and a third switch tube:

[0012] The first end of the first capacitor is respectively connected to the input voltage and the first end of the inductor, the second end of the first capacitor is respectively connected to the ground end, the second end of the fifth resistor, the source of the first switch tube, the second end of the second capacitor, the second end of the second resistor, the second end of the third capacitor, the second end of the fourth resistor, and the second end of the second switch tube, the first end of the fifth resistor is respectively connected to the gate of the first switch tube, the drain of the first switch tube is respectively connected to the second end of the inductor and the source of the diode, the drain of the diode is respectively connected to the first end of the second capacitor, the first end of the first resistor, the first end of the third resistor, and the drain of the third switch tube, the second end of the first resistor is respectively connected to the first end of the second resistor and the first end of the third capacitor, the second end of the third resistor is respectively connected to the gate of the third switch tube and the drain of the second switch tube, and the first end of the fourth switch tube is connected to the gate of the second switch tube;

[0013] The voltage at the first end of the first resistor is the programming voltage, and the voltage at the source of the third switch tube is the output voltage of the boost circuit.

[0014] Optionally, the calibration circuit includes a first calibration capacitor, a calibration chip, a second calibration capacitor, a first calibration resistor, and a second calibration resistor:

[0015] The second end of the first calibration capacitor is connected to the ground end, the first end of the first calibration capacitor is respectively connected to the input voltage and the fourth pin of the calibration chip, the eighth pin of the calibration chip is respectively connected to the first end of the second calibration capacitor, the second end of the first calibration resistor, and the first end of the second calibration resistor, the seventh pin of the calibration chip is respectively connected to the second end of the second calibration capacitor, the second end of the second calibration resistor, and the ground end, and the voltage of the first end of the first calibration resistor is the output voltage of the calibration circuit;

[0016] The output voltage of the calibration circuit is the calibration voltage.

[0017] Optionally, calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage includes:

[0018] By formula:

[0019]

[0020] Calculating a first reference voltage VAL1;

[0021] ADC_CODE1 represents the first voltage digital signal, and VREF represents the initial reference voltage.

[0022] Optionally, calculating the second reference voltage according to the second voltage digital signal includes:

[0023] By formula:

[0024]

[0025] Calculating a second reference voltage VAL2;

[0026] Wherein, ADC_CODE2 represents the second voltage digital signal.

[0027] Optionally, adjusting the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter includes:

[0028] calculating a difference between the first reference voltage and the second reference voltage;

[0029] Determining whether the difference satisfies a termination condition;

[0030] If the difference satisfies the termination condition, the number of iterations is increased by 1, and it is determined whether the number of iterations is greater than or equal to a preset number of iterations;

[0031] If the number of iterations is greater than or equal to the preset number of iterations, the initial reference voltage is used as the final reference voltage of the target analog-to-digital converter;

[0032] If the number of iterations is less than the preset number of iterations, returning to the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating the second reference voltage according to the second voltage digital signal;

[0033] If the difference does not meet the termination condition, the number of iterations is cleared to 0, the initial reference voltage is adjusted, and the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage and calculating the second reference voltage according to the second voltage digital signal is returned to.

[0034] Optionally, the termination condition is:

[0035] The difference is less than the preset difference.

[0036] In a second aspect, an embodiment of the present application provides a reference voltage calibration device for an analog-to-digital converter, comprising:

[0037] An acquisition module is used to acquire the initial reference voltage of the target analog-to-digital converter and the corresponding burning voltage and calibration voltage; the burning voltage is the voltage in the boost circuit, and the calibration voltage is the voltage in the calibration circuit;

[0038] A conversion module, converting the burning voltage into a first voltage digital signal, and converting the calibration voltage into a second voltage digital signal;

[0039] A calculation module, calculating a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating a second reference voltage according to the second voltage digital signal;

[0040] The adjustment module adjusts the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter.

[0041] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the reference voltage calibration method of the analog-to-digital converter when executing the computer program.

[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the reference voltage calibration method of the above-mentioned analog-to-digital converter.

[0043] The above solution of the present application has the following beneficial effects:

[0044] In an embodiment of the present application, the initial reference voltage of the target analog-to-digital converter and the corresponding burning voltage and calibration voltage are obtained, and then the burning voltage is converted into a first voltage digital signal, and the calibration voltage is converted into a second voltage digital signal, and then the first reference voltage is calculated according to the first voltage digital signal and the initial reference voltage, and the second reference voltage is calculated according to the second voltage digital signal, and finally the initial reference voltage is adjusted according to the first reference voltage and the second reference voltage, so as to obtain the final reference voltage of the target analog-to-digital converter. The burning voltage and the calibration voltage are converted and calculated respectively, and an accurate second reference voltage is provided for the target analog-to-digital converter, which is compared with the first reference voltage corresponding to the target analog-to-digital converter, so as to adjust the initial reference voltage according to the first reference voltage and the second reference voltage, and improve the accuracy of the reference voltage of the analog-to-digital converter.

[0045] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 A flowchart of a reference voltage calibration method for an analog-to-digital converter provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of a topological structure of a boost circuit provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of a topological structure of a calibration circuit provided in an embodiment of the present application;

[0050] Figure 4 A schematic diagram of the structure of a reference voltage calibration system for an analog-to-digital converter provided in one embodiment of the present application;

[0051] Figure 5 A first connection diagram provided for an embodiment of the present application;

[0052] Figure 6 A second connection diagram provided in an embodiment of the present application;

[0053] Figure 7 A third connection diagram provided for an embodiment of the present application;

[0054] Figure 8 A schematic diagram of the structure of a reference voltage calibration device for an analog-to-digital converter provided in one embodiment of the present application;

[0055] Fig. 9 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0056] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0057] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0058] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0059] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0060] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0061] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0062] In view of the problem of low accuracy of reference voltage in existing analog-to-digital converters, an embodiment of the present application provides a reference voltage calibration method for an analog-to-digital converter, wherein the reference voltage calibration method obtains the initial reference voltage, the burning voltage, and the calibration voltage of the target analog-to-digital converter, then uses the target analog-to-digital converter to convert the burning voltage into a first voltage digital signal, and then uses the calibration analog-to-digital converter to convert the calibration voltage into a second voltage digital signal, then calculates the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculates the second reference voltage according to the second voltage digital signal, and finally adjusts the initial reference voltage according to the first reference voltage and the second reference voltage to obtain the final reference voltage of the target analog-to-digital converter. The burning voltage and the calibration voltage are converted by the target analog-to-digital converter and the calibration analog-to-digital converter, respectively, so that the calibration analog-to-digital converter provides an accurate second reference voltage for the target analog-to-digital converter, which is compared with the first reference voltage corresponding to the target analog-to-digital converter, so as to adjust the initial reference voltage according to the first reference voltage and the second reference voltage, thereby improving the accuracy of the reference voltage of the analog-to-digital converter.

[0063] Next, the reference voltage calibration method of the analog-to-digital converter provided in the present application is exemplified.

[0064] like Figure 1 As shown, the reference voltage calibration method of the analog-to-digital converter provided in the present application includes the following steps:

[0065] Step 11, obtaining the initial reference voltage of the target analog-to-digital converter and the corresponding burning voltage and calibration voltage.

[0066] The target analog-to-digital converter is an analog-to-digital converter that needs to be calibrated with a reference voltage. The reference voltage in the analog-to-digital converter is connected to the boost circuit in the TP LINK, which affects the voltage of the boost circuit that is finally output when the TP LINK is burned. The size of the calibration voltage is not limited, and any voltage close to the burning range can be used.

[0067] In some embodiments of the present application, the programming voltage is the voltage in the boost circuit in the TP LINK corresponding to the target analog-to-digital converter. The topology of the boost circuit is as follows: Figure 2As shown, the boost circuit includes: a first capacitor C11, a second capacitor C12, a third capacitor C7, an inductor L1, a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4, a fifth resistor R16, a diode D1, a first switch tube Q1, a second switch tube Q2, and a third switch tube Q3. The first end of the first capacitor is respectively connected to the input voltage 5V and the first end of the inductor, the second end of the first capacitor is respectively connected to the ground terminal GND, the second end of the fifth resistor, the source of the first switch tube, the second end of the second capacitor, the second end of the second resistor, the second end of the third capacitor, the second end of the fourth resistor, and the second end of the second switch tube, the first end of the fifth resistor is respectively connected to the PWM control signal and the gate of the first switch tube, the drain of the first switch tube is respectively connected to the second end of the inductor and the source of the diode, the drain of the diode is respectively connected to the first end of the second capacitor, the first end of the first resistor, T1, the first end of the third resistor, and the drain of the third switch tube, the second end of the first resistor is respectively connected to the first end of the second resistor and the first end of the third capacitor, the second end of the third resistor is respectively connected to the gate of the third switch tube and the drain of the second switch tube, and the first end of the fourth switch tube is connected to the gate of the second switch tube. C11 is 100uF / 16V, C7 is 0.1uF, C12 is 10uF, L1 is 6.8uH, R16 is 10K ohms, R1 is 680R1%, R1 is 300R1%, 3401 and 3402 represent the models of the switching tubes, IN5819 represents the model of the diode, the voltage at the first end of the first resistor is the voltage VPP (i.e., the burning voltage), the voltage at the first end of the third capacitor is the voltage AD_VPP (an end directly or indirectly connected to the reference voltage of the analog-to-digital converter), the voltage at the first end of the fourth resistor is the voltage VPP_EN (used to switch the VPP voltage in the boost circuit, when turned on, the VPP point is connected to the VPP_OUT point), and the voltage at the source of the third switching tube is the output voltage VPP_OUT (i.e., the voltage when TP LINK is burning).

[0068] In the above boost circuit, a fixed VPP voltage is obtained by outputting a fixed duty cycle at the PWM point. When PWM is high, Q1 is turned on and L1 is charged. When PWM is low, Q1 is turned off and L1 is discharged. When VPP_EN is high, the calibration module obtains the VPP_OUT voltage; when VPP_EN is high, VPP = VPP_OUT.

[0069] It should be noted that, due to the voltage division of R1 and R2 in the boost circuit, the voltage is reduced to within the measurable range of the reference voltage, and the programming voltage is 3 / 9.8 times the voltage VPP when R1 and R2 are not added.

[0070] The calibration voltage is the voltage in the calibration circuit in the calibration analog-to-digital converter. The topology of the calibration circuit is as follows: Figure 3As shown, it includes a first calibration capacitor C1, a calibration chip U1, a second calibration capacitor C2, a first calibration resistor R1, and a second calibration resistor R2. The second end of the first calibration capacitor is connected to the ground terminal GND, the first end of the first calibration capacitor is respectively connected to the input voltage 3.3V and the fourth pin (VDD pin) of the calibration chip, the eighth pin (P10 / AD0 pin) of the calibration chip is respectively connected to the first end of the second calibration capacitor, the second end of the first calibration resistor, and the first end of the second calibration resistor, the seventh pin (VSS pin) of the calibration chip is respectively connected to the second end of the second calibration capacitor, the second end of the second calibration resistor, and the ground terminal, the voltage of the first end of the first calibration resistor is the output voltage VPP_OUT (i.e., the calibration voltage), the first pin (CMOD / P05 pin) of the calibration chip is used to connect other loads, the second pin (P00 pin) is used to transmit the data signal PDA, the third pin (TCH11 / P01 pin) is used to transmit the clock signal PCL, the fifth pin (P03+P04 pins) is used to transmit the indicator light off signal LED_NG, and the sixth pin (P17 / AD4 pin) is used to transmit the indicator light on signal LED_OK. In the figure, C1 is 0.1uF, C2 is 10nF, R1 is 10K1%, R2 is 1K1%, and the model of the calibration chip is PT8M2305S8.

[0071] It is understandable that not all pins in the above calibration chip are used in the calibration circuit. While ensuring the normal operation of the above calibration circuit, other pins can be used according to actual conditions.

[0072] It should be noted that, due to the voltage division of R1 and R2 in the calibration circuit, the voltage is reduced to within the measurable range of the reference voltage, and the calibration voltage is 1 / 11 times the voltage VPP_OUT when R1 and R2 are not added.

[0073] Exemplarily, a voltage measuring device such as a multimeter may be used to obtain an initial reference voltage, a burning voltage, and a calibration voltage.

[0074] Step 12: convert the programming voltage into a first voltage digital signal, and convert the calibration voltage into a second voltage digital signal.

[0075] In some embodiments of the present application, a target analog-to-digital converter is used to convert the programming voltage into a first voltage digital signal, and a calibration analog-to-digital converter is used to convert the calibration voltage into a second voltage digital signal.

[0076] It should be noted that the calibration analog-to-digital converter is an analog-to-digital converter that is manually selected or has been calibrated and has a higher accuracy value than the target analog-to-digital converter.

[0077] It is worth mentioning that the voltage is converted from an analog signal to a digital signal by using a target analog-to-digital converter and a calibration analog-to-digital converter to convert the voltage respectively, thereby providing a data form suitable for calculation for subsequent steps.

[0078] Step 13, calculating a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating a second reference voltage according to the second voltage digital signal.

[0079] It should be noted that, since the accuracy value of the calibration ADC is higher than that of the target ADC, and since the voltage converted by the calibration ADC is the calibration voltage, the accuracy value of the second reference voltage is greater than that of the first reference voltage.

[0080] Specifically, through the formula:

[0081]

[0082] A first reference voltage VAL1 is calculated.

[0083] ADC_CODE1 represents the first voltage digital signal, and VREF represents the initial reference voltage.

[0084] By formula:

[0085]

[0086] The second reference voltage VAL2 is calculated.

[0087] Wherein, ADC_CODE2 represents the second voltage digital signal.

[0088] It is worth mentioning that the second voltage digital signal is obtained by converting the calibration voltage as the calibration voltage by a highly accurate calibration analog-to-digital converter, so the second reference voltage calculated according to the second voltage digital signal can be used as a standard voltage to provide a standard for the first reference voltage.

[0089] Step 14: adjusting the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter.

[0090] In some embodiments of the present application, the step of adjusting the initial reference voltage according to the first reference voltage and the second reference voltage to obtain the final reference voltage of the target analog-to-digital converter is specifically:

[0091] In the first step, the difference between the first reference voltage and the second reference voltage is calculated.

[0092] The second step is to determine whether the difference meets the termination condition.

[0093] If the difference meets the termination condition, the number of iterations is increased by 1, and it is determined whether the number of iterations is greater than or equal to the preset number of iterations.

[0094] If the number of iterations is greater than or equal to the preset number of iterations, the initial reference voltage is used as the final reference voltage of the target analog-to-digital converter.

[0095] If the number of iterations is less than the preset number of iterations, the process returns to the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating the second reference voltage according to the second voltage digital signal.

[0096] If the difference does not meet the termination condition, the number of iterations is cleared to 0, the initial reference voltage is adjusted, and the process returns to the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating the second reference voltage according to the second voltage digital signal.

[0097] It should be noted that the initial value of the number of iterations is 0, and the above termination condition is that the difference is less than the preset difference.

[0098] Exemplarily, the preset number of iterations is 5, and the preset difference is 200mV. After adjusting the initial reference voltage, the difference values ​​obtained for 5 consecutive times must be less than 200mV before the process ends. Each time the initial reference voltage is adjusted, the process returns to the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating the second reference voltage according to the second voltage digital signal, and iterates by obtaining the difference value. If the first difference value is 198mV, the next iteration will continue. The second difference value of 245mV is greater than the preset difference value of 200mV, and the termination condition is not met, and the current round of initial reference voltage adjustment fails. The initial reference voltage is adjusted again, and the process returns to the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating the second reference voltage according to the second voltage digital signal, and iterates by obtaining the difference value again. When the difference values ​​of the 5 iterations are 196mV, 126mV, 171mV, 156mV, and 165mV, respectively, the termination condition is met, and the initial reference voltage value adjusted this time is used as the final reference voltage.

[0099] It is worth mentioning that the burning voltage and the calibration voltage are converted and calculated respectively, providing an accurate second reference voltage for the target analog-to-digital converter, which is compared with the first reference voltage corresponding to the target analog-to-digital converter, so as to adjust the initial reference voltage according to the first reference voltage and the second reference voltage, thereby improving the accuracy of the reference voltage of the analog-to-digital converter.

[0100] The reference voltage calibration system for the analog-to-digital converter provided in the present application is exemplarily described below with reference to a specific example.

[0101] like Figure 4As shown, the reference voltage calibration system includes a PT burner, a PT LINK, a calibration module, and a LINK STM32 burner. The PT burner is used to download the ini firmware to the PT LINK, the ini firmware includes a computer program for implementing the reference voltage method of the analog-to-digital converter provided in the present application, the calibration module is used to obtain the calibration voltage after receiving the calibration instruction from the PT LINK, and convert the calibration voltage into a second voltage digital signal, and then send the second voltage digital signal to the PT LINK, the LINK STM32 burner is used to update the Bootloader to the PT LINK, and the Bootloader is used to load a computer program for implementing the functions of single-chip microcomputer debugging, programming, and burning for the PT LINK. The LINK STM32 burner is connected to the PT LINK, and the connection method is as follows. Figure 5 As shown, the power supply VDD pin of the LINK STM32 programmer is connected to the first VDD pin (power supply pin) of the PT LINK, the SWD pin of the LINK STM32 programmer is connected to the SWD pin of the PT LINK, the SWG pin of the LINK STM32 programmer is connected to the SWG pin of the PTLINK, and the VSS (ground) pin of the LINK STM32 programmer is connected to the first VSS pin of the PT LINK. The PT programmer is connected to the PT LINK in the following way: Figure 6 As shown, the VSS pin of the PT writer is connected to the second VSS pin of the PT LINK, the VDD pin of the PT writer is connected to the second VDD pin of the PT LINK, the PDA pin of the PT writer is connected to the first PDA (data signal transmission) pin of the PT LINK, the PCL pin of the PT writer is connected to the first PCL (clock signal transmission) pin of the PT LINK, and the VPP pin of the PT writer is connected to the VPP pin of the PT LINK. The calibration module is connected to the PT LINK, and the connection method is attached. Figure 7 As shown, the VSS pin of the calibration module is connected to the third VSS pin of PT LINK, the VDD pin of the calibration module is connected to the third VDD pin of PTLINK, the PDA pin of the calibration module is connected to the second PDA pin of PT LINK, and the PCL pin of the calibration module is connected to the second PCL pin of PT LINK.

[0102] In some embodiments of the present application, in order to prevent PT LINK from accidentally triggering the calibration procedure at the user end, the reference voltage calibration system only supports one calibration process for PT LINK. Pressing the calibration button of PT LINK again will not execute the calibration process, thereby avoiding the occurrence of erroneous calibration actions at the user end.

[0103] The reference voltage calibration device for the analog-to-digital converter provided in the present application is exemplarily described below.

[0104] like Figure 8 As shown, an embodiment of the present application provides a reference voltage calibration device for an analog-to-digital converter, and the reference voltage calibration device 800 for the analog-to-digital converter includes:

[0105] The acquisition module 801 acquires the initial reference voltage of the target analog-to-digital converter and the corresponding burning voltage and calibration voltage; the burning voltage is the voltage in the boost circuit, and the calibration voltage is the voltage in the calibration circuit;

[0106] A conversion module 802 converts the programming voltage into a first voltage digital signal, and converts the calibration voltage into a second voltage digital signal;

[0107] A calculation module 803 calculates a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculates a second reference voltage according to the second voltage digital signal;

[0108] The adjustment module 804 adjusts the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter.

[0109] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0110] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0111] like Fig. 9 As shown, an embodiment of the present application provides a terminal device. The terminal device D10 of this embodiment includes: at least one processor D100 ( Fig. 9Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above-mentioned method embodiments when executing the computer program D102.

[0112] Specifically, when the processor D100 executes the computer program D102, the initial reference voltage, the burning voltage, and the calibration voltage of the target analog-to-digital converter are obtained, and then the burning voltage is converted into a first voltage digital signal by using the target analog-to-digital converter, and then the calibration voltage is converted into a second voltage digital signal by using the calibration analog-to-digital converter, and then the first reference voltage is calculated according to the first voltage digital signal and the initial reference voltage, and the second reference voltage is calculated according to the second voltage digital signal, and finally the initial reference voltage is adjusted according to the first reference voltage and the second reference voltage to obtain the final reference voltage of the target analog-to-digital converter. The burning voltage and the calibration voltage are converted by using the target analog-to-digital converter and the calibration analog-to-digital converter respectively, so that the calibration analog-to-digital converter provides an accurate second reference voltage for the target analog-to-digital converter, which is compared with the first reference voltage corresponding to the target analog-to-digital converter, so that the initial reference voltage is adjusted according to the first reference voltage and the second reference voltage, and the accuracy of the reference voltage of the analog-to-digital converter is improved.

[0113] The processor D100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0114] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), a secure digital (SD, Secure Digital) card, a flash card (Flash Card), etc. equipped on the terminal device D10. Further, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data and other programs, such as the program code of the computer program, etc. The memory D101 may also be used to temporarily store data that has been output or is to be output.

[0115] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0116] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code to the reference voltage calibration method device / terminal device of the analog-to-digital converter. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0118] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0119] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0120] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A reference voltage calibration method for an analog-to-digital converter, characterized in that: include: Obtaining an initial reference voltage of a target analog-to-digital converter and a corresponding burning voltage and calibration voltage; the burning voltage is the voltage in a boost circuit, and the calibration voltage is the voltage in a calibration circuit; Converting the burning voltage into a first voltage digital signal, and converting the calibration voltage into a second voltage digital signal; Calculating a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating a second reference voltage according to the second voltage digital signal; The initial reference voltage is adjusted according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter.

2. The reference voltage calibration method according to claim 1, characterized in that: The boost circuit includes a first capacitor, a second capacitor, a third capacitor, an inductor, a first resistor, a second resistor, a third resistor, a fourth resistor, a fifth resistor, a diode, a first switch tube, a second switch tube, and a third switch tube: The first end of the first capacitor is respectively connected to the input voltage and the first end of the inductor, the second end of the first capacitor is respectively connected to the ground end, the second end of the fifth resistor, the source of the first switch tube, the second end of the second capacitor, the second end of the second resistor, the second end of the third capacitor, the second end of the fourth resistor, and the second end of the second switch tube, the first end of the fifth resistor is respectively connected to the gate of the first switch tube, the drain of the first switch tube is respectively connected to the second end of the inductor and the source of the diode, the drain of the diode is respectively connected to the first end of the second capacitor, the first end of the first resistor, the first end of the third resistor, and the drain of the third switch tube, the second end of the first resistor is respectively connected to the first end of the second resistor and the first end of the third capacitor, the second end of the third resistor is respectively connected to the gate of the third switch tube and the drain of the second switch tube, and the first end of the fourth switch tube is connected to the gate of the second switch tube; The voltage at the first end of the first resistor is the programming voltage, and the voltage at the source of the third switch tube is the output voltage of the boost circuit.

3. The reference voltage calibration method according to claim 1, characterized in that: The calibration circuit includes a first calibration capacitor, a calibration chip, a second calibration capacitor, a first calibration resistor, and a second calibration resistor: The second end of the first calibration capacitor is connected to the ground end, the first end of the first calibration capacitor is respectively connected to the input voltage and the fourth pin of the calibration chip, the eighth pin of the calibration chip is respectively connected to the first end of the second calibration capacitor, the second end of the first calibration resistor, and the first end of the second calibration resistor, the seventh pin of the calibration chip is respectively connected to the second end of the second calibration capacitor, the second end of the second calibration resistor, and the ground end, and the voltage of the first end of the first calibration resistor is the output voltage of the calibration circuit; The output voltage of the calibration circuit is the calibration voltage.

4. The reference voltage calibration method according to claim 1, characterized in that: The calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage comprises: By formula: Calculating a first reference voltage VAL1; ADC_CODE1 represents the first voltage digital signal, and VREF represents the initial reference voltage.

5. The reference voltage calibration method according to claim 1, characterized in that: The calculating the second reference voltage according to the second voltage digital signal comprises: By formula: Calculating a second reference voltage VAL2; Wherein, ADC_CODE2 represents the second voltage digital signal.

6. The reference voltage calibration method according to claim 1, characterized in that: The adjusting the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter includes: calculating a difference between the first reference voltage and the second reference voltage; Determining whether the difference satisfies a termination condition; If the difference satisfies the termination condition, the number of iterations is increased by 1, and it is determined whether the number of iterations is greater than or equal to a preset number of iterations; If the number of iterations is greater than or equal to the preset number of iterations, the initial reference voltage is used as the final reference voltage of the target analog-to-digital converter; If the number of iterations is less than the preset number of iterations, returning to the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating the second reference voltage according to the second voltage digital signal; If the difference does not meet the termination condition, the number of iterations is cleared to 0, the initial reference voltage is adjusted, and the step of calculating the first reference voltage according to the first voltage digital signal and the initial reference voltage and calculating the second reference voltage according to the second voltage digital signal is returned to.

7. The reference voltage calibration method according to claim 6, characterized in that: The termination conditions are: The difference is smaller than a preset difference.

8. A reference voltage calibration device for an analog-to-digital converter, comprising: The acquisition module obtains the initial reference voltage of the target analog-to-digital converter and the corresponding burning voltage and calibration voltage; The burning voltage is the voltage in the boost circuit, and the calibration voltage is the voltage in the calibration circuit; A conversion module, converting the burning voltage into a first voltage digital signal, and converting the calibration voltage into a second voltage digital signal; a calculation module, calculating a first reference voltage according to the first voltage digital signal and the initial reference voltage, and calculating a second reference voltage according to the second voltage digital signal; An adjustment module adjusts the initial reference voltage according to the first reference voltage and the second reference voltage to obtain a final reference voltage of the target analog-to-digital converter.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the reference voltage calibration method of the analog-to-digital converter according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the reference voltage calibration method of the analog-to-digital converter according to any one of claims 1 to 7 is implemented.