WO2021196088A1 - Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium - Google Patents

Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium Download PDF

Info

Publication number
WO2021196088A1
WO2021196088A1 PCT/CN2020/082816 CN2020082816W WO2021196088A1 WO 2021196088 A1 WO2021196088 A1 WO 2021196088A1 CN 2020082816 W CN2020082816 W CN 2020082816W WO 2021196088 A1 WO2021196088 A1 WO 2021196088A1
Authority
WO
WIPO (PCT)
Prior art keywords
analog
voltage
digital conversion
measured
standard
Prior art date
Application number
PCT/CN2020/082816
Other languages
French (fr)
Chinese (zh)
Inventor
程顺均
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2020/082816 priority Critical patent/WO2021196088A1/en
Priority to CN202080001594.1A priority patent/CN111819796B/en
Publication of WO2021196088A1 publication Critical patent/WO2021196088A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/06Continuously compensating for, or preventing, undesired influence of physical parameters
    • H03M1/0617Continuously compensating for, or preventing, undesired influence of physical parameters characterised by the use of methods or means not specific to a particular type of detrimental influence
    • H03M1/0619Continuously compensating for, or preventing, undesired influence of physical parameters characterised by the use of methods or means not specific to a particular type of detrimental influence by dividing out the errors, i.e. using a ratiometric arrangement
    • H03M1/0621Continuously compensating for, or preventing, undesired influence of physical parameters characterised by the use of methods or means not specific to a particular type of detrimental influence by dividing out the errors, i.e. using a ratiometric arrangement with auxiliary conversion of a value corresponding to the physical parameter(s) to be compensated for
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/002Provisions or arrangements for saving power, e.g. by allowing a sleep mode, using lower supply voltage for downstream stages, using multiple clock domains or by selectively turning on stages when needed
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/12Analogue/digital converters
    • H03M1/34Analogue value compared with reference values

Definitions

  • This application relates to the field of electronic technology, and in particular to an analog-to-digital conversion method, device, chip, electronic equipment, and storage medium.
  • ADC Analog-to-digital conversion technology
  • V in is the input signal
  • V ref is the reference voltage.
  • the reference voltage In order to avoid the ADC saturation caused by the excessive difference between the value of the reference voltage and the maximum value of the input signal, the reference voltage needs to be dynamically adjusted according to the application scenario. In order to flexibly adjust the specific value of the reference voltage, the reference voltage is provided by an external input circuit, thereby avoiding the ADC saturation problem.
  • the related technology has at least the following problem: when the reference voltage is provided through an external input circuit, the reference voltage is easily affected by circuit noise and fluctuates, which in turn causes deviations in the ADC conversion result and affects the performance of the signal processing system.
  • the purpose of some embodiments of this application is to provide an analog-to-digital conversion method, device, chip, electronic device, and storage medium, to avoid the deviation of the analog-to-digital conversion caused by the fluctuation of the reference voltage, and to ensure the accuracy of the digital-to-analog conversion result.
  • An embodiment of the present application provides an analog-to-digital conversion method, including: obtaining a measured value of a voltage to be measured after analog-to-digital conversion under a preset reference voltage; obtaining a standard voltage after performing analog-to-digital conversion under the same preset reference voltage Determine the reference voltage fluctuation coefficient according to the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage; determine the reference voltage fluctuation coefficient according to the reference voltage fluctuation coefficient; The measured value of the measured voltage is compensated, and the compensated measured value is output as the analog-to-digital conversion result of the measured voltage.
  • the embodiment of the present application also provides an analog-to-digital conversion device, including: an analog-to-digital conversion unit and a calculation unit; the analog-to-digital conversion unit is used to perform analog-to-digital conversion on the standard voltage and the voltage to be measured to obtain the standard voltage And the measured value of the voltage to be measured after analog-to-digital conversion under the same preset reference voltage; the calculation unit is configured to perform analog-to-digital conversion according to the measured value of the standard voltage under the preset reference voltage Determine the reference voltage fluctuation coefficient with the standard value, and compensate the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient, and output the compensated measured value as an analog-to-digital conversion result of the voltage to be measured.
  • an analog-to-digital conversion device including: an analog-to-digital conversion unit and a calculation unit; the analog-to-digital conversion unit is used to perform analog-to-digital conversion on the standard voltage and the voltage to be measured to obtain the standard voltage And the measured value of the voltage to be measured
  • the embodiment of the present application also provides an analog-to-digital conversion chip, the analog-to-digital conversion chip is connected to at least one memory, and the memory stores instructions that can be executed by the analog-to-digital conversion chip.
  • the digital conversion chip is executed, so that the analog-to-digital conversion chip can perform the above-mentioned analog-to-digital conversion method.
  • An embodiment of the present application also provides an electronic device, including a memory, and the above-mentioned analog-to-digital conversion chip, and the memory is in communication connection with the analog-to-digital conversion chip.
  • the embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the above-mentioned analog-to-digital conversion method is implemented.
  • the embodiment of the present application determines the analog-to-digital conversion process according to the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage when performing the analog-to-digital conversion of the voltage to be measured According to the reference voltage fluctuation coefficient in the reference voltage, the measured value after the analog-to-digital conversion of the voltage to be measured under the same preset reference voltage is compensated according to the reference voltage fluctuation coefficient, and the compensated measurement value is output as the analog-to-digital conversion result of the voltage to be measured .
  • the standard voltage is an internal constant voltage, which is generally about half of the lowest working voltage of the analog-to-digital converter. It is not affected by the change of the reference voltage value.
  • Standard value determine the fluctuation of the conversion result during the analog-to-digital conversion process, and use the fluctuation of the standard voltage analog-to-digital conversion process as a reference for the fluctuation of the voltage to be measured during the analog-to-digital conversion process, and then the measurement after the analog-to-digital conversion of the voltage to be measured
  • the value is compensated, which solves the problem that the analog-to-digital conversion result in the prior art will deviate due to the fluctuation of the reference voltage, ensures the accuracy of the analog-to-digital conversion result, and avoids the performance of the signal processing system due to the deviation of the analog-to-digital conversion result. Influence.
  • the determining the reference voltage fluctuation coefficient according to the measured value and the standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage includes: according to the standard voltage under the preset reference voltage
  • the ratio of the standard value after the analog-to-digital conversion to the measured value determines the fluctuation coefficient of the reference voltage.
  • the reference voltage fluctuation coefficient is determined by the ratio between the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and the ratio between the measured value and the standard value is used to accurately compare the analog-to-digital value.
  • the fluctuations in the conversion process are measured.
  • the compensating the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient includes: compensating the measured value of the voltage to be measured according to the following formula
  • D c is the measured value after compensation
  • DATA1 is the measured value of the standard voltage
  • D ref is the standard value of the standard voltage
  • DATA2 is the measured value of the voltage to be measured.
  • the measured value of the voltage to be measured is multiplied by the determined fluctuation coefficient, so as to accurately base on the fluctuation of the standard voltage The situation is to compensate the measured value of the voltage to be measured to ensure the accuracy of the analog-to-digital conversion result of the voltage to be measured.
  • the method further includes: obtaining the standard voltage for calibration The reference voltage and the calibration value of the standard voltage after analog-to-digital conversion under the calibration reference voltage; according to the preset reference voltage, the calibration reference voltage, and the calibration value, obtaining the standard voltage at the The standard value after analog-to-digital conversion under the preset reference voltage.
  • the preset reference voltage when performing analog-to-digital conversion in combination with the standard voltage, the calibration reference voltage when the standard voltage is calibrated, and the calibration value of the calibration reference voltage are used to determine that the standard voltage is modulated under the preset reference voltage.
  • the standard value after digital conversion so as to accurately obtain the different standard values corresponding to the standard voltage under different reference voltages, thereby ensuring that the fluctuation of the standard voltage during the analog-to-digital conversion process under the preset reference voltage can be accurately measured .
  • the obtaining the standard value of the standard voltage after analog-to-digital conversion under the preset reference voltage according to the preset reference voltage, the calibration reference voltage, and the calibration value includes: according to the following The formula determines the standard value D ref of the standard voltage;
  • V 0 is the calibration reference voltage
  • D 0 is the calibration value of the standard voltage
  • V ref is the preset reference voltage.
  • the measured value of the standard voltage after analog-to-digital conversion is obtained by sampling the standard voltage through a first analog-to-digital converter;
  • the digital converter is obtained by sampling the voltage to be measured; wherein, the first analog-to-digital converter and the second analog-to-digital converter have the same configuration data and clock.
  • the measured values are obtained through two analog-to-digital converters with the same configuration data and clock. Since the sampling of the standard voltage and the voltage to be measured is synchronized, The consistency between the obtained measured values is guaranteed, and the sampling efficiency for obtaining the standard voltage and the measured value of the voltage to be measured is guaranteed.
  • the measured value of the voltage to be measured after the analog-to-digital conversion and the measured value of the standard voltage after the analog-to-digital conversion are used to sequentially compare the voltage to be measured and the standard voltage in a preset order through the same analog-to-digital converter.
  • the voltage is obtained by sampling.
  • the same analog-to-digital converter is used to perform the analog-to-digital conversion of the voltage to be measured and the standard voltage, which avoids the need to perform the analog-to-digital conversion of the standard voltage and the standard voltage.
  • a new analog-to-digital converter needs to be added, which reduces the power consumption during the analog-to-digital conversion process and the measured value compensation process.
  • Fig. 1 is a flowchart of an analog-to-digital conversion method according to the first embodiment of the present application
  • FIG. 2 is a schematic diagram of device implementation of the analog-to-digital conversion method according to the second embodiment of the present application;
  • Fig. 3 is a schematic diagram of a working sequence according to the second embodiment of the present application.
  • Fig. 4 is a schematic diagram of another working sequence according to the second embodiment of the present application.
  • FIG. 5 is a schematic diagram of device implementation of the analog-to-digital conversion method according to the third embodiment of the present application.
  • Fig. 6 is a schematic diagram of a working sequence according to a third embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an analog-to-digital conversion device according to a fourth embodiment of the present application.
  • FIG. 8 is a first structural diagram of the analog-to-digital conversion unit 701 in the fourth embodiment of the present application.
  • FIG. 9 is a second structural diagram of the analog-to-digital conversion unit 701 according to the fourth embodiment of the present application.
  • FIG. 10 is a third structural diagram of the analog-to-digital conversion unit 701 according to the fourth embodiment of the present application.
  • FIG. 11 is a fourth structural diagram of the analog-to-digital conversion unit 701 according to the fourth embodiment of the present application.
  • Fig. 12 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application.
  • the first embodiment of the present application relates to an analog-to-digital conversion method.
  • the measured value of the voltage to be measured after analog-to-digital conversion under a preset reference voltage is obtained; the standard voltage is obtained under the same preset reference voltage.
  • the measured value and standard value after analog-to-digital conversion; the measured value and standard value of the standard voltage after the analog-digital conversion under the preset reference voltage are used to determine the reference voltage fluctuation coefficient; the measured value of the voltage to be measured is carried out according to the reference voltage fluctuation coefficient Compensate, and output the compensated measured value as the analog-to-digital conversion result of the voltage to be measured.
  • the reference voltage fluctuation coefficient during the analog-to-digital conversion process is accurately determined by the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and the output is performed according to the reference voltage fluctuation coefficient.
  • the compensated measured value of the voltage to be measured thereby avoiding the deviation of the analog-to-digital conversion caused by the fluctuation of the reference voltage during the analog-to-digital conversion process, ensuring the accuracy of the analog-to-digital conversion result, and thereby ensuring the performance of the signal processing system.
  • FIG. 1 The specific process of an analog-to-digital conversion method in this embodiment is shown in FIG. 1, and specifically includes the following steps:
  • Step 101 Obtain a measured value of the voltage to be measured after analog-to-digital conversion under a preset reference voltage.
  • the analog-to-digital converter when performing analog-to-digital conversion of the voltage to be measured, after the analog-to-digital converter obtains the configuration data from the configuration register, it adjusts the input reference voltage, sampling time and working clock according to the configuration data, and then performs voltage sampling on the voltage to be measured , That is, by comparing the sampled voltage value V in with the reference voltage V ref of the analog-to-digital converter, the measured value of the voltage to be measured after the analog-to-digital conversion is obtained.
  • Step 102 Obtain the measured value and the standard value of the standard voltage after analog-to-digital conversion under the same preset reference voltage.
  • the analog-to-digital converter when performing analog-to-digital conversion on the standard voltage, obtains the same configuration data as the voltage to be measured for analog-to-digital conversion, and uses the same reference voltage and sampling as the voltage to be tested for analog-to-digital conversion.
  • Time and working clock sample the standard voltage, compare the sampled voltage V in with the reference voltage V ref of the analog-to-digital converter to obtain the measured value of the standard voltage after analog-to-digital conversion under the preset reference voltage, and store it in the register Obtain the standard value of the pre-stored standard voltage after analog-to-digital conversion under the preset reference voltage.
  • Step 103 Determine the reference voltage fluctuation coefficient according to the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value.
  • the analog-to-digital conversion process is in progress.
  • the reference voltage fluctuation coefficient After obtaining the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage, according to the ratio of the standard value of the standard voltage to the measured value of the standard voltage, it is determined that the analog-to-digital conversion process is in progress.
  • the reference voltage fluctuation coefficient After obtaining the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage, according to the ratio of the standard value of the standard voltage to the measured value of the standard voltage, it is determined that the analog-to-digital conversion process is in progress.
  • the reference voltage fluctuation coefficient After obtaining the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage, according to the ratio of the standard value of the standard voltage to the measured value of the standard voltage, it is determined that the analog-to-digital conversion process is in progress.
  • the reference voltage fluctuation coefficient After obtaining the measured value and standard
  • the calibration reference voltage of the standard voltage for calibration and the calibration value of the standard voltage after the analog-to-digital conversion under the calibration reference voltage are obtained; according to the preset reference voltage, the calibration reference voltage and Calibration value to obtain the standard value of the standard voltage after analog-to-digital conversion under the preset reference voltage.
  • the standard value D ref of the standard voltage can be determined according to the following formula:
  • V 0 is the calibrated reference voltage
  • D 0 is the calibrated value of the standard voltage
  • V ref is the current reference voltage
  • the full-scale output is 4095.
  • the calibration reference voltage V 0 With an amplitude of 3.3V.
  • the calibrated value D 0 after analog-to-digital conversion is 1489
  • the current preset reference voltage V ref when performing analog-to-digital conversion on the standard voltage is 2.5V. According to the above formula, it can be obtained that the standard reference voltage is 2.5V.
  • the standard voltage is affected by voltage fluctuations and the The measured voltage is uniformly affected by the voltage fluctuation, and the standard voltage analog-to-digital conversion result is not affected by the change of the reference voltage value, but is only affected by the voltage fluctuation during the analog-to-digital conversion process. Therefore, directly based on the ratio of the standard value of the standard voltage to the measured value of the standard voltage, that is, the standard value/measured value, the fluctuation coefficient of the reference voltage in the analog-to-digital conversion process is determined.
  • the measured value of the obtained standard voltage after analog-to-digital conversion is 2000
  • the standard value is 1965
  • the standard value of the standard voltage after the analog-to-digital conversion under the current preset reference voltage can be calculated in real time according to the selected analog-to-digital converter and the calibration reference voltage. , And then determine the reference voltage fluctuation coefficient in the analog-to-digital conversion process according to the ratio of the standard value of the standard voltage to the measured value of the standard voltage.
  • Step 104 Output the measured value of the voltage to be measured after being compensated according to the reference voltage fluctuation coefficient.
  • the measured value of the voltage to be measured and the reference voltage fluctuation coefficient in the analog-to-digital conversion process are obtained, the measured value of the voltage to be measured is compensated according to the reference voltage fluctuation coefficient, and the compensated measured value is used as the measured value The output of the analog-to-digital conversion result of the voltage.
  • the measured value of the voltage to be measured after the analog-to-digital conversion can be compensated by the following formula:
  • D c is the measured value after compensation
  • DATA1 is the measured value of the standard voltage
  • DATA2 is the measured value of the voltage to be measured
  • D ref is the standard value of the standard voltage. Since the standard voltage is a non-zero voltage, the measured value of the standard voltage after analog-to-digital conversion will not be zero.
  • the measured value of the obtained standard voltage is 2000
  • the standard value of the standard voltage is 1965
  • the measured value of the voltage to be measured is 1200
  • the measured value of the voltage to be measured is multiplied by the reference voltage fluctuation coefficient 0.9825
  • the reference voltage fluctuation coefficient in the analog-to-digital conversion process is determined according to the measured value of the standard voltage after the analog-to-digital conversion and the standard value. Compensate the measured value of the voltage to be measured after analog-to-digital conversion under the same reference voltage, and output the compensated measured value as the analog-to-digital conversion result of the voltage to be measured. Using the characteristic that the standard voltage is not affected by the reference voltage value, the deviation of the voltage to be measured is compensated through the deviation in the analog-to-digital conversion process of the standard voltage, and the error of the measured value of the voltage to be measured is eliminated.
  • the product of the measured value after the analog-to-digital conversion of the voltage to be measured and the reference voltage fluctuation coefficient is used as the result of the analog-to-digital conversion of the voltage to be measured.
  • the second embodiment of the present application relates to an analog-to-digital conversion method.
  • two analog-to-digital converters are used to perform parallel analog to the standard voltage and the voltage to be measured.
  • Digital conversion so as to ensure the efficiency of the analog-to-digital conversion of the voltage to be measured; when there is no need to compensate for the analog-to-digital conversion result, the two analog-to-digital converters can also work independently to improve resource utilization.
  • the measured value of the standard voltage after the analog-to-digital conversion is obtained by sampling the standard voltage by the first analog-to-digital converter; the measured value of the voltage to be measured after the analog-to-digital conversion is obtained through the second analog-to-digital converter The voltage to be measured is sampled and obtained; wherein, the first analog-to-digital converter and the second analog-to-digital converter have the same configuration data and clock.
  • the specific implementation method of analog-to-digital conversion in this embodiment can be implemented by the device shown in FIG. 2, and the specific description is as follows:
  • the first analog-to-digital converter 207 is used for sampling and analog-to-digital conversion of the standard voltage
  • the second analog-to-digital converter 208 is used for sampling and analog-to-digital conversion of the voltage to be measured.
  • the first analog-to-digital converter 207 is optionally connected to the first configuration register 201 and the second configuration register 202 through the first selector 203, and the second analog-to-digital converter 208 is directly connected to the first configuration register 201 and the second configuration register 202.
  • the second configuration register 202 is connected.
  • both analog-to-digital converters obtain configuration data from the second configuration register 202, and are controlled by the second configuration register 202 to adjust their configuration parameters to obtain the same reference voltage, Sampling time and working clock.
  • the first configuration register 201 may not be included, or the first selector 203 may not be included, and the two analog-to-digital converters 207 and 208 are directly connected to the same configuration register 202.
  • Another method in this embodiment is: before the analog-to-digital converter obtains the configuration data, the configuration data in the configuration register is edited in advance, so that the configuration data stored in the first configuration register 201 and the second configuration register 202 are Consistent.
  • the first analog-to-digital converter 207 is connected to the first configuration register 201 through the first selector
  • the second analog-to-digital converter 208 is connected to the second configuration register 202
  • the two analog-to-digital converters obtain configurations from the connected configuration registers.
  • Data modify its own configuration data, determine the sampling time, working clock and reference voltage.
  • the analog-to-digital converter After the two analog-to-digital converters complete the configuration update according to the configuration data, and start the two analog-to-digital converters through the configuration register, the analog-to-digital converter performs the correction of the standard voltage and the voltage to be measured according to the determined reference voltage, sampling time and working clock. Perform sampling and quantization.
  • the first input selector 204 inputs the standard voltage to the first analog-to-digital converter 207.
  • the second analog-to-digital converter 208 may have multiple input interfaces to communicate with each other. Different input signals, and the second selection switch 205 switches the input interface connected with the second analog-to-digital converter 208 according to the detection requirements.
  • the second The input selector 205 switches the input interface connected with the second analog-to-digital converter 208 to the input interface corresponding to the voltage to be measured, so as to input the analog voltage to be measured in the external input into the second analog-to-digital converter 208.
  • the converters 207 and 208 synchronously sample the standard voltage and the voltage to be measured, and quantify the measured value corresponding to the sampled voltage according to the ratio of the sampled voltage to the reference voltage, and determine the measured value of the standard voltage after the analog-to-digital conversion DATA1 and the measured value DATA2 of the voltage to be measured after analog-to-digital conversion, and the measured value DATA1 of the standard voltage is transmitted to the hardware accelerator 209 and the first data register 211, and the measured value DATA2 of the voltage to be measured is transmitted to the hardware accelerator 209 and the first data register 211.
  • the second selector 210 determines whether to store the measured value DATA2 of the voltage to be measured in the second data register 212 by the second selector 210.
  • the measured value of the voltage to be measured is compensated according to the measured value of the standard voltage and the standard value, and the compensated measured value is output.
  • the compensation of the measured value of the voltage to be measured can be realized by the following two methods:
  • a compensation method in this embodiment is: if the hardware accelerator 209 is in a normal working state, the hardware accelerator 209 obtains the standard value D ref of the standard voltage under the current reference voltage from the standard voltage calibration register 206, and combines the received standard voltage
  • the measured value DATA1 after the analog-to-digital conversion and the measured value DATA2 after the analog-to-digital conversion of the voltage to be measured use the compensation calculation formula pre-stored in the hardware accelerator 209: D C voltage measurement value measured after the compensation is calculated, i.e.
  • the selector 210 selects the second compensation voltage to be measured DATA3 It is transmitted to the second data register 212, and then the data DATA3 in the second data register is directly read, and DATA3 is output as the result of the analog-to-digital conversion of the voltage to be measured.
  • the device works The timing diagram is shown in FIG. 3.
  • the hardware accelerator 209 compensates for the voltage measurement value to be measured for the first time
  • the first analog-to-digital converter 207 and the second analog-to-digital converter 208 can perform the second standby synchronously. Sampling and quantification of measured voltage and standard voltage.
  • Another compensation method in this embodiment is: the hardware accelerator 209 is in the disabled state.
  • the second selector 210 transmits the measured value DATA2 of the voltage to be measured after the analog-to-digital conversion to the second data register 212, and the software The program obtains the standard value D ref of the standard voltage under the current reference voltage from the standard voltage calibration register 206 according to the reference voltage of the analog-to-digital converter, and obtains the measured value DATA1 of the standard voltage from the first data register 211, from the second data
  • the register 212 obtains the measured value DATA2 of the voltage to be measured, and according to the pre-stored compensation calculation formula: After calculating the compensation measurement D C voltage to be measured, and the measured value compensated as a result of the test voltage output of the analog to digital conversion, when the voltage to be measured to achieve analog to digital conversion, an operation timing chart of the method by means of FIG. As shown in 4, the software directly completes the compensation and output of the measured value of the voltage to be measured. When compensating the measured value of the voltage to
  • the first selector 203 in the device can choose to connect the first analog-to-digital converter 207 with the first configuration register 201, and the second The analog-to-digital converter 208 is only connected to the second configuration register 202.
  • the difference from when the compensation function is enabled is that in the disabled state, the first configuration register and the second configuration register store different configuration data in the two configuration registers.
  • the two analog-to-digital converters work independently, do not affect each other, improve resource utilization, and automatically shut off the power supply to the hardware accelerator 209 to reduce energy consumption.
  • the embodiment of the application has all the beneficial effects of the first embodiment, and at the same time, the analog-to-digital conversion of the standard voltage and the voltage to be measured is performed through two synchronously parallel analog-to-digital converters, which ensures the sampling and Conversion efficiency; change the compensation calculation method according to the demand, and perform the compensation calculation through the hardware accelerator, which can improve the calculation efficiency as much as possible and reduce the burden on the CPU (processor); when the compensation calculation is performed by software, the hardware accelerator can be used Shutdown, thereby reducing the overall power consumption in the analog-to-digital conversion process.
  • the third embodiment of the present application relates to an analog-to-digital conversion method.
  • the standard voltage and the voltage to be measured are sequentially converted from analog to digital through the same analog-to-digital converter.
  • the compensation of the measured value is realized through software calculation, avoiding the need to increase the hardware accelerator, reducing the area of the chip, and realizing detection through an analog-to-digital converter, reducing power consumption as much as possible.
  • the measured value of the voltage to be measured after the analog-to-digital conversion and the measured value of the standard voltage after the analog-to-digital conversion are passed through the same analog-to-digital converter in a preset order Sampling and obtaining the voltage to be measured and the standard voltage in turn.
  • the specific implementation method of analog-to-digital conversion in this embodiment can be implemented by the device shown in FIG. 5, which is specifically described as follows:
  • the first sampling capacitor 506 is connected to the standard voltage input through the double-pole double-throw switch 504, and the second sampling capacitor 505 is connected to the output terminal of the input selector 501 through the double-pole double-throw switch 504.
  • the voltage to be measured is used as the output signal.
  • the double-pole double-throw switch 504 is closed, the standard voltage and the voltage to be measured simultaneously charge the first sampling capacitor 506 and the second sampling capacitor 505, respectively, and the double-pole double-throw switch 504 is opened When, charging stops at the same time.
  • the single-pole double-throw switch 507 is used to start the analog-to-digital converter 508 through the configuration register 502 according to the preset analog-to-digital conversion sequence.
  • the converter 508 is connected, and the analog-to-digital converter 508 determines the sampling time and working clock according to the configuration data obtained from the configuration register 502, performs voltage sampling on the voltage held on the sampling capacitor, and performs voltage sampling according to the ratio of the input reference voltage to the sampling voltage Quantify the voltage on the sampling capacitor, determine the measured value of the voltage corresponding to the sampling capacitor after analog-to-digital conversion, and then transmit the obtained measurement value to the first data register 503 or the second data register 510 through the output selector 509 Store it.
  • the single-pole double-throw switch 507 connects the first sampling capacitor 506 with the analog-to-digital converter 508 first, that is, performs analog-to-digital conversion on the standard voltage, and the analog-to-digital converter 508 samples the voltage held on the first sampling capacitor 506 and For quantization, at this time, the output selector 509 connects the analog-to-digital converter 508 with the first data register 503, and the analog-to-digital converter 508 transmits the measured value of the standard voltage to the first data register 503. Then, the single-pole double-throw switch 507 connects the second sampling capacitor 505 with the analog-to-digital converter 508, that is, performs analog-to-digital conversion on the voltage to be measured.
  • the voltage on the second sampling capacitor 505 is sampled and quantized.
  • the output selection switch 509 connects the analog-to-digital converter 508 with the second data register 510, and transmits the measured value of the voltage to be measured to the second data register 510.
  • the connection sequence of the sampling capacitor and the analog-to-digital converter can be adjusted, and this embodiment does not limit the sequence of the analog-to-digital conversion.
  • the measured value of the voltage to be measured is compensated, and the measured value of the voltage to be measured after compensation is output.
  • the fluctuation coefficient of the reference voltage in the analog-to-digital conversion process is obtained first.
  • the working sequence diagram of the device is shown in Figure 6.
  • quantization and processing are carried out in sequence, and the sampled voltage is converted into a digital signal according to
  • the register stores the data format, adjusts the format of the digital signal to align with the format of the data register, then stores the data in the data register, and then processes and outputs the analog-to-digital conversion result of the compensated voltage to be measured through software.
  • the embodiment of the application has all the beneficial effects of the first embodiment, and only one analog-to-digital converter is used to perform the measured value of the voltage to be measured and the standard voltage after the analog-to-digital conversion under the same reference voltage.
  • the method of software calculation realizes the compensation of the measured voltage value to be measured, which avoids the addition of hardware accelerators and new analog-to-digital converters, and reduces the area of the chip and the power consumption during the analog-to-digital conversion process.
  • the fourth embodiment of the present application relates to an analog-to-digital conversion device.
  • the schematic structural diagram of the analog-to-digital conversion device is shown in FIG. 7 and includes: an analog-to-digital conversion unit and a calculation unit;
  • the analog-to-digital conversion unit 701 is configured to perform analog-to-digital conversion on the standard voltage and the voltage to be measured to obtain the measured value of the standard voltage and the voltage to be measured after the analog-to-digital conversion under the same preset reference voltage;
  • the calculation unit 702 is configured to determine the reference voltage fluctuation coefficient according to the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and compensate the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient, and compensate The subsequent measured value is output as the analog-to-digital conversion result of the voltage to be measured.
  • the analog-to-digital conversion unit 701 may include: a first analog-to-digital converter 801, a second analog-to-digital converter 802, and a first analog-to-digital converter 801 and a second analog-to-digital converter 802 The connected first configuration register 803;
  • the first analog-to-digital converter 801 is connected to the first configuration register, and is used to perform analog-to-digital conversion on the standard voltage according to the configuration data stored in the first configuration register 803 to obtain the measured value of the standard voltage after the analog-to-digital conversion.
  • the first analog-to-digital converter 801 sets its own reference voltage input, sampling time, and working clock according to the configuration data obtained from the first configuration register 803, and then samples the standard voltage, according to the difference between the sampled voltage and the reference voltage Ratio, determine the measured value of the standard voltage after analog-to-digital conversion.
  • the second analog-to-digital converter 802 is connected to the first configuration register 803, and is configured to perform analog-to-digital conversion of the voltage to be measured according to the configuration data stored in the first configuration register 803, and obtain the measured value of the voltage to be measured after the analog-to-digital conversion.
  • the method for obtaining the measured value of the voltage to be measured after the analog-to-digital conversion is the same as the above-mentioned method for obtaining the measured value of the standard voltage after the analog-to-digital conversion, and will not be repeated here.
  • the analog-to-digital conversion unit 701 may further include: a first analog-to-digital converter 901, a second analog-to-digital converter 902, a first configuration register 903, a register selection switch 904, and a second Configuration register 905;
  • the first input terminal of the register selection switch 904 is connected to the first configuration register 903, the second input terminal is connected to the second configuration register 905, and the output terminal is connected to the first analog-to-digital converter 901 for selecting and connecting to the first analog-to-digital converter. 901 connected configuration register.
  • the first analog-to-digital converter 901 and the second analog-to-digital converter 902 are both controlled by the first configuration register 903, so as to ensure the synchronization of sampling; when the accuracy of the analog-to-digital conversion result of the voltage to be measured is low, you can Turn off the enable for compensating the analog-digital conversion result of the voltage to be measured, that is, no longer compensate the analog-digital conversion result of the voltage to be measured based on the measured value of the standard voltage after the analog-to-digital conversion and the reference voltage fluctuation coefficient determined by the standard value.
  • the first analog-to-digital converter 901 and the second analog-to-digital converter 902 can work as independent analog-to-digital converters without affecting each other.
  • the second configuration register 905 is converted to the first analog-to-digital converter through the register selection switch 904
  • the device 901 is connected, and the first analog-to-digital converter 901 is controlled by the second configuration register 905, and independently performs analog-to-digital conversion on the input voltage to be measured.
  • the second configuration register 905 is used to provide configuration data for the connected first analog-to-digital converter 901.
  • the analog-to-digital conversion unit 701 may include: a first sampling capacitor 1001, a second sampling capacitor 1002, a capacitor selection switch 1003, and an analog-to-digital converter 1004;
  • the first sampling capacitor 1001 is connected to the capacitor selection switch 1003 for sampling the standard voltage.
  • the first sampling capacitor 1001 stores the charges acquired in the process of charging according to the standard voltage on the electrode plate, and the analog-to-digital converter 1004 is connected to the first sampling capacitor 1001 to charge the first sampling capacitor 1001. The voltage is converted to determine the measured value of the standard voltage after analog-to-digital conversion.
  • the second sampling capacitor 1002 is connected to the capacitor selection switch 1003 for sampling the voltage to be measured.
  • the method for sampling the voltage to be measured by the second sampling capacitor 1002 is the same as the method for sampling the standard voltage by the first capacitor 1001, which will not be repeated here.
  • the capacitor selection switch 1003 is connected to the first sampling capacitor 1001, the second sampling capacitor 1002, and the analog-to-digital converter 1004, and is used to select the sampling capacitor connected to the analog-to-digital converter 1004 to realize the sampling and analog of the standard voltage and the voltage to be measured. Number conversion.
  • the analog-to-digital converter 1004 is used to sequentially perform analog-to-digital conversion on the voltage on the connected sampling capacitor to obtain the standard voltage and the measured value of the voltage to be measured after the analog-to-digital conversion.
  • the analog-to-digital converter 1004 obtains the voltage on the connected sampling capacitor, determines the measured value of the voltage on the sampling capacitor after analog-to-digital conversion, and obtains the measured value of the standard voltage and the voltage to be measured after the analog-to-digital conversion.
  • a double-pole double-throw switch can be added in front of the sampling capacitor. Switch to control the charging time of the two sampling capacitors at the same time.
  • the digital conversion unit 701 may further include: a first sampling capacitor 1101, a second sampling capacitor 1102, a capacitor selection switch 1103, an analog-to-digital converter 1104, an output selection switch 1105, and a first sampling capacitor 1101. Data register 1106 and second data register 1107;
  • the input of the output selection switch 1105 is connected to the analog-to-digital converter 1104, and the output is connected to the first data register 1106 and the second data register 1107.
  • the output selection switch 1105 is used to output the measured value of the standard voltage converted by the analog-to-digital converter 1104 To the first data register 1106, that is, when the sampling capacitor connected to the analog-to-digital converter 1104 is the first sampling capacitor 1101, the output selection switch 1105 connects the first data register 1106 with the analog-to-digital converter 1104 to convert the analog to digital The result is transmitted to the first data register 1106; the measured value of the voltage to be measured converted by the analog-to-digital converter 1104 is output to the second data register 1107, that is, the sampling capacitor connected to the analog-to-digital converter 1104 by the output selection switch 1105 is the first When the second sampling capacitor 1102 is used, the output selection switch 1105 is connected to the second data register 1107, and the analog-to-digital conversion result of the analog-to-digital converter 1104
  • the calculation unit 702 may be a hardware accelerator or a register pre-stored with a simulation model of the hardware accelerator.
  • the specific structure of the calculation unit can be set according to actual conditions and needs, and this embodiment does not limit the specific setting of the structure of the calculation unit.
  • the embodiment of the present application determines the reference voltage fluctuation coefficient during the analog-to-digital conversion process according to the measured value of the standard voltage after the analog-to-digital conversion and the standard value when performing the analog-to-digital conversion of the voltage to be measured. Compensate the measured value of the voltage to be measured after the analog-to-digital conversion under the same preset reference voltage, and output the compensated measured value as the result of the analog-to-digital conversion of the voltage to be measured. Utilizing the characteristic that the standard voltage is not affected by the reference voltage value, the deviation of the standard voltage analog-to-digital conversion process under the same reference voltage is used to compensate for the deviation of the voltage to be measured, and the error of the voltage measurement value to be measured is eliminated.
  • two analog-to-digital converters are used to synchronously sample the voltage to be measured and the standard voltage to ensure the efficiency of the analog-to-digital conversion of the voltage to be measured.
  • Sequential sampling of the voltage to be measured and the standard voltage through the same analog-to-digital converter can reduce the area of the chip and the overall power consumption; when the accuracy of the analog-to-digital conversion result is low, the two analog-to-digital converters work independently to ensure Efficient use of resources; when compensating the measured value of the voltage to be measured after the analog-to-digital conversion, the hardware accelerator is used to perform the measurement value compensation calculation, which can avoid the occupation of CPU (processor) resources and improve the efficiency of the compensation calculation , And through the software simulation model to calculate the measured value compensation based on the data in the two data registers, it can avoid adding new hardware, reducing the area of the chip and the overall power consumption.
  • the fifth embodiment of the present application relates to an analog-to-digital conversion chip.
  • the analog-to-digital conversion chip is connected to at least one memory.
  • the memory stores instructions that can be executed by the analog-to-digital conversion chip.
  • the chip can execute the analog-to-digital conversion methods described in the first, second, and third embodiments of this application.
  • the reference voltage fluctuation coefficient in the analog-to-digital conversion process is determined according to the measured value of the standard voltage after the analog-to-digital conversion and the standard value. Compensate the measured value of the voltage to be measured after the analog-to-digital conversion, and output the compensated measured value as the result of the analog-to-digital conversion of the voltage to be measured.
  • the deviation of the voltage to be measured is compensated through the deviation in the analog-to-digital conversion process of the standard voltage, and the error of the measured value of the voltage to be measured is eliminated.
  • the sixth embodiment of the present application relates to an electronic device. As shown in FIG. 12, it includes a memory 1201 and the analog-to-digital conversion chip 1202 described in the fifth embodiment above, and the memory 1201 is in communication connection with the analog-to-digital conversion chip 1202.
  • the seventh embodiment of the present application relates to a computer-readable storage medium that stores a computer program.
  • the computer program When executed by a processor, it realizes the modules described in the first, second, and third embodiments of the present application. Conversion method.
  • the program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

Abstract

Some embodiments of the present application provide an analog-to-digital conversion method and apparatus, relating to an analog-to-digital conversion technology. The analog-to-digital conversion methods comprise: obtaining a measured value of a voltage to be measured subjected to analog-to-digital conversion under a preset reference voltage (101); obtaining a measured value and a standard value of a standard voltage subjected to analog-to-digital conversion under the preset reference voltage (102); determining a reference voltage fluctuation coefficient according to the measured value and the standard value of the standard voltage subjected to analog-to-digital conversion under the preset reference voltage (103); and compensating, according to the reference voltage fluctuation coefficient, for the measured value of the voltage to be measured and outputting the compensated measured value as an analog-to-digital conversion result of the voltage to be measured (104). According to the embodiments of the present application, the compensation for the measured value of the voltage to be measured that has been subjected to analog-to-digital conversion can prevent the deviation of the analog-to-digital conversion result caused by reference voltage fluctuation, thereby improving the accuracy of analog-to-digital conversion.

Description

模数转换方法、装置、芯片、电子设备及存储介质Analog-to-digital conversion method, device, chip, electronic equipment and storage medium 技术领域Technical field
本申请涉及电子技术领域,特别涉及一种模数转换方法、装置、芯片、电子设备及存储介质。This application relates to the field of electronic technology, and in particular to an analog-to-digital conversion method, device, chip, electronic equipment, and storage medium.
背景技术Background technique
模数转换技术(ADC)在信号处理中扮演着将模拟信号转换为数字信号的角色,ADC的精准度直接影响了信号处理系统的性能。ADC转换的实质是采样信号与参考电压进行比对的过程,所以参考电压对ADC的精度和误差存在极大的影响,ADC转换的结果与参考电压的关系如下:Analog-to-digital conversion technology (ADC) plays the role of converting analog signals into digital signals in signal processing, and the accuracy of ADC directly affects the performance of the signal processing system. The essence of ADC conversion is the process of comparing the sampled signal with the reference voltage, so the reference voltage has a great influence on the accuracy and error of the ADC. The relationship between the result of the ADC conversion and the reference voltage is as follows:
Figure PCTCN2020082816-appb-000001
Figure PCTCN2020082816-appb-000001
其中,D为转换结果,n为大于0的整数,ADC分辨率用二进制位数表示,n为ADC分辨率的位数,满量程对应的模拟信号值被划分为2 n格,用于表征ADC的精度,V in是输入信号,V ref是参考电压。为了避免由于参考电压的值与输入信号的最大值之间的差距过大导致的ADC饱和,需要根据应用场景进行参考电压的动态调整。为了灵活调整参考电压的具体值,将参考电压由外部输入电路进行提供,进而避免出现ADC饱和问题。 Among them, D is the conversion result, n is an integer greater than 0, ADC resolution is expressed in binary digits, n is the digits of ADC resolution, and the analog signal value corresponding to the full scale is divided into 2 n grids to characterize the ADC The accuracy of V in is the input signal and V ref is the reference voltage. In order to avoid the ADC saturation caused by the excessive difference between the value of the reference voltage and the maximum value of the input signal, the reference voltage needs to be dynamically adjusted according to the application scenario. In order to flexibly adjust the specific value of the reference voltage, the reference voltage is provided by an external input circuit, thereby avoiding the ADC saturation problem.
然而,发明人发现相关技术至少存在以下问题:通过外部输入电路进行提供参考电压时,参考电压容易受电路噪声影响而发生波动,进而使得ADC 转换的结果出现偏差,影响信号处理系统的性能。However, the inventor found that the related technology has at least the following problem: when the reference voltage is provided through an external input circuit, the reference voltage is easily affected by circuit noise and fluctuates, which in turn causes deviations in the ADC conversion result and affects the performance of the signal processing system.
发明内容Summary of the invention
本申请部分实施例的目的在于提供一种模数转换方法、装置、芯片、电子设备及存储介质,避免由于参考电压波动带来的模数转换偏差,保证数模转换结果的准确性。The purpose of some embodiments of this application is to provide an analog-to-digital conversion method, device, chip, electronic device, and storage medium, to avoid the deviation of the analog-to-digital conversion caused by the fluctuation of the reference voltage, and to ensure the accuracy of the digital-to-analog conversion result.
本申请实施例提供了一种模数转换方法,包括:获取待测电压在预设参考电压下经模数转换后的测量值;获取标准电压在同一所述预设参考电压下经模数转换后的测量值和标准值;根据所述标准电压在所述预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数;根据所述参考电压波动系数对所述待测电压的测量值进行补偿,并将补偿后的测量值作为所述待测电压的模数转换结果输出。An embodiment of the present application provides an analog-to-digital conversion method, including: obtaining a measured value of a voltage to be measured after analog-to-digital conversion under a preset reference voltage; obtaining a standard voltage after performing analog-to-digital conversion under the same preset reference voltage Determine the reference voltage fluctuation coefficient according to the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage; determine the reference voltage fluctuation coefficient according to the reference voltage fluctuation coefficient; The measured value of the measured voltage is compensated, and the compensated measured value is output as the analog-to-digital conversion result of the measured voltage.
本申请实施例还提供了一种模数转换装置,包括:模数转换单元及计算单元;所述模数转换单元,用于对标准电压及待测电压进行模数转换,得到所述标准电压及所述待测电压在同一预设参考电压下经模数转换后的测量值;所述计算单元,用于根据所述标准电压在所述预设参考电压下经模数转换后的测量值与标准值,确定参考电压波动系数,并根据所述参考电压波动系数对所述待测电压的测量值进行补偿,将补偿后的测量值作为所述待测电压的模数转换结果输出。The embodiment of the present application also provides an analog-to-digital conversion device, including: an analog-to-digital conversion unit and a calculation unit; the analog-to-digital conversion unit is used to perform analog-to-digital conversion on the standard voltage and the voltage to be measured to obtain the standard voltage And the measured value of the voltage to be measured after analog-to-digital conversion under the same preset reference voltage; the calculation unit is configured to perform analog-to-digital conversion according to the measured value of the standard voltage under the preset reference voltage Determine the reference voltage fluctuation coefficient with the standard value, and compensate the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient, and output the compensated measured value as an analog-to-digital conversion result of the voltage to be measured.
本申请实施例还提供了一种模数转换芯片,所述模数转换芯片与至少一存储器连接,所述存储器存储有可被所述模数转换芯片执行的指令,所述指令被所述模数转换芯片执行,以使所述模数转换芯片能够执行以上所述的模数转 换方法。The embodiment of the present application also provides an analog-to-digital conversion chip, the analog-to-digital conversion chip is connected to at least one memory, and the memory stores instructions that can be executed by the analog-to-digital conversion chip. The digital conversion chip is executed, so that the analog-to-digital conversion chip can perform the above-mentioned analog-to-digital conversion method.
本申请实施例还提供了一种电子设备,包括:存储器,以及上述的模数转换芯片,所述存储器与所述模数转换芯片通信连接。An embodiment of the present application also provides an electronic device, including a memory, and the above-mentioned analog-to-digital conversion chip, and the memory is in communication connection with the analog-to-digital conversion chip.
本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现以上所述的模数转换方法。The embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the above-mentioned analog-to-digital conversion method is implemented.
本申请实施例相对于现有技术而言,在进行待测电压的模数转换时,根据标准电压在预设参考电压下经模数转换后的测量值与标准值,确定出模数转换过程中的参考电压波动系数,并根据参考电压波动系数对待测电压在同一预设参考电压下经模数转换后的测量值进行补偿,将补偿后的测量值作为待测电压的模数转换结果输出。标准电压是一个内部的恒定电压,一般为模数转换器最低工作电压的一半左右,不受到参考电压值变更的影响,因此通过获取标准电压在预设参考电压下经模数后的测量值和标准值,确定模数转换过程中的转换结果的波动情况,并将标准电压模数转换过程的波动情况作为待测电压模数转换过程波动情况的参照,进而对待测电压模数转换后的测量值进行补偿,解决了现有技术中模数转换结果会由于参考电压波动的出现偏差的问题,保证了模数转换结果的准确性,避免由于模数转换结果的偏差对信号处理系统的性能造成影响。Compared with the prior art, the embodiment of the present application determines the analog-to-digital conversion process according to the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage when performing the analog-to-digital conversion of the voltage to be measured According to the reference voltage fluctuation coefficient in the reference voltage, the measured value after the analog-to-digital conversion of the voltage to be measured under the same preset reference voltage is compensated according to the reference voltage fluctuation coefficient, and the compensated measurement value is output as the analog-to-digital conversion result of the voltage to be measured . The standard voltage is an internal constant voltage, which is generally about half of the lowest working voltage of the analog-to-digital converter. It is not affected by the change of the reference voltage value. Therefore, the measured value and the analog-digital value of the standard voltage under the preset reference voltage are obtained. Standard value, determine the fluctuation of the conversion result during the analog-to-digital conversion process, and use the fluctuation of the standard voltage analog-to-digital conversion process as a reference for the fluctuation of the voltage to be measured during the analog-to-digital conversion process, and then the measurement after the analog-to-digital conversion of the voltage to be measured The value is compensated, which solves the problem that the analog-to-digital conversion result in the prior art will deviate due to the fluctuation of the reference voltage, ensures the accuracy of the analog-to-digital conversion result, and avoids the performance of the signal processing system due to the deviation of the analog-to-digital conversion result. Influence.
例如,所述根据所述标准电压在所述预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数,包括:根据所述标准电压在所述预设参考电压下经模数转换后的标准值与测量值的比值,确定所述参考电压波动系数。本申请实施例中通过标准电压在预设参考电压下经模数转换后的测量值和标准值之间的比值确定参考电压波动系数,借助测量值和标准值的比例关系, 准确的对模数转换过程中的波动状况进行衡量。For example, the determining the reference voltage fluctuation coefficient according to the measured value and the standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage includes: according to the standard voltage under the preset reference voltage The ratio of the standard value after the analog-to-digital conversion to the measured value determines the fluctuation coefficient of the reference voltage. In the embodiment of this application, the reference voltage fluctuation coefficient is determined by the ratio between the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and the ratio between the measured value and the standard value is used to accurately compare the analog-to-digital value. The fluctuations in the conversion process are measured.
例如,所述根据所述参考电压波动系数对所述待测电压的测量值进行补偿,包括:根据以下公式对所述待测电压的测量值进行补偿;For example, the compensating the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient includes: compensating the measured value of the voltage to be measured according to the following formula;
Figure PCTCN2020082816-appb-000002
Figure PCTCN2020082816-appb-000002
其中,D c为所述补偿后的测量值,DATA1为所述标准电压的测量值,D ref为所述标准电压的标准值、DATA2为所述待测电压的测量值。本申请实施例中根据标准电压经模数转换后的测量值与标准值的比值确定出波动系数后,将待测电压的测量值与确定的波动系数相乘,从而准确的根据标准电压的波动情况对待测电压的测量值进行补偿,保证待测电压模数转换结果的准确。 Wherein, D c is the measured value after compensation, DATA1 is the measured value of the standard voltage, D ref is the standard value of the standard voltage, and DATA2 is the measured value of the voltage to be measured. In the embodiment of the application, after the fluctuation coefficient is determined according to the ratio of the measured value of the standard voltage after the analog-to-digital conversion to the standard value, the measured value of the voltage to be measured is multiplied by the determined fluctuation coefficient, so as to accurately base on the fluctuation of the standard voltage The situation is to compensate the measured value of the voltage to be measured to ensure the accuracy of the analog-to-digital conversion result of the voltage to be measured.
例如,在所述根据所述标准电压在所述预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数前,还包括:获取所述标准电压进行标定时的标定参考电压及所述标准电压在所述标定参考电压下经模数转换后的标定值;根据所述预设参考电压、所述标定参考电压、以及所述标定值,获取所述标准电压在所述预设参考电压下经模数转换后的标准值。本申请实施例中通过结合标准电压进行模数转换时的预设参考电压、标准电压标定时的标定参考电压、以及标定参考电压的标定值,确定出在预设参考电压下,标准电压经模数转换后的标准值,从而准确的获取在不同参考电压下,标准电压对应的不同标准值,进而保证了能够准确的对标准电压在预设参考电压下模数转换过程中的波动情况进行衡量。For example, before the determination of the reference voltage fluctuation coefficient based on the measured value and the standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage, the method further includes: obtaining the standard voltage for calibration The reference voltage and the calibration value of the standard voltage after analog-to-digital conversion under the calibration reference voltage; according to the preset reference voltage, the calibration reference voltage, and the calibration value, obtaining the standard voltage at the The standard value after analog-to-digital conversion under the preset reference voltage. In the embodiment of the application, the preset reference voltage when performing analog-to-digital conversion in combination with the standard voltage, the calibration reference voltage when the standard voltage is calibrated, and the calibration value of the calibration reference voltage are used to determine that the standard voltage is modulated under the preset reference voltage. The standard value after digital conversion, so as to accurately obtain the different standard values corresponding to the standard voltage under different reference voltages, thereby ensuring that the fluctuation of the standard voltage during the analog-to-digital conversion process under the preset reference voltage can be accurately measured .
例如,所述根据所述预设参考电压、所述标定参考电压、以及所述标定值,获取所述标准电压在所述预设参考电压下经模数转换后的标准值,包括:根据以下公式确定所述标准电压的标准值D refFor example, the obtaining the standard value of the standard voltage after analog-to-digital conversion under the preset reference voltage according to the preset reference voltage, the calibration reference voltage, and the calibration value includes: according to the following The formula determines the standard value D ref of the standard voltage;
Figure PCTCN2020082816-appb-000003
Figure PCTCN2020082816-appb-000003
其中,V 0为所述标定参考电压,D 0为所述标准电压的标定值,V ref为所述预设参考电压。本申请实施例中基于标定参考电压与预设参考电压的比值,与当前标准电压的标准值与标定参考电压下的测量值的比值一致的原理,根据标准电压在标定参考电压下的标定值,准确的确定出预设参考电压下标准电压的标准值。 Wherein, V 0 is the calibration reference voltage, D 0 is the calibration value of the standard voltage, and V ref is the preset reference voltage. In the embodiments of this application, based on the principle that the ratio of the calibration reference voltage to the preset reference voltage is consistent with the ratio of the standard value of the current standard voltage to the measured value under the calibration reference voltage, according to the calibration value of the standard voltage under the calibration reference voltage, Accurately determine the standard value of the standard voltage under the preset reference voltage.
例如,所述标准电压经模数转换后的测量值,通过第一模数转换器对所述标准电压进行采样获取得到;所述待测电压经模数转换后的测量值,通过第二模数转换器对所述待测电压进行采样获取得到;其中,所述第一模数转换器与所述第二模数转换器具有相同的配置数据和时钟。本申请实施例中获取标准电压及待测电压的测量值时,通过两个具有相同配置数据和时钟的模数转换器进行测量值的获取,由于对标准电压及待测电压采样具有同步性,保证了得到的测量值之间的一致性,并且保证了获取标准电压及待测电压测量值的采样效率。For example, the measured value of the standard voltage after analog-to-digital conversion is obtained by sampling the standard voltage through a first analog-to-digital converter; The digital converter is obtained by sampling the voltage to be measured; wherein, the first analog-to-digital converter and the second analog-to-digital converter have the same configuration data and clock. When obtaining the measured values of the standard voltage and the voltage to be measured in the embodiments of the present application, the measured values are obtained through two analog-to-digital converters with the same configuration data and clock. Since the sampling of the standard voltage and the voltage to be measured is synchronized, The consistency between the obtained measured values is guaranteed, and the sampling efficiency for obtaining the standard voltage and the measured value of the voltage to be measured is guaranteed.
例如,所述待测电压经模数转换后的测量值和所述标准电压经模数转换后的测量值,通过同一模数转换器按照预设顺序依次对所述待测电压和所述标准电压进行采样获取得到。本申请实施例中获取标准电压及待测电压的测量值时,根据预先设置的模数转换顺序,通过同一个模数转换器对待测电压及标准电压进行模数转换,避免了对标准电压及待测电压进行模数转换时,需要增加新的模数转换器,降低了模数转换过程及测量值补偿过程中的功耗。For example, the measured value of the voltage to be measured after the analog-to-digital conversion and the measured value of the standard voltage after the analog-to-digital conversion are used to sequentially compare the voltage to be measured and the standard voltage in a preset order through the same analog-to-digital converter. The voltage is obtained by sampling. When obtaining the measured values of the standard voltage and the voltage to be measured in the embodiment of the present application, according to the preset analog-to-digital conversion sequence, the same analog-to-digital converter is used to perform the analog-to-digital conversion of the voltage to be measured and the standard voltage, which avoids the need to perform the analog-to-digital conversion of the standard voltage and the standard voltage. When the voltage to be measured performs analog-to-digital conversion, a new analog-to-digital converter needs to be added, which reduces the power consumption during the analog-to-digital conversion process and the measured value compensation process.
附图说明Description of the drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings. These exemplified descriptions do not constitute a limitation on the embodiments. The elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the attached drawings do not constitute a scale limitation.
图1是根据本申请第一实施例的模数转换方法流程图;Fig. 1 is a flowchart of an analog-to-digital conversion method according to the first embodiment of the present application;
图2是根据本申请第二实施例的模数转换方法的装置实现示意图;FIG. 2 is a schematic diagram of device implementation of the analog-to-digital conversion method according to the second embodiment of the present application;
图3是根据本申请第二实施例中的一种工作时序示意图;Fig. 3 is a schematic diagram of a working sequence according to the second embodiment of the present application;
图4是根据本申请第二实施例中的另一种工作时序示意图;Fig. 4 is a schematic diagram of another working sequence according to the second embodiment of the present application;
图5是根据本申请第三实施例的模数转换方法的装置实现示意图;FIG. 5 is a schematic diagram of device implementation of the analog-to-digital conversion method according to the third embodiment of the present application;
图6是根据本申请第三实施例中的工作时序示意图;Fig. 6 is a schematic diagram of a working sequence according to a third embodiment of the present application;
图7是根据本申请第四实施例中的模数转换装置结构示意图;FIG. 7 is a schematic structural diagram of an analog-to-digital conversion device according to a fourth embodiment of the present application;
图8是根据本申请第四实施例中的模数转换单元701的结构示意图一;FIG. 8 is a first structural diagram of the analog-to-digital conversion unit 701 in the fourth embodiment of the present application;
图9是根据本申请第四实施例中的模数转换单元701的结构示意图二;FIG. 9 is a second structural diagram of the analog-to-digital conversion unit 701 according to the fourth embodiment of the present application;
图10是根据本申请第四实施例中的模数转换单元701的结构示意图三;FIG. 10 is a third structural diagram of the analog-to-digital conversion unit 701 according to the fourth embodiment of the present application;
图11是根据本申请第四实施例中的模数转换单元701的结构示意图四;FIG. 11 is a fourth structural diagram of the analog-to-digital conversion unit 701 according to the fourth embodiment of the present application;
图12是根据本申请第六实施例中的电子设备结构示意图。Fig. 12 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请部分实施例进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objectives, technical solutions, and advantages of the present application clearer, some embodiments of the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请第一实施例涉及一种模数转换方法,在本实施例中,获取待测电压在预设参考电压下经模数转换后的测量值;获取标准电压在同一预设参考电 压下经模数转换后的测量值和标准值;根据标准电压在预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数;根据参考电压波动系数对待测电压的测量值进行补偿,并将补偿后的测量值作为待测电压的模数转换结果输出。本申请的实施例中,通过标准电压在预设参考电压下经模数转换后的测量值与标准值准确的确定出模数转换过程中的参考电压波动系数,并输出根据参考电压波动系数进行补偿后的待测电压的测量值,从而避免了模数转换过程中由于参考电压波动导致的模数转换偏差,保证了模数转换结果的准确性,进而保证信号处理系统的性能。The first embodiment of the present application relates to an analog-to-digital conversion method. In this embodiment, the measured value of the voltage to be measured after analog-to-digital conversion under a preset reference voltage is obtained; the standard voltage is obtained under the same preset reference voltage. The measured value and standard value after analog-to-digital conversion; the measured value and standard value of the standard voltage after the analog-digital conversion under the preset reference voltage are used to determine the reference voltage fluctuation coefficient; the measured value of the voltage to be measured is carried out according to the reference voltage fluctuation coefficient Compensate, and output the compensated measured value as the analog-to-digital conversion result of the voltage to be measured. In the embodiment of the present application, the reference voltage fluctuation coefficient during the analog-to-digital conversion process is accurately determined by the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and the output is performed according to the reference voltage fluctuation coefficient. The compensated measured value of the voltage to be measured, thereby avoiding the deviation of the analog-to-digital conversion caused by the fluctuation of the reference voltage during the analog-to-digital conversion process, ensuring the accuracy of the analog-to-digital conversion result, and thereby ensuring the performance of the signal processing system.
下面对本实施例的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非本实施方案的必须。The implementation details of this embodiment will be described in detail below. The following content is only provided for ease of understanding and is not necessary for this embodiment.
本实施例中一种模数转换方法的具体流程如图1所示,具体包括以下步骤:The specific process of an analog-to-digital conversion method in this embodiment is shown in FIG. 1, and specifically includes the following steps:
步骤101,获取待测电压在预设参考电压下经模数转换后的测量值。Step 101: Obtain a measured value of the voltage to be measured after analog-to-digital conversion under a preset reference voltage.
具体地说,在对待测电压进行模数转换时,模数转换器从配置寄存器中获取到配置数据后,根据配置数据调整输入的参考电压、采样时间和工作时钟,然后对待测电压进行电压采样,即通过采样电压值V in与模数转换器的参考电压V ref作比较,获取待测电压经模数转换后的测量值。 Specifically, when performing analog-to-digital conversion of the voltage to be measured, after the analog-to-digital converter obtains the configuration data from the configuration register, it adjusts the input reference voltage, sampling time and working clock according to the configuration data, and then performs voltage sampling on the voltage to be measured , That is, by comparing the sampled voltage value V in with the reference voltage V ref of the analog-to-digital converter, the measured value of the voltage to be measured after the analog-to-digital conversion is obtained.
步骤102,获取标准电压在同一预设参考电压下经模数转换后的测量值和标准值。Step 102: Obtain the measured value and the standard value of the standard voltage after analog-to-digital conversion under the same preset reference voltage.
具体地说,在对标准电压进行模数转换的时候,模数转换器获取与待测电压进行模数转换时相同的配置数据,采用与待测电压进行模数转换时相同的参考电压、采样时间和工作时钟对标准电压进行采样,通过采样电压值V in与模 数转换器的参考电压V ref作比较,获取标准电压在预设参考电压下经模数转换后的测量值,并在寄存器中获取预先存储的标准电压在预设参考电压下经模数转换后的标准值。 Specifically, when performing analog-to-digital conversion on the standard voltage, the analog-to-digital converter obtains the same configuration data as the voltage to be measured for analog-to-digital conversion, and uses the same reference voltage and sampling as the voltage to be tested for analog-to-digital conversion. Time and working clock sample the standard voltage, compare the sampled voltage V in with the reference voltage V ref of the analog-to-digital converter to obtain the measured value of the standard voltage after analog-to-digital conversion under the preset reference voltage, and store it in the register Obtain the standard value of the pre-stored standard voltage after analog-to-digital conversion under the preset reference voltage.
值得一提的是,在获取待测电压经模数转换后的测量值和标准电压经模数转换后的测量值时,可以采用具有相同配置数据的不同的模数转换器对待测电压和标准电压进行同步并行的模数转换,分别获取待测电压和标准电压经过模数转换后的测量值;也可以采用同一个模数转换器,有序的将待测电压和标准电压分别作为模数转换器的输入,进而有序的获取到待测电压和标准电压经模数转换后的测量值。本实施例对于待测电压和标准电压经模数转换后测量值的获取方法不足限制。It is worth mentioning that when obtaining the measured value of the voltage to be measured after the analog-to-digital conversion and the measured value of the standard voltage after the analog-to-digital conversion, different analog-to-digital converters with the same configuration data can be used. The voltage undergoes synchronous and parallel analog-to-digital conversion, and the measured values of the voltage to be measured and the standard voltage after analog-to-digital conversion are obtained respectively; the same analog-to-digital converter can also be used to orderly use the voltage to be measured and the standard voltage as the analog-to-digital The input of the converter, and then obtain the measured value of the voltage to be measured and the standard voltage after the analog-to-digital conversion in an orderly manner. In this embodiment, the method for obtaining the measured value of the voltage to be measured and the standard voltage after the analog-to-digital conversion is insufficiently limited.
步骤103,根据标准电压在预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数。Step 103: Determine the reference voltage fluctuation coefficient according to the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value.
具体地说,在获取到标准电压在预设参考电压下经模数转换后的测量值和标准值后,根据标准电压的标准值与标准电压的测量值的比值,确定出模数转换过程中的参考电压波动系数。Specifically, after obtaining the measured value and standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage, according to the ratio of the standard value of the standard voltage to the measured value of the standard voltage, it is determined that the analog-to-digital conversion process is in progress. The reference voltage fluctuation coefficient.
在一个例子中,确定标准电压的标准值时,获取标准电压进行标定时的标定参考电压及标准电压在标定参考电压下经模数转换后的标定值;根据预设参考电压、标定参考电压以及标定值,获取标准电压在预设参考电压下经模数转换后的标准值。确定预设参考电压下标准电压的标准值时,可以根据以下公式确定标准电压的标准值D refIn one example, when the standard value of the standard voltage is determined, the calibration reference voltage of the standard voltage for calibration and the calibration value of the standard voltage after the analog-to-digital conversion under the calibration reference voltage are obtained; according to the preset reference voltage, the calibration reference voltage and Calibration value to obtain the standard value of the standard voltage after analog-to-digital conversion under the preset reference voltage. When determining the standard value of the standard voltage under the preset reference voltage, the standard value D ref of the standard voltage can be determined according to the following formula:
Figure PCTCN2020082816-appb-000004
Figure PCTCN2020082816-appb-000004
其中,V 0为标定参考电压,D 0为标准电压的标定值,V ref为当前参考电压。 Among them, V 0 is the calibrated reference voltage, D 0 is the calibrated value of the standard voltage, and V ref is the current reference voltage.
例如,选定的模数转换器为12位模数转换器,则满量程输出为4095,通过读取预先存储的标准电压标定数据,获取到在幅值为3.3V的标定参考电压V 0下,经模数转换后的标定值D 0为1489,当前对标准电压进行模数转换时的预设参考电压V ref为2.5V,则根据上述公式,可以得到在2.5V的参考电压下,标准电压的标准值应该为3.3/2.5×1489=1965。 For example, if the selected analog-to-digital converter is a 12-bit analog-to-digital converter, the full-scale output is 4095. By reading the pre-stored standard voltage calibration data, it can be obtained under the calibration reference voltage V 0 with an amplitude of 3.3V. , The calibrated value D 0 after analog-to-digital conversion is 1489, and the current preset reference voltage V ref when performing analog-to-digital conversion on the standard voltage is 2.5V. According to the above formula, it can be obtained that the standard reference voltage is 2.5V. The standard value of the voltage should be 3.3/2.5×1489=1965.
在获取到标准电压经模数转换后的测量值及标准值后,由于待测电压和标准电压在进行模数转换时采用的参考电压是一致的,因此,标准电压受电压波动的影响和待测电压受电压波动的影响是一致的,并且标准电压模数转换结果不受参考电压值变化的影响,仅受模数转换过程中电压波动的影响。因此,直接根据标准电压的标准值与标准电压的测量值的比值,即标准值/测量值,确定模数转换过程中的参考电压波动系数。After obtaining the measured value and standard value of the standard voltage after the analog-to-digital conversion, since the voltage to be measured and the standard voltage are the same as the reference voltage used in the analog-to-digital conversion, the standard voltage is affected by voltage fluctuations and the The measured voltage is uniformly affected by the voltage fluctuation, and the standard voltage analog-to-digital conversion result is not affected by the change of the reference voltage value, but is only affected by the voltage fluctuation during the analog-to-digital conversion process. Therefore, directly based on the ratio of the standard value of the standard voltage to the measured value of the standard voltage, that is, the standard value/measured value, the fluctuation coefficient of the reference voltage in the analog-to-digital conversion process is determined.
例如,获取到标准电压经模数转换后的测量值为2000,标准值为1965,将标准值与测量值的比值,作为参考电压波动系数,即参考电压波动系数为1965/2000=0.9825。For example, the measured value of the obtained standard voltage after analog-to-digital conversion is 2000, the standard value is 1965, and the ratio of the standard value to the measured value is used as the reference voltage fluctuation coefficient, that is, the reference voltage fluctuation coefficient is 1965/2000=0.825.
在另一个例子中,确定标准电压的标准值时,还可以根据选定的模数转换器及标定参考电压,实时计算出标准电压在当前的预设参考电压下进行模数转换后的标准值,然后再根据标准电压的标准值与标准电压的测量值的比值,确定模数转换过程中的参考电压波动系数。In another example, when determining the standard value of the standard voltage, the standard value of the standard voltage after the analog-to-digital conversion under the current preset reference voltage can be calculated in real time according to the selected analog-to-digital converter and the calibration reference voltage. , And then determine the reference voltage fluctuation coefficient in the analog-to-digital conversion process according to the ratio of the standard value of the standard voltage to the measured value of the standard voltage.
步骤104,输出根据参考电压波动系数进行补偿后的待测电压的测量值。Step 104: Output the measured value of the voltage to be measured after being compensated according to the reference voltage fluctuation coefficient.
具体地说,在获取到待测电压的测量值及模数转换过程中的参考电压波动系数后,根据参考电压波动系数对待测电压的测量值进行补偿,并将补偿后的测量值作为待测电压的模数转换结果输出。Specifically, after the measured value of the voltage to be measured and the reference voltage fluctuation coefficient in the analog-to-digital conversion process are obtained, the measured value of the voltage to be measured is compensated according to the reference voltage fluctuation coefficient, and the compensated measured value is used as the measured value The output of the analog-to-digital conversion result of the voltage.
在本实施例中,获取到参考电压波动系数与待测电压经模数转换后的测量值后,可以通过以下公式对待测电压经过模数转换后的测量值进行补偿:In this embodiment, after the reference voltage fluctuation coefficient and the measured value of the voltage to be measured after the analog-to-digital conversion are obtained, the measured value of the voltage to be measured after the analog-to-digital conversion can be compensated by the following formula:
Figure PCTCN2020082816-appb-000005
Figure PCTCN2020082816-appb-000005
其中,D c为补偿后的测量值,DATA1为标准电压的测量值,DATA2为待测电压的测量值,D ref为标准电压的标准值。由于标准电压是一个不为零的电压,因此,标准电压经过模数转换后的测量值也不会为零。 Among them, D c is the measured value after compensation, DATA1 is the measured value of the standard voltage, DATA2 is the measured value of the voltage to be measured, and D ref is the standard value of the standard voltage. Since the standard voltage is a non-zero voltage, the measured value of the standard voltage after analog-to-digital conversion will not be zero.
例如,获取到的标准电压的测量值为2000,标准电压的标准值为1965,待测电压的测量值为1200,则根据上述公式,将待测电压的测量值乘以参考电压波动系数0.9825,得到待测电压补偿后的测量值为1200×0.9825=1179,则将1179作为待测电压经过模数转换后的结果输出。For example, if the measured value of the obtained standard voltage is 2000, the standard value of the standard voltage is 1965, and the measured value of the voltage to be measured is 1200, then according to the above formula, the measured value of the voltage to be measured is multiplied by the reference voltage fluctuation coefficient 0.9825, The measured value of the voltage to be measured after compensation is 1200×0.9825=1179, and then 1179 is output as the result of the analog-to-digital conversion of the voltage to be measured.
本实施例相对于现有技术而言,在进行待测电压的模数转换时,根据标准电压经模数转换后的测量值与标准值确定出的模数转换过程中的参考电压波动系数,对待测电压在同一参考电压下经模数转换后的测量值进行补偿,将补偿后的测量值作为待测电压的模数转换结果输出。利用标准电压不受参考电压值影响的特性,通过标准电压模数转换过程中的偏差对待测电压的偏差进行补偿,消除待测电压测量值的误差。根据采样时的参考电压、预设标定参考电压及在预设标定参考电压下标准电压的标定值,确定出标准电压在当前参考电压下的标准值,进而根据标准电压标准值与测量值的比,保证了确定出的模数转换过程中的参考电压波动系数与实际情况的吻合程度;将待测电压经模数转换后的测量值与参考电压波动系数的乘积作为待测电压模数转换结果输出,解决了由于参考电压波动导致的模数转换偏差,保证了待测电压模数转换结果的准确性,进而避免模数转换结果偏差对信号处理系统性能的影响。Compared with the prior art, in the present embodiment, when performing analog-to-digital conversion of the voltage to be measured, the reference voltage fluctuation coefficient in the analog-to-digital conversion process is determined according to the measured value of the standard voltage after the analog-to-digital conversion and the standard value. Compensate the measured value of the voltage to be measured after analog-to-digital conversion under the same reference voltage, and output the compensated measured value as the analog-to-digital conversion result of the voltage to be measured. Using the characteristic that the standard voltage is not affected by the reference voltage value, the deviation of the voltage to be measured is compensated through the deviation in the analog-to-digital conversion process of the standard voltage, and the error of the measured value of the voltage to be measured is eliminated. Determine the standard value of the standard voltage under the current reference voltage according to the reference voltage at the time of sampling, the preset calibration reference voltage, and the calibration value of the standard voltage under the preset calibration reference voltage, and then according to the ratio of the standard value of the standard voltage to the measured value , To ensure that the determined reference voltage fluctuation coefficient in the analog-to-digital conversion process is consistent with the actual situation; the product of the measured value after the analog-to-digital conversion of the voltage to be measured and the reference voltage fluctuation coefficient is used as the result of the analog-to-digital conversion of the voltage to be measured The output solves the analog-to-digital conversion deviation caused by the fluctuation of the reference voltage, ensures the accuracy of the analog-to-digital conversion result of the voltage to be measured, and avoids the influence of the deviation of the analog-to-digital conversion result on the performance of the signal processing system.
本申请第二实施例涉及一种模数转换方法,在本实施例中,获取标准电压及待测电压的测量值时,通过两个模数转换器对标准电压及待测电压进行并行的模数转换,从而保证待测电压模数转换的效率;在不需要进行模数转换结果补偿时,两个模数转换器也可以单独工作,提高资源利用率。The second embodiment of the present application relates to an analog-to-digital conversion method. In this embodiment, when obtaining the measured values of the standard voltage and the voltage to be measured, two analog-to-digital converters are used to perform parallel analog to the standard voltage and the voltage to be measured. Digital conversion, so as to ensure the efficiency of the analog-to-digital conversion of the voltage to be measured; when there is no need to compensate for the analog-to-digital conversion result, the two analog-to-digital converters can also work independently to improve resource utilization.
本实施例中,标准电压经模数转换后的测量值,通过第一模数转换器对标准电压进行采样获取得到;待测电压经模数转换后的测量值,通过第二模数转换器对待测电压进行采样获取得到;其中,第一模数转换器与所述第二模数转换器具有相同的配置数据和时钟。本实施例的模数转换的具体实现方法可通过如图2所示的装置实现,具体说明如下:In this embodiment, the measured value of the standard voltage after the analog-to-digital conversion is obtained by sampling the standard voltage by the first analog-to-digital converter; the measured value of the voltage to be measured after the analog-to-digital conversion is obtained through the second analog-to-digital converter The voltage to be measured is sampled and obtained; wherein, the first analog-to-digital converter and the second analog-to-digital converter have the same configuration data and clock. The specific implementation method of analog-to-digital conversion in this embodiment can be implemented by the device shown in FIG. 2, and the specific description is as follows:
首先,获取标准电压及待测电压经模数转换后的测量值。First, obtain the measured values of the standard voltage and the voltage to be measured after analog-to-digital conversion.
具体地说,第一模数转换器207用于对标准电压进行采样及模数转换,第二模数转换器208用于对待测电压进行采样及模数转换。Specifically, the first analog-to-digital converter 207 is used for sampling and analog-to-digital conversion of the standard voltage, and the second analog-to-digital converter 208 is used for sampling and analog-to-digital conversion of the voltage to be measured.
为了保证模数转换补偿的准确性,需要保证对标准电压及待测电压模数转换过程的一致性,因此,进行模数转换时,两个模数转换器的配置数据、参考电压、采样时间和工作时钟需要保持一致,为了实现模数转换时的一致性,本实施例中可以通过以下两种方法实现:In order to ensure the accuracy of analog-to-digital conversion compensation, it is necessary to ensure the consistency of the analog-to-digital conversion process for the standard voltage and the voltage to be measured. Therefore, when performing analog-to-digital conversion, the configuration data, reference voltage, and sampling time of the two analog-to-digital converters It needs to be consistent with the working clock. In order to achieve consistency during analog-to-digital conversion, the following two methods can be used in this embodiment:
本实施例中的一种方法是:第一模数转换器207通过第一选择器203可选的与第一配置寄存器201和第二配置寄存器202连通,第二模数转换器208直接与第二配置寄存器202连通,在工作过程中,两个模数转换器都从第二配置寄存器202中获取配置数据,受第二配置寄存器202控制,调整自身的配置参数,从而获取相同的参考电压、采样时间和工作时钟。当然,在该方式中,也可以不含有第一配置寄存器201,也可以不含有第一选择器203,两个模数转 换器207、208都直接连接到同一个配置寄存器202。One method in this embodiment is: the first analog-to-digital converter 207 is optionally connected to the first configuration register 201 and the second configuration register 202 through the first selector 203, and the second analog-to-digital converter 208 is directly connected to the first configuration register 201 and the second configuration register 202. The second configuration register 202 is connected. During operation, both analog-to-digital converters obtain configuration data from the second configuration register 202, and are controlled by the second configuration register 202 to adjust their configuration parameters to obtain the same reference voltage, Sampling time and working clock. Of course, in this manner, the first configuration register 201 may not be included, or the first selector 203 may not be included, and the two analog-to- digital converters 207 and 208 are directly connected to the same configuration register 202.
本实施例中的另外一种方法是:在模数转换器获取配置数据前,预先对配置寄存器中的配置数据进行编辑,使得第一配置寄存器201和第二配置寄存器202中存储的配置数据是一致的。第一模数转换器207通过第一选择器与第一配置寄存器201连通,第二模数转换器208与第二配置寄存器202连通,两个模数转换器分别从连通的配置寄存器中获取配置数据,进行自身配置数据的更改,确定采样时间、工作时钟及参考电压。Another method in this embodiment is: before the analog-to-digital converter obtains the configuration data, the configuration data in the configuration register is edited in advance, so that the configuration data stored in the first configuration register 201 and the second configuration register 202 are Consistent. The first analog-to-digital converter 207 is connected to the first configuration register 201 through the first selector, the second analog-to-digital converter 208 is connected to the second configuration register 202, and the two analog-to-digital converters obtain configurations from the connected configuration registers. Data, modify its own configuration data, determine the sampling time, working clock and reference voltage.
在两个模数转换器根据配置数据完成配置更新,并通过配置寄存器启动两个模数转换器后,模数转换器根据确定的参考电压、采样时间和工作时钟,对标准电压及待测电压进行采样及量化。具体地说,第一输入选择器204将标准电压输入到第一模数转换器207中,为了便于对多个信号进行模数转换,第二模数转换器208可以有多个输入接口以连通不同的输入信号,并由第二选择开关205根据检测需求切换与第二模数转换器208连通的输入接口,在对待测电压进行模数转换时,根据待测电压对应的输入接口,第二输入选择器205将与第二模数转换器208连通的输入接口切换到待测电压对应的输入接口,从而将外部输入中的模拟待测电压输入到第二模数转换器208中,模数转换器207与208同步的对标准电压及待测电压进行电压采样,并根据采样电压与参考电压的比,对采样电压对应的测量值进行量化,确定出标准电压经模数转换后的测量值DATA1及待测电压经模数转换后的测量值DATA2,并将标准电压的测量值DATA1传输到硬件加速器209及第一数据寄存器211,将待测电压的测量值DATA2传输到硬件加速器209及第二选择器210,由第二选择器210决策是否将待测电压的测量值DATA2存储到第二数据寄存器212。After the two analog-to-digital converters complete the configuration update according to the configuration data, and start the two analog-to-digital converters through the configuration register, the analog-to-digital converter performs the correction of the standard voltage and the voltage to be measured according to the determined reference voltage, sampling time and working clock. Perform sampling and quantization. Specifically, the first input selector 204 inputs the standard voltage to the first analog-to-digital converter 207. In order to facilitate the analog-to-digital conversion of multiple signals, the second analog-to-digital converter 208 may have multiple input interfaces to communicate with each other. Different input signals, and the second selection switch 205 switches the input interface connected with the second analog-to-digital converter 208 according to the detection requirements. When the voltage to be measured is converted from analog to digital, according to the input interface corresponding to the voltage to be measured, the second The input selector 205 switches the input interface connected with the second analog-to-digital converter 208 to the input interface corresponding to the voltage to be measured, so as to input the analog voltage to be measured in the external input into the second analog-to-digital converter 208. The converters 207 and 208 synchronously sample the standard voltage and the voltage to be measured, and quantify the measured value corresponding to the sampled voltage according to the ratio of the sampled voltage to the reference voltage, and determine the measured value of the standard voltage after the analog-to-digital conversion DATA1 and the measured value DATA2 of the voltage to be measured after analog-to-digital conversion, and the measured value DATA1 of the standard voltage is transmitted to the hardware accelerator 209 and the first data register 211, and the measured value DATA2 of the voltage to be measured is transmitted to the hardware accelerator 209 and the first data register 211. The second selector 210 determines whether to store the measured value DATA2 of the voltage to be measured in the second data register 212 by the second selector 210.
获取到待测电压及标准电压经模数转换后的测量值后,根据标准电压的测量值及标准值对待测电压测量值进行补偿,并输出补偿后的测量值。After obtaining the measured value of the voltage to be measured and the standard voltage after analog-to-digital conversion, the measured value of the voltage to be measured is compensated according to the measured value of the standard voltage and the standard value, and the compensated measured value is output.
本实施例中,可以通过以下两种方法实现对待测电压的测量值的补偿:In this embodiment, the compensation of the measured value of the voltage to be measured can be realized by the following two methods:
本实施例中一种补偿方法是:若硬件加速器209处于正常工作状态,则硬件加速器209从标准电压标定寄存器206中获取在当前参考电压下标准电压的标准值D ref,结合接收到的标准电压经模数转换后的测量值DATA1和待测电压经模数转换后的测量值DATA2,利用硬件加速器209中预存的补偿计算公式:
Figure PCTCN2020082816-appb-000006
计算补偿后的待测电压的测量值D C,即DATA3,并将补偿后的测量值DATA3传输到第二选择器210中,由第二选择器210选择将待测电压补偿后的测量值DATA3传输到第二数据寄存器212中,然后直接读取第二数据寄存器中的数据DATA3,将DATA3作为待测电压模数转换的结果输出,通过本方法实现对待测电压模数转换时,装置工作的时序图如图3所示,在硬件加速器209对第一次得到的待测电压测量值进行补偿时,第一模数转换器207和第二模数转换器208可以同步的进行第二次待测电压及标准电压的采样和量化。
A compensation method in this embodiment is: if the hardware accelerator 209 is in a normal working state, the hardware accelerator 209 obtains the standard value D ref of the standard voltage under the current reference voltage from the standard voltage calibration register 206, and combines the received standard voltage The measured value DATA1 after the analog-to-digital conversion and the measured value DATA2 after the analog-to-digital conversion of the voltage to be measured use the compensation calculation formula pre-stored in the hardware accelerator 209:
Figure PCTCN2020082816-appb-000006
D C voltage measurement value measured after the compensation is calculated, i.e. DATA3, DATA3 measured value transmission measurement value and the second compensation to the selector 210, the selector 210 selects the second compensation voltage to be measured DATA3 It is transmitted to the second data register 212, and then the data DATA3 in the second data register is directly read, and DATA3 is output as the result of the analog-to-digital conversion of the voltage to be measured. When the method realizes the analog-to-digital conversion of the voltage to be measured, the device works The timing diagram is shown in FIG. 3. When the hardware accelerator 209 compensates for the voltage measurement value to be measured for the first time, the first analog-to-digital converter 207 and the second analog-to-digital converter 208 can perform the second standby synchronously. Sampling and quantification of measured voltage and standard voltage.
本实施例中另一种补偿方法是:硬件加速器209处于禁用状态,此时,第二选择器210将待测电压经模数转换后的测量值DATA2传输到第二数据寄存器212中,通过软件程序,根据模数转换器的参考电压从标准电压标定寄存器206中获取当前参考电压下标准电压的标准值D ref,并从第一数据寄存器211中获取标准电压的测量值DATA1,从第二数据寄存器212中获取待测电压的测量值DATA2,并根据预存的补偿计算公式:
Figure PCTCN2020082816-appb-000007
计算补偿后的待测电压的测量值D C,然后将补偿后的测量值作为待测电压模数转换的结果输 出,通过本方法实现待测电压模数转换时,装置的工作时序图如图4所示,通过软件直接完成对待测电压的测量值的补偿和输出,在对第一次得到的待测电压测量值进行补偿时,同步进行第二次待测电压及标准电压的采样和量化。
Another compensation method in this embodiment is: the hardware accelerator 209 is in the disabled state. At this time, the second selector 210 transmits the measured value DATA2 of the voltage to be measured after the analog-to-digital conversion to the second data register 212, and the software The program obtains the standard value D ref of the standard voltage under the current reference voltage from the standard voltage calibration register 206 according to the reference voltage of the analog-to-digital converter, and obtains the measured value DATA1 of the standard voltage from the first data register 211, from the second data The register 212 obtains the measured value DATA2 of the voltage to be measured, and according to the pre-stored compensation calculation formula:
Figure PCTCN2020082816-appb-000007
After calculating the compensation measurement D C voltage to be measured, and the measured value compensated as a result of the test voltage output of the analog to digital conversion, when the voltage to be measured to achieve analog to digital conversion, an operation timing chart of the method by means of FIG. As shown in 4, the software directly completes the compensation and output of the measured value of the voltage to be measured. When compensating the measured value of the voltage to be measured for the first time, the second sampling and quantization of the voltage to be measured and the standard voltage are performed simultaneously .
值得一提的是,在检测到对待测电压的测量值进行补偿的功能禁用后,装置中的第一选择器203可以选择将第一模数转换器207与第一配置寄存器201连通,第二模数转换器208仅与第二配置寄存器202连通,与补偿功能启用的时候不同的是,在禁用状态下,第一配置寄存器和第二配置寄存器这两个配置寄存器中存储不同的配置数据,两个模数转换器独立工作,互不影响,提高资源利用率,并且自动关断对硬件加速器209的供电,降低能耗。It is worth mentioning that after detecting that the function of compensating the measured value of the voltage to be measured is disabled, the first selector 203 in the device can choose to connect the first analog-to-digital converter 207 with the first configuration register 201, and the second The analog-to-digital converter 208 is only connected to the second configuration register 202. The difference from when the compensation function is enabled is that in the disabled state, the first configuration register and the second configuration register store different configuration data in the two configuration registers. The two analog-to-digital converters work independently, do not affect each other, improve resource utilization, and automatically shut off the power supply to the hardware accelerator 209 to reduce energy consumption.
本申请实施例相对现有技术而言,在具有第一实施例所有的有益效果的同时,通过两个同步并行的模数转换器进行标准电压及待测电压的模数转换,保证了采样和转换的效率;根据需求变更补偿计算的方法,通过硬件加速器进行补偿计算,能够尽可能地提高计算地效率,降低对CPU(处理器)的负担;通过软件进行补偿计算的时候,可以将硬件加速器关断,从而降低了模数转换过程中的整体功耗。Compared with the prior art, the embodiment of the application has all the beneficial effects of the first embodiment, and at the same time, the analog-to-digital conversion of the standard voltage and the voltage to be measured is performed through two synchronously parallel analog-to-digital converters, which ensures the sampling and Conversion efficiency; change the compensation calculation method according to the demand, and perform the compensation calculation through the hardware accelerator, which can improve the calculation efficiency as much as possible and reduce the burden on the CPU (processor); when the compensation calculation is performed by software, the hardware accelerator can be used Shutdown, thereby reducing the overall power consumption in the analog-to-digital conversion process.
本申请第三实施例涉及一种模数转换方法,在本实施例中,通过同一个模数转换器依次对标准电压及待测电压进行模数转换,进行待测电压测量值补偿时,直接通过软件计算实现对测量值的补偿,避免了需要增加硬件加速器,降低了芯片的面积,并且通过一个模数转换器实现检测,尽可能的降低了功耗。The third embodiment of the present application relates to an analog-to-digital conversion method. In this embodiment, the standard voltage and the voltage to be measured are sequentially converted from analog to digital through the same analog-to-digital converter. The compensation of the measured value is realized through software calculation, avoiding the need to increase the hardware accelerator, reducing the area of the chip, and realizing detection through an analog-to-digital converter, reducing power consumption as much as possible.
本实施例中,获取标准电压及待测电压的测量值时,待测电压经模数转换后的测量值和标准电压经模数转换后的测量值,通过同一模数转换器按照预设顺序依次对待测电压和标准电压进行采样获取得到。本实施例中模数转换的 具体实现方法可通过如图5所示的装置实现,具体说明如下:In this embodiment, when obtaining the measured values of the standard voltage and the voltage to be measured, the measured value of the voltage to be measured after the analog-to-digital conversion and the measured value of the standard voltage after the analog-to-digital conversion are passed through the same analog-to-digital converter in a preset order Sampling and obtaining the voltage to be measured and the standard voltage in turn. The specific implementation method of analog-to-digital conversion in this embodiment can be implemented by the device shown in FIG. 5, which is specifically described as follows:
首先,获取标准电压及待测电压在同一预设参考电压下经模数转换后的测量值。First, obtain the measured value of the standard voltage and the voltage to be measured after the analog-to-digital conversion under the same preset reference voltage.
具体地说,先对采样电容进行充电。第一采样电容506通过双刀双掷开关504的连接标准电压的输入,第二采样电容505通过双刀双掷开关504连接输入选择器501的输出端,输入选择器501将外部输入信号中的待测电压作为输出信号,在双刀双掷开关504闭合时,标准电压及待测电压同步的分别对第一采样电容506及第二采样电容505进行充电,在双刀双掷开关504断开时,充电同时停止。Specifically, first charge the sampling capacitor. The first sampling capacitor 506 is connected to the standard voltage input through the double-pole double-throw switch 504, and the second sampling capacitor 505 is connected to the output terminal of the input selector 501 through the double-pole double-throw switch 504. The voltage to be measured is used as the output signal. When the double-pole double-throw switch 504 is closed, the standard voltage and the voltage to be measured simultaneously charge the first sampling capacitor 506 and the second sampling capacitor 505, respectively, and the double-pole double-throw switch 504 is opened When, charging stops at the same time.
完成对采样电容的充电后,通过单刀双掷开关507,按照预设的模数转换顺序,通过配置寄存器502启动模数转换器508,将第一采样电容506或第二采样电容505与模数转换器508连通,模数转换器508根据从配置寄存器502中获取到的配置数据确定采样时间和工作时钟,对采样电容上保持的电压进行电压采样,并根据输入的参考电压和采样电压的比,对采样电容上的电压进行量化,确定采样电容对应的电压经模数转换后的测量值,然后将得到的测量值通过输出选择器509传输到第一数据寄存器503或第二数据寄存器510中进行存储。After the sampling capacitor is charged, the single-pole double-throw switch 507 is used to start the analog-to-digital converter 508 through the configuration register 502 according to the preset analog-to-digital conversion sequence. The converter 508 is connected, and the analog-to-digital converter 508 determines the sampling time and working clock according to the configuration data obtained from the configuration register 502, performs voltage sampling on the voltage held on the sampling capacitor, and performs voltage sampling according to the ratio of the input reference voltage to the sampling voltage Quantify the voltage on the sampling capacitor, determine the measured value of the voltage corresponding to the sampling capacitor after analog-to-digital conversion, and then transmit the obtained measurement value to the first data register 503 or the second data register 510 through the output selector 509 Store it.
例如,单刀双掷开关507将第一采样电容506先与模数转换器508连通,即,对标准电压进行模数转换,模数转换器508对第一采样电容506上保持的电压进行采样和量化,此时,输出选择器509将模数转换器508与第一数据寄存器503连通,模数转换器508将得到标准电压的测量值传输到第一数据寄存器503中。然后,单刀双掷开关507将第二采样电容505与模数转换器508连 通,即,对待测电压进行模数转换,根据同样的方法,对第二采样电容505上的电压进行采样和量化,输出选择开关509将模数转换器508与第二数据寄存器510连通,将待测电压的测量值传输到第二数据寄存器510中。在实际应用中,可以调整采样电容与模数转换器的连通顺序,本实施例对模数转换顺序不做限制。For example, the single-pole double-throw switch 507 connects the first sampling capacitor 506 with the analog-to-digital converter 508 first, that is, performs analog-to-digital conversion on the standard voltage, and the analog-to-digital converter 508 samples the voltage held on the first sampling capacitor 506 and For quantization, at this time, the output selector 509 connects the analog-to-digital converter 508 with the first data register 503, and the analog-to-digital converter 508 transmits the measured value of the standard voltage to the first data register 503. Then, the single-pole double-throw switch 507 connects the second sampling capacitor 505 with the analog-to-digital converter 508, that is, performs analog-to-digital conversion on the voltage to be measured. According to the same method, the voltage on the second sampling capacitor 505 is sampled and quantized. The output selection switch 509 connects the analog-to-digital converter 508 with the second data register 510, and transmits the measured value of the voltage to be measured to the second data register 510. In practical applications, the connection sequence of the sampling capacitor and the analog-to-digital converter can be adjusted, and this embodiment does not limit the sequence of the analog-to-digital conversion.
获取待测电压及标准电压经模数转换后的测量值后,对待测电压的测量值进行补偿,并输出补偿后的待测电压的测量值。After obtaining the measured value of the voltage to be measured and the standard voltage after the analog-to-digital conversion, the measured value of the voltage to be measured is compensated, and the measured value of the voltage to be measured after compensation is output.
具体地说,在将标准电压及待测电压经模数转换后的测量值分别传输到第一数据寄存器503及第二数据寄存器510后,先获取模数转换过程中的参考电压波动系数。获取参考电压波动系数前,通过软件中的控制程序,获取标准电压在当前参考电压下经模数转换后的标准值,本实施例中可以直接根据当前参考电压,根据预存的参考电压与标准电压的对应关系,在预存的标准电压的标定值中进行检索,确定当前参考电压下标准电压的标准值,或者根据当前参考电压、标准电压标定时的标定参考电压、以及标定参考电压下标准电压进行模数转换后得到的标定值,按照预存公式:
Figure PCTCN2020082816-appb-000008
计算当前参考电压下,标准电压的标准值,其中,V 0为标定参考电压,D 0为标准电压的标定值,V ref为当前参考电压。然后根据标准电压的测量值与标准值的比值,确定参考电压波动系数,再根据参考电压波动系数进行待测电压的测量值的补偿。例如,读取标准电压在当前参考电压下的标准值D ref、第一数据寄存器503中缓存的标准电压的测量值DATA1及第二数据寄存器510中缓存的待测电压的测量值DATA2,再根据预存的补偿计算公式:
Figure PCTCN2020082816-appb-000009
计算补偿后的待测电压的测量值D C,然后将补偿后的测量值作为待测电压模数转换的结果输出。
Specifically, after the measured values of the standard voltage and the voltage to be measured after the analog-to-digital conversion are transmitted to the first data register 503 and the second data register 510, respectively, the fluctuation coefficient of the reference voltage in the analog-to-digital conversion process is obtained first. Before obtaining the reference voltage fluctuation coefficient, obtain the standard value of the standard voltage after analog-to-digital conversion under the current reference voltage through the control program in the software. In this embodiment, it can be directly based on the current reference voltage and the pre-stored reference voltage and standard voltage. Correspondence relationship, search in the calibration value of the pre-stored standard voltage to determine the standard value of the standard voltage under the current reference voltage, or according to the current reference voltage, the calibration reference voltage when the standard voltage is calibrated, and the standard voltage under the calibration reference voltage The calibration value obtained after analog-to-digital conversion, according to the pre-stored formula:
Figure PCTCN2020082816-appb-000008
Calculate the standard value of the standard voltage under the current reference voltage, where V 0 is the calibrated reference voltage, D 0 is the calibrated value of the standard voltage, and V ref is the current reference voltage. Then, according to the ratio of the measured value of the standard voltage to the standard value, the reference voltage fluctuation coefficient is determined, and then the measured value of the voltage to be measured is compensated according to the reference voltage fluctuation coefficient. For example, read the standard value D ref of the standard voltage under the current reference voltage, the measured value DATA1 of the standard voltage buffered in the first data register 503, and the measured value DATA2 of the voltage to be measured buffered in the second data register 510, and then according to Pre-stored compensation calculation formula:
Figure PCTCN2020082816-appb-000009
After calculating the compensation measurement D C voltage to be measured, and the measured value compensated as a result of the test voltage output of the analog to digital conversion.
通过本方法对待测电压及标准电压完成模数转换时,装置的工作时序图如图6所示,对两个电容进行充电后,依次进行量化和处理,将采样电压转换为数字信号后,根据寄存器存储数据的格式,调整数字信号的格式与数据寄存器的格式对齐,然后将数据存储到数据寄存器中,然后再通过软件处理输出补偿后的待测电压的模数转换结果。When the analog-to-digital conversion of the voltage to be measured and the standard voltage is completed by this method, the working sequence diagram of the device is shown in Figure 6. After charging the two capacitors, quantization and processing are carried out in sequence, and the sampled voltage is converted into a digital signal according to The register stores the data format, adjusts the format of the digital signal to align with the format of the data register, then stores the data in the data register, and then processes and outputs the analog-to-digital conversion result of the compensated voltage to be measured through software.
本申请实施例相对现有技术而言,在具有第一实施例所有的有益效果的同时,只通过一个模数转换器进行待测电压及标准电压在同一参考电压下模数转换后的测量值的获取,并通过软件计算的方法实现对待测电压测量值的补偿,避免了增加硬件加速器及新的模数转换器,降低了芯片的面积以及模数转换过程中的功耗。Compared with the prior art, the embodiment of the application has all the beneficial effects of the first embodiment, and only one analog-to-digital converter is used to perform the measured value of the voltage to be measured and the standard voltage after the analog-to-digital conversion under the same reference voltage. The method of software calculation realizes the compensation of the measured voltage value to be measured, which avoids the addition of hardware accelerators and new analog-to-digital converters, and reduces the area of the chip and the power consumption during the analog-to-digital conversion process.
本申请第四实施例涉及一种模数转换装置,模数转换装置的结构示意图如图7所示,包括:模数转换单元及计算单元;The fourth embodiment of the present application relates to an analog-to-digital conversion device. The schematic structural diagram of the analog-to-digital conversion device is shown in FIG. 7 and includes: an analog-to-digital conversion unit and a calculation unit;
模数转换单元701,用于对标准电压及待测电压进行模数转换,得到标准电压及待测电压在同一预设参考电压下经模数转换后的测量值;The analog-to-digital conversion unit 701 is configured to perform analog-to-digital conversion on the standard voltage and the voltage to be measured to obtain the measured value of the standard voltage and the voltage to be measured after the analog-to-digital conversion under the same preset reference voltage;
计算单元702,用于根据标准电压经在预设参考电压下模数转换后的测量值与标准值,确定参考电压波动系数,并根据参考电压波动系数对待测电压的测量值进行补偿,将补偿后的测量值作为待测电压的模数转换结果输出。The calculation unit 702 is configured to determine the reference voltage fluctuation coefficient according to the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and compensate the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient, and compensate The subsequent measured value is output as the analog-to-digital conversion result of the voltage to be measured.
可选地,如图8所示,模数转换单元701可以包括:第一模数转换器801、第二模数转换器802、与第一模数转换器801及第二模数转换器802连接的第一配置寄存器803;Optionally, as shown in FIG. 8, the analog-to-digital conversion unit 701 may include: a first analog-to-digital converter 801, a second analog-to-digital converter 802, and a first analog-to-digital converter 801 and a second analog-to-digital converter 802 The connected first configuration register 803;
第一模数转换器801,与第一配置寄存器相连接,用于根据第一配置寄存器803存储的配置数据对标准电压进行模数转换,获取标准电压经模数转换 后的测量值。The first analog-to-digital converter 801 is connected to the first configuration register, and is used to perform analog-to-digital conversion on the standard voltage according to the configuration data stored in the first configuration register 803 to obtain the measured value of the standard voltage after the analog-to-digital conversion.
具体地说,第一模数转换器801根据从第一配置寄存器803中获取的配置数据设置自身的参考电压输入、采样时间和工作时钟,然后对标准电压进行采样,根据采样电压与参考电压的比,确定标准电压经模数转换后的测量值。Specifically, the first analog-to-digital converter 801 sets its own reference voltage input, sampling time, and working clock according to the configuration data obtained from the first configuration register 803, and then samples the standard voltage, according to the difference between the sampled voltage and the reference voltage Ratio, determine the measured value of the standard voltage after analog-to-digital conversion.
第二模数转换器802,与第一配置寄存器803相连接,用于根据第一配置寄存器803存储的配置数据对待测电压进行模数转换,获取待测电压经模数转换后的测量值。获取待测电压经模数转换后的测量值的方法与上述获取标准电压经模数转换后的测量值的方法相同,在此就不再赘述。The second analog-to-digital converter 802 is connected to the first configuration register 803, and is configured to perform analog-to-digital conversion of the voltage to be measured according to the configuration data stored in the first configuration register 803, and obtain the measured value of the voltage to be measured after the analog-to-digital conversion. The method for obtaining the measured value of the voltage to be measured after the analog-to-digital conversion is the same as the above-mentioned method for obtaining the measured value of the standard voltage after the analog-to-digital conversion, and will not be repeated here.
在另一个例子中,如图9所示,模数转换单元701还可以包括:第一模数转换器901、第二模数转换器902、第一配置寄存器903、寄存器选择开关904及第二配置寄存器905;In another example, as shown in FIG. 9, the analog-to-digital conversion unit 701 may further include: a first analog-to-digital converter 901, a second analog-to-digital converter 902, a first configuration register 903, a register selection switch 904, and a second Configuration register 905;
寄存器选择开关904的第一输入端连接第一配置寄存器903、第二输入端连接所述第二配置寄存器905、输出端连接第一模数转换器901,用于选择与第一模数转换器901连通的配置寄存器。The first input terminal of the register selection switch 904 is connected to the first configuration register 903, the second input terminal is connected to the second configuration register 905, and the output terminal is connected to the first analog-to-digital converter 901 for selecting and connecting to the first analog-to-digital converter. 901 connected configuration register.
具体地说,在对待测电压模数转换结果要求较高时,需要对待测电压模数转换结果进行补偿,此时,通过寄存器选择开关904将第一配置寄存器903与第一模数转换器901连通,第一模数转换器901与第二模数转换器902都受到第一配置寄存器903的控制,从而保证采样的同步性;在对待测电压模数转换结果精度要求较低地时候,可以关断对待测电压模数转换结果进行补偿的使能,即,不再根据标准电压经模数转换后的测量值及标准值确定出的参考电压波动系数对待测电压模数转换结果进行补偿,第一模数转换器901与第二模数转换器902可以作为独立的模数转换器单独工作,互不影响,此时,通过寄存 器选择开关904将第二配置寄存器905与第一模数转换器901连通,第一模数转换器901受第二配置寄存器905的控制,独立的对输入的待测电压进行模数转换。Specifically, when the requirements for the analog-to-digital conversion result of the voltage to be measured are relatively high, it is necessary to compensate the analog-to-digital conversion result of the voltage to be measured. Connected, the first analog-to-digital converter 901 and the second analog-to-digital converter 902 are both controlled by the first configuration register 903, so as to ensure the synchronization of sampling; when the accuracy of the analog-to-digital conversion result of the voltage to be measured is low, you can Turn off the enable for compensating the analog-digital conversion result of the voltage to be measured, that is, no longer compensate the analog-digital conversion result of the voltage to be measured based on the measured value of the standard voltage after the analog-to-digital conversion and the reference voltage fluctuation coefficient determined by the standard value. The first analog-to-digital converter 901 and the second analog-to-digital converter 902 can work as independent analog-to-digital converters without affecting each other. At this time, the second configuration register 905 is converted to the first analog-to-digital converter through the register selection switch 904 The device 901 is connected, and the first analog-to-digital converter 901 is controlled by the second configuration register 905, and independently performs analog-to-digital conversion on the input voltage to be measured.
第二配置寄存器905,用于为连通的第一模数转换器901提供配置数据。The second configuration register 905 is used to provide configuration data for the connected first analog-to-digital converter 901.
在另一个例子中,如图10所示,模数转换单元701可以包括:第一采样电容1001、第二采样电容1002、电容选择开关1003及模数转换器1004;In another example, as shown in FIG. 10, the analog-to-digital conversion unit 701 may include: a first sampling capacitor 1001, a second sampling capacitor 1002, a capacitor selection switch 1003, and an analog-to-digital converter 1004;
第一采样电容1001与电容选择开关1003相连,用于对标准电压进行采样。The first sampling capacitor 1001 is connected to the capacitor selection switch 1003 for sampling the standard voltage.
具体地说,第一采样电容1001将根据标准电压进行充电过程中获取到的电荷存储在电极板上,供模数转换器1004在与第一采样电容1001连通时,对第一采样电容1001上的电压进行转换,确定标准电压经过模数转换后的测量值。Specifically, the first sampling capacitor 1001 stores the charges acquired in the process of charging according to the standard voltage on the electrode plate, and the analog-to-digital converter 1004 is connected to the first sampling capacitor 1001 to charge the first sampling capacitor 1001. The voltage is converted to determine the measured value of the standard voltage after analog-to-digital conversion.
第二采样电容1002与电容选择开关1003相连,用于对待测电压进行采样。第二采样电容1002对待测电压进行采样的方法与第一电容1001对标准电压进行采样的方法相同,在此就不再赘述。The second sampling capacitor 1002 is connected to the capacitor selection switch 1003 for sampling the voltage to be measured. The method for sampling the voltage to be measured by the second sampling capacitor 1002 is the same as the method for sampling the standard voltage by the first capacitor 1001, which will not be repeated here.
电容选择开关1003与第一采样电容1001、第二采样电容1002及模数转换器1004相连,用于选择与模数转换器1004连通的采样电容,实现对标准电压及待测电压的采样和模数转换。The capacitor selection switch 1003 is connected to the first sampling capacitor 1001, the second sampling capacitor 1002, and the analog-to-digital converter 1004, and is used to select the sampling capacitor connected to the analog-to-digital converter 1004 to realize the sampling and analog of the standard voltage and the voltage to be measured. Number conversion.
模数转换器1004,用于依次对连通的采样电容上的电压进行模数转换,得到标准电压及待测电压经模数转换后的测量值。The analog-to-digital converter 1004 is used to sequentially perform analog-to-digital conversion on the voltage on the connected sampling capacitor to obtain the standard voltage and the measured value of the voltage to be measured after the analog-to-digital conversion.
具体地说,模数转换器1004获取连通的采样电容上的电压,确定采样电容上电压经过模数转换后的测量值,得到标准电压及待测电压经模数转换后的测量值。Specifically, the analog-to-digital converter 1004 obtains the voltage on the connected sampling capacitor, determines the measured value of the voltage on the sampling capacitor after analog-to-digital conversion, and obtains the measured value of the standard voltage and the voltage to be measured after the analog-to-digital conversion.
值得一提的是,在进行标准电压及待测电压采样的过程中,为了保证采样电容充电时长的同步及一致性,还可以在采样电容前增加一个双刀双掷开关,通过双刀双掷开关,同时控制两个采样电容的充电时长。It is worth mentioning that in the process of sampling the standard voltage and the voltage to be measured, in order to ensure the synchronization and consistency of the charging time of the sampling capacitor, a double-pole double-throw switch can be added in front of the sampling capacitor. Switch to control the charging time of the two sampling capacitors at the same time.
在另一个例子中,如图11所示,数转换单元701还可以包括:第一采样电容1101、第二采样电容1102、电容选择开关1103、模数转换器1104、输出选择开关1105、第一数据寄存器1106及第二数据寄存器1107;In another example, as shown in FIG. 11, the digital conversion unit 701 may further include: a first sampling capacitor 1101, a second sampling capacitor 1102, a capacitor selection switch 1103, an analog-to-digital converter 1104, an output selection switch 1105, and a first sampling capacitor 1101. Data register 1106 and second data register 1107;
输出选择开关1105的输入与模数转换器1104连接,输出与第一数据寄存器1106及第二数据寄存器1107连接,输出选择开关1105用于将模数转换器1104转换得到的标准电压的测量值输出到第一数据寄存器1106,即,输出选择开关1105在模数转换器1104连通的采样电容为第一采样电容1101的时候,将第一数据寄存器1106与模数转换器1104连通,将模数转换结果传输到第一数据寄存器1106中;将模数转换器1104转换得到的待测电压的测量值输出到第二数据寄存器1107,即输出选择开关1105在模数转换器1104连通的采样电容为第二采样电容1102的时候,输出选择开关1105与第二数据寄存器1107连通,将模数转换器1104的模数转换结果传输到第二数据寄存器1107中。The input of the output selection switch 1105 is connected to the analog-to-digital converter 1104, and the output is connected to the first data register 1106 and the second data register 1107. The output selection switch 1105 is used to output the measured value of the standard voltage converted by the analog-to-digital converter 1104 To the first data register 1106, that is, when the sampling capacitor connected to the analog-to-digital converter 1104 is the first sampling capacitor 1101, the output selection switch 1105 connects the first data register 1106 with the analog-to-digital converter 1104 to convert the analog to digital The result is transmitted to the first data register 1106; the measured value of the voltage to be measured converted by the analog-to-digital converter 1104 is output to the second data register 1107, that is, the sampling capacitor connected to the analog-to-digital converter 1104 by the output selection switch 1105 is the first When the second sampling capacitor 1102 is used, the output selection switch 1105 is connected to the second data register 1107, and the analog-to-digital conversion result of the analog-to-digital converter 1104 is transmitted to the second data register 1107.
在一个例子中,计算单元702可以为硬件加速器或预存有硬件加速器仿真模型的寄存器。In an example, the calculation unit 702 may be a hardware accelerator or a register pre-stored with a simulation model of the hardware accelerator.
在实际应用中,可以根据实际情况和需要对计算单元的具体结构进行设置,本实施例对计算单元结构的具体设置不做限制。In practical applications, the specific structure of the calculation unit can be set according to actual conditions and needs, and this embodiment does not limit the specific setting of the structure of the calculation unit.
本申请实施例相对现有技术而言,在进行待测电压的模数转换时,根据标准电压经模数转换后的测量值与标准值确定出的模数转换过程中的参考电压波动系数,对待测电压在同一预设参考电压下经模数转换后的测量值进行补偿, 将补偿后的测量值作为待测电压的模数转换结果输出。利用标准电压不受参考电压值影响的特性,通过同一参考电压下标准电压模数转换过程中的偏差对待测电压的偏差进行补偿,消除待测电压测量值的误差。在进行标准电压及待测电压经模数转换后的测量值的获取时,通过两个模数转换器对待测电压与标准电压进行同步并行采样,保证了待测电压模数转换的效率,而通过同一模数转换器对待测电压及标准电压进行逐次采样,能够降低芯片的面积和整体的功耗;在对模数转换结果精度要求较低时,两个模数转换器单独工作,保证了对资源的高效利用;在进行待测电压经模数转换后的测量值进行补偿时,通过硬件加速器进行测量值补偿计算,能够避免对CPU(处理器)资源的占用,并且提高补偿计算的效率,而通过软件仿真模型根据两个数据寄存器中的数据进行测量值补偿计算,能够避免增加新的硬件,降低芯片的面积和整体的功耗。Compared with the prior art, the embodiment of the present application determines the reference voltage fluctuation coefficient during the analog-to-digital conversion process according to the measured value of the standard voltage after the analog-to-digital conversion and the standard value when performing the analog-to-digital conversion of the voltage to be measured. Compensate the measured value of the voltage to be measured after the analog-to-digital conversion under the same preset reference voltage, and output the compensated measured value as the result of the analog-to-digital conversion of the voltage to be measured. Utilizing the characteristic that the standard voltage is not affected by the reference voltage value, the deviation of the standard voltage analog-to-digital conversion process under the same reference voltage is used to compensate for the deviation of the voltage to be measured, and the error of the voltage measurement value to be measured is eliminated. When the standard voltage and the measured value of the voltage to be measured are obtained after the analog-to-digital conversion, two analog-to-digital converters are used to synchronously sample the voltage to be measured and the standard voltage to ensure the efficiency of the analog-to-digital conversion of the voltage to be measured. Sequential sampling of the voltage to be measured and the standard voltage through the same analog-to-digital converter can reduce the area of the chip and the overall power consumption; when the accuracy of the analog-to-digital conversion result is low, the two analog-to-digital converters work independently to ensure Efficient use of resources; when compensating the measured value of the voltage to be measured after the analog-to-digital conversion, the hardware accelerator is used to perform the measurement value compensation calculation, which can avoid the occupation of CPU (processor) resources and improve the efficiency of the compensation calculation , And through the software simulation model to calculate the measured value compensation based on the data in the two data registers, it can avoid adding new hardware, reducing the area of the chip and the overall power consumption.
本申请第五实施例涉及一种模数转换芯片,模数转换芯片与至少一存储器连接,存储器存储有可被模数转换芯片执行的指令,指令被模数转换芯片执行,以使模数转换芯片能够执行以上本申请第一实施、第二实施例及第三实施例所述的模数转换方法。The fifth embodiment of the present application relates to an analog-to-digital conversion chip. The analog-to-digital conversion chip is connected to at least one memory. The memory stores instructions that can be executed by the analog-to-digital conversion chip. The chip can execute the analog-to-digital conversion methods described in the first, second, and third embodiments of this application.
本实施例相对于现有技术而言,在进行待测电压的模数转换时,根据标准电压经模数转换后的测量值与标准值确定出的模数转换过程中的参考电压波动系数,对待测电压经模数转换后的测量值进行补偿,将补偿后的测量值作为待测电压的模数转换结果输出。利用标准电压不受参考电压值影响的特性,通过标准电压模数转换过程中的偏差对待测电压的偏差进行补偿,消除待测电压测量值的误差。Compared with the prior art, in the present embodiment, when performing analog-to-digital conversion of the voltage to be measured, the reference voltage fluctuation coefficient in the analog-to-digital conversion process is determined according to the measured value of the standard voltage after the analog-to-digital conversion and the standard value. Compensate the measured value of the voltage to be measured after the analog-to-digital conversion, and output the compensated measured value as the result of the analog-to-digital conversion of the voltage to be measured. Using the characteristic that the standard voltage is not affected by the reference voltage value, the deviation of the voltage to be measured is compensated through the deviation in the analog-to-digital conversion process of the standard voltage, and the error of the measured value of the voltage to be measured is eliminated.
本申请第六实施例涉及一种电子设备,如图12所示,包括:存储器 1201,以及以上第五实施例所述的模数转换芯片1202,存储器1201与模数转换芯片1202通信连接。The sixth embodiment of the present application relates to an electronic device. As shown in FIG. 12, it includes a memory 1201 and the analog-to-digital conversion chip 1202 described in the fifth embodiment above, and the memory 1201 is in communication connection with the analog-to-digital conversion chip 1202.
本申请第七实施例涉及一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现以上本申请第一实施例、第二实施例及第三实施例所述的模数转换方法。The seventh embodiment of the present application relates to a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, it realizes the modules described in the first, second, and third embodiments of the present application. Conversion method.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method of the foregoing embodiments can be implemented by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
本领域的普通技术人员可以理解,上述各实施例是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。A person of ordinary skill in the art can understand that the above-mentioned embodiments are specific embodiments for realizing the present application, and in practical applications, various changes can be made to them in form and details without departing from the spirit and spirit of the present application. Scope.

Claims (16)

  1. 一种模数转换方法,其特征在于,包括:An analog-to-digital conversion method, characterized in that it comprises:
    获取待测电压在预设参考电压下经模数转换后的测量值;Obtain the measured value of the voltage to be measured after analog-to-digital conversion under the preset reference voltage;
    获取标准电压在同一所述预设参考电压下经模数转换后的测量值和标准值;Acquiring the measured value and the standard value of the standard voltage after analog-to-digital conversion under the same preset reference voltage;
    根据所述标准电压在所述预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数;Determine the reference voltage fluctuation coefficient according to the measured value and the standard value of the standard voltage after analog-to-digital conversion under the preset reference voltage;
    根据所述参考电压波动系数对所述待测电压的测量值进行补偿,并将补偿后的测量值作为所述待测电压的模数转换结果输出。Compensate the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient, and output the compensated measured value as an analog-to-digital conversion result of the voltage to be measured.
  2. 如权利要求1所述的方法,其特征在于,所述根据所述标准电压在所述预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数,包括:The method according to claim 1, wherein the determining the reference voltage fluctuation coefficient according to the measured value and the standard value of the standard voltage after the analog-to-digital conversion at the preset reference voltage comprises:
    根据所述标准电压在所述预设参考电压下经模数转换后的标准值与测量值的比值,确定所述参考电压波动系数。The reference voltage fluctuation coefficient is determined according to the ratio of the standard value after the analog-to-digital conversion of the standard voltage under the preset reference voltage to the measured value.
  3. 如权利要求2所述的方法,其特征在于,所述根据所述参考电压波动系数对所述待测电压的测量值进行补偿,包括:根据以下公式对所述待测电压的测量值进行补偿;The method of claim 2, wherein the compensating the measured value of the voltage to be measured according to the reference voltage fluctuation coefficient comprises: compensating the measured value of the voltage to be measured according to the following formula ;
    Figure PCTCN2020082816-appb-100001
    Figure PCTCN2020082816-appb-100001
    其中,D c为所述补偿后的测量值,DATA1为所述标准电压的测量值,D ref为所述标准电压的标准值,DATA2为所述待测电压的测量值。 Wherein, D c is the measured value after compensation, DATA1 is the measured value of the standard voltage, D ref is the standard value of the standard voltage, and DATA2 is the measured value of the voltage to be measured.
  4. 如权利要求1所述的方法,其特征在于,在所述根据所述标准电压在所述预设参考电压下经模数转换后的测量值和标准值,确定参考电压波动系数前,还包括:The method according to claim 1, characterized in that, before determining the reference voltage fluctuation coefficient based on the measured value and the standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage, the method further comprises :
    获取所述标准电压进行标定时的标定参考电压及所述标准电压在所述标定参考电压下经模数转换后的标定值;Acquiring a calibration reference voltage when the standard voltage is calibrated and a calibration value of the standard voltage after analog-to-digital conversion under the calibration reference voltage;
    根据所述预设参考电压、所述标定参考电压、以及所述标定值,获取所述标准电压在所述预设参考电压下经模数转换后的标准值。According to the preset reference voltage, the calibration reference voltage, and the calibration value, a standard value of the standard voltage after the analog-to-digital conversion under the preset reference voltage is obtained.
  5. 如权利要求4所述的方法,其特征在于,所述根据所述预设参考电压、所述标定参考电压、以及所述标定值,获取所述标准电压在所述当前参考电压下经模数转换后的标准值,包括:根据以下公式确定所述标准电压的标准值D refThe method according to claim 4, wherein, according to the preset reference voltage, the calibrated reference voltage, and the calibrated value, obtaining the modulus of the standard voltage under the current reference voltage The converted standard value includes: determining the standard value D ref of the standard voltage according to the following formula;
    Figure PCTCN2020082816-appb-100002
    Figure PCTCN2020082816-appb-100002
    其中,V 0为所述标定参考电压,D 0为所述标准电压的标定值,V ref为所述预设参考电压。 Wherein, V 0 is the calibration reference voltage, D 0 is the calibration value of the standard voltage, and V ref is the preset reference voltage.
  6. 如权利要求1至5中任一项所述的方法,其特征在于,The method according to any one of claims 1 to 5, wherein:
    所述标准电压经模数转换后的测量值,通过第一模数转换器对所述标准电压进行采样获取得到;The measured value of the standard voltage after the analog-to-digital conversion is obtained by sampling the standard voltage by the first analog-to-digital converter;
    所述待测电压经模数转换后的测量值,通过第二模数转换器对所述待测电压进行采样获取得到;The measured value of the voltage to be measured after the analog-to-digital conversion is obtained by sampling the voltage to be measured by a second analog-to-digital converter;
    其中,所述第一模数转换器与所述第二模数转换器具有相同的配置数据和时钟。Wherein, the first analog-to-digital converter and the second analog-to-digital converter have the same configuration data and clock.
  7. 如权利要求1至5中任一项所述的方法,其特征在于,The method according to any one of claims 1 to 5, wherein:
    所述待测电压经模数转换后的测量值和所述标准电压经模数转换后的测量值,通过同一模数转换器按照预设顺序依次对所述待测电压和所述标准电压进行采样获取得到。The measured value of the voltage to be measured after the analog-to-digital conversion and the measured value of the standard voltage after the analog-to-digital conversion are performed on the voltage to be measured and the standard voltage in sequence through the same analog-to-digital converter in a preset order Obtained by sampling.
  8. 一种模数转换装置,其特征在于,包括:模数转换单元和计算单元;An analog-to-digital conversion device, characterized by comprising: an analog-to-digital conversion unit and a calculation unit;
    所述模数转换单元,用于对标准电压及待测电压进行模数转换,得到所述标准电压及所述待测电压在同一预设参考电压下经模数转换后的测量值;The analog-to-digital conversion unit is configured to perform analog-to-digital conversion on the standard voltage and the voltage to be measured to obtain the measured value of the standard voltage and the voltage to be measured after the analog-to-digital conversion under the same preset reference voltage;
    所述计算单元,用于根据所述标准电压在所述预设参考电压下经模数转换后的测量值与标准值,确定参考电压波动系数,并根据所述参考电压波动系数对所述待测电压的测量值进行补偿,将补偿后的测量值作为所述待测电压的模数转换结果输出。The calculation unit is configured to determine the reference voltage fluctuation coefficient according to the measured value of the standard voltage after the analog-to-digital conversion under the preset reference voltage and the standard value, and to determine the reference voltage fluctuation coefficient according to the reference voltage fluctuation coefficient. The measured value of the measured voltage is compensated, and the compensated measured value is output as the analog-to-digital conversion result of the measured voltage.
  9. 如权利要求8所述的装置,其特征在于,所述模数转换单元,包括:第一模数转换器、第二模数转换器、与所述第一模数转换器及所述第二模数转换器连接的第一配置寄存器;8. The device of claim 8, wherein the analog-to-digital conversion unit comprises: a first analog-to-digital converter, a second analog-to-digital converter, and the first analog-to-digital converter and the second analog-to-digital converter; The first configuration register connected to the analog-to-digital converter;
    所述第一模数转换器,用于根据所述第一配置寄存器存储的配置数据对所述标准电压进行模数转换,获取所述标准电压经模数转换后的测量值;The first analog-to-digital converter is configured to perform analog-to-digital conversion on the standard voltage according to the configuration data stored in the first configuration register, and obtain the measured value of the standard voltage after the analog-to-digital conversion;
    所述第二模数转换器,用于根据所述第一配置寄存器存储的配置数据对所述待测电压进行模数转换,获取所述待测电压经模数转换后的测量值。The second analog-to-digital converter is configured to perform analog-to-digital conversion on the voltage to be measured according to the configuration data stored in the first configuration register, and obtain the measured value of the voltage to be measured after the analog-to-digital conversion.
  10. 如权利要求9所述的装置,其特征在于,所述模数转换单元,还包括:第二配置寄存器及寄存器选择开关;9. The device of claim 9, wherein the analog-to-digital conversion unit further comprises: a second configuration register and a register selection switch;
    所述寄存器选择开关的第一输入端连接所述第一配置寄存器、第二输入端连接所述第二配置寄存器、输出端连接所述第一模数转换器,用于选择与所述第一模数转换器连通的配置寄存器。The first input terminal of the register selection switch is connected to the first configuration register, the second input terminal is connected to the second configuration register, and the output terminal is connected to the first analog-to-digital converter. The configuration register connected to the analog-to-digital converter.
  11. 如权利要求8所述的装置,其特征在于,所述模数转换单元,包括:第一采样电容、第二采样电容、电容选择开关及模数转换器;8. The device of claim 8, wherein the analog-to-digital conversion unit comprises: a first sampling capacitor, a second sampling capacitor, a capacitor selection switch, and an analog-to-digital converter;
    所述第一采样电容,用于对所述标准电压进行采样;The first sampling capacitor is used to sample the standard voltage;
    所述第二采样电容,用于对所述待测电压进行采样;The second sampling capacitor is used to sample the voltage to be measured;
    所述第一采样电容与所述第二采样电容通过所述电容选择开关与所述模数转换器连接,所述电容选择开关用于选择与所述模数转换器连通的采样电容;The first sampling capacitor and the second sampling capacitor are connected to the analog-to-digital converter through the capacitor selection switch, and the capacitor selection switch is used to select a sampling capacitor connected to the analog-to-digital converter;
    所述模数转换器,用于依次对连通的采样电容上的电压进行模数转换,得到所述标准电压及所述待测电压经模数转换后的测量值。The analog-to-digital converter is used to sequentially perform analog-to-digital conversion on the voltage on the connected sampling capacitor to obtain the standard voltage and the measured value of the voltage to be measured after the analog-to-digital conversion.
  12. 如权利要求10所述的装置,其特征在于,所述装置还包括:输出选择开关、第一数据寄存器和第二数据寄存器;11. The device of claim 10, wherein the device further comprises: an output selection switch, a first data register, and a second data register;
    所述第一数据寄存器和所述第二数据寄存器均通过所述输出选择开关与所述模数转换器连接;Both the first data register and the second data register are connected to the analog-to-digital converter through the output selection switch;
    所述输出选择开关用于将所述模数转换器转换得到的所述标准电压的测量值输出到所述第一数据寄存器,将所述模数转换器转换得到的所述待测电压的测量值输出到所述第二数据寄存器。The output selection switch is used to output the measured value of the standard voltage obtained by the conversion of the analog-to-digital converter to the first data register, and measure the voltage to be measured obtained by the conversion of the analog-to-digital converter The value is output to the second data register.
  13. 如权利要求8所述的装置,其特征在于,所述计算单元为硬件加速器或预存有硬件加速器仿真模型的寄存器。8. The device according to claim 8, wherein the computing unit is a hardware accelerator or a register pre-stored with a simulation model of the hardware accelerator.
  14. 一种模数转换芯片,其特征在于,与至少一存储器连接,所述存储器存储有可被所述模数转换芯片执行的指令,所述指令被所述模数转换芯片执行,以使所述模数转换芯片能够执行如权利要求1至7中任一项所述的模数转换方法。An analog-to-digital conversion chip, characterized in that it is connected to at least one memory, and the memory stores instructions that can be executed by the analog-to-digital conversion chip, and the instructions are executed by the analog-to-digital conversion chip so that the The analog-to-digital conversion chip can execute the analog-to-digital conversion method according to any one of claims 1 to 7.
  15. 一种电子设备,其特征在于,包括:存储器,以及如权利要求14所述的模数转换芯片,所述存储器与所述模数转换芯片通信连接。An electronic device, characterized by comprising: a memory, and the analog-to-digital conversion chip according to claim 14, wherein the memory is communicatively connected with the analog-to-digital conversion chip.
  16. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的模数转换方法。A computer-readable storage medium storing a computer program, wherein the computer program implements the analog-to-digital conversion method according to any one of claims 1 to 7 when the computer program is executed by a processor.
PCT/CN2020/082816 2020-04-01 2020-04-01 Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium WO2021196088A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/082816 WO2021196088A1 (en) 2020-04-01 2020-04-01 Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium
CN202080001594.1A CN111819796B (en) 2020-04-01 2020-04-01 Analog-to-digital conversion method, device, chip, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/082816 WO2021196088A1 (en) 2020-04-01 2020-04-01 Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021196088A1 true WO2021196088A1 (en) 2021-10-07

Family

ID=72859241

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/082816 WO2021196088A1 (en) 2020-04-01 2020-04-01 Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN111819796B (en)
WO (1) WO2021196088A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111257626B (en) * 2020-02-26 2022-06-17 深圳市元征科技股份有限公司 Method and device for calibrating internal reference voltage of chip
CN112187274A (en) * 2020-11-27 2021-01-05 成都铭科思微电子技术有限责任公司 Circuit for improving stability of reference voltage of successive approximation type analog-to-digital converter

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102769466A (en) * 2012-07-03 2012-11-07 深圳市芯海科技有限公司 Analog-to-digital conversion method and device
CN202889329U (en) * 2012-09-20 2013-04-17 广东美的制冷设备有限公司 Device used for deviation compensation of A/D converter, temperature detection device
CN103684451A (en) * 2012-09-20 2014-03-26 广东美的制冷设备有限公司 Deviation compensation device for A/D converter and temperature detecting device and method
US20150039545A1 (en) * 2013-08-05 2015-02-05 City University of London Systems, methods and devices for vector control of permanent magnet synchronous machines using artificial neural networks
CN107154802A (en) * 2016-03-04 2017-09-12 深圳市汇顶科技股份有限公司 A kind of method and device of correcting measuring data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459428B (en) * 2007-12-14 2011-09-28 上海华虹Nec电子有限公司 Temperature compensation method for D/A converter

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102769466A (en) * 2012-07-03 2012-11-07 深圳市芯海科技有限公司 Analog-to-digital conversion method and device
CN202889329U (en) * 2012-09-20 2013-04-17 广东美的制冷设备有限公司 Device used for deviation compensation of A/D converter, temperature detection device
CN103684451A (en) * 2012-09-20 2014-03-26 广东美的制冷设备有限公司 Deviation compensation device for A/D converter and temperature detecting device and method
US20150039545A1 (en) * 2013-08-05 2015-02-05 City University of London Systems, methods and devices for vector control of permanent magnet synchronous machines using artificial neural networks
CN107154802A (en) * 2016-03-04 2017-09-12 深圳市汇顶科技股份有限公司 A kind of method and device of correcting measuring data

Also Published As

Publication number Publication date
CN111819796A (en) 2020-10-23
CN111819796B (en) 2021-10-22

Similar Documents

Publication Publication Date Title
WO2021196088A1 (en) Analog-to-digital conversion method, apparatus, and chip, electronic device, and storage medium
US7271758B2 (en) Gain adjust for SAR ADC
CN107181489B (en) Analog-to-digital conversion calibration method and device
CN112085185A (en) Quantization parameter adjusting method and device and related product
TW201025867A (en) Systems and methods for characterizing component ratios and generating a digital representation of same
CN109586720A (en) Analog-digital converter and its working method
WO2023151632A1 (en) Adc circuit and control method thereof
WO2023151633A1 (en) Adc circuit and control method therefor
CN107346975A (en) A kind of SAR types ADC high-precision calibration device
CN204886925U (en) Full sign indicating number test module of digital analog converter and full sign indicating number test system of digital analog converter
CN113258930B (en) Digital oscilloscope and correction method of time-interleaved analog-to-digital converter
CN105680860A (en) Circuit and method for improving analog-digital conversion precision of single chip computer
CN113063978B (en) Digital oscilloscope and sampling time mismatch correction method
US11057047B2 (en) Ratiometric gain error calibration schemes for delta-sigma ADCs with capacitive gain input stages
CN103163924B (en) System on chip (SoC) chip and compensation method and compensation device of operational amplifier offset voltage thereof
CN111736104A (en) Current detection calibration method and device and display device
CN116996068A (en) Gain and offset error calibration circuit for high-precision analog-to-digital converter
CN109818617A (en) A kind of high-precision calibration device of SAR type ADC
CN113364461B (en) Analog-to-digital conversion calibration method and system for chip to be tested
US20230396471A1 (en) Phase Difference Measurement Method and System for Antenna Array, and Phase Compensation Method and System for Antenna Array
CN113866661A (en) Power supply dynamic response test method, system and related components
CN104101789A (en) Measurement apparatus and method of automatic test equipment
CN110967555A (en) Method for improving trigger precision of peak power measurement
CN117254811A (en) Successive approximation type analog-to-digital converter, and calibration method and medium for capacitor array of successive approximation type analog-to-digital converter
US20240125864A1 (en) Electrochemical cell characterisation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20928899

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20928899

Country of ref document: EP

Kind code of ref document: A1