A Cheap and Practical Dual-Integral A/D Converter

Publisher:RadiantBlossomLatest update time:2021-05-27 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Principle

The 51 series microcontroller has more than two 16-bit dual-channel timers (TIME0 and TIME1), and each channel can be selected as an input capture mode to measure the pulse width. We use the on-chip 16-bit timer to connect an external op amp and comparator to realize dual-integration A/D conversion. The schematic diagram is shown in Figure 1 (the power supply and the 51 microcontroller peripheral circuit are the same as the conventional circuit). TL082 is a JFETINPUT op amp; LM358 is a comparator; MC4066 is a multiplexer. P10, P11, and P12 of the 51 microcontroller P1 port are used as outputs to control the input selection of the MC4066 multiplexer; INT0 is used as an interrupt input port to capture the output level jump of the LM358 comparator. C1 is an integral capacitor, usually a polypropylene capacitor of about 0.22μF, R2 is an integral resistor, which can be about 500k, U2A is an integral op amp, U2A, C1, and R2 constitute an integrator, and U2B is a zero-crossing detection op amp. VIN is the input voltage, VREF is the reference voltage, and AGND is the reference zero point of the converter. VREF and the reference zero point are generated by voltage division by R9, R10, and R11.


Before measurement, TK3=1, TK2=0, TK1=0, turn on the U1C and U1D analog switches, make the integrator input equal to AGND, and enter the zeroing stage. The time for the first start-up conversion is 300ms; the zeroing time after startup is 40ms. When the conversion starts, TK3=0, TK2=0, TK1=1, the integrator input is connected to the input voltage, so that VIN charges C1 through the integration resistor R2, and the integration time is set to T. Then, TK3=0, TK2=1, TK1=0, that is, the integrator input is connected to the reference voltage VREF, and the capacitor C1 begins to discharge reversely to VREF through R2. When the output of the op amp is lower than the C2 capacitor voltage, the comparator output reverses. Then, TK3=1, TK2=0, TK1=0, turn on the U1C and U1D analog switches, and enter the zeroing stage again. Let the time of reverse charging be t, then we have

In the above formula, VIN is the measured voltage, T is the forward integration time, t is the reverse integration time, VREF is the reference voltage, and AGND is the reference zero point of the converter. The integrator output waveform is shown in Figure 2.



The program consists of an initialization program, an input capture interrupt service program, a TIME0 interrupt service program, and an interface program that calls the program module.


When the program is initialized, set TK3=1, TK2=0, TK1=0, and the software delays for 300ms to perform initial zeroing; when performing forward integration, turn off INT0, set TK3=0, TK2=0, TK1=1, turn on TIME0 (set TIME0 to work in timing mode), and perform timed forward integration; after the forward integration is completed, set the timing TIME0 to work in input capture mode, turn on INT0, set TK3=0, TK2=1, TK1=0, and perform reverse integration. TIME0 is used for timing, and another register is used to count the number of timer overflows; when the comparator output reverses and the INT0 interrupt occurs, the microcontroller automatically turns off TIME0 and completes a double-integration A/D conversion. AD value (HEX) = register count value * 100 + TIME0.


The source program list is as follows:


(1) The charge and discharge time (T and t) should generally not exceed 2RC. If this is exceeded, the linear error will increase.

(2) When designing the PCB board, the ground of the analog and digital power supply should be separated and connected at a single point; the connection lines of the AD conversion components should be as short as possible, and these components should be separated from the digital components; the PCB board should use a thicker copper foil.

(3) Keep the PCB board and components clean, and the analog part should be coated with waterproof glue.

(4) The integrating capacitor should be a polypropylene capacitor with low leakage, and the reference voltage divider resistor and integrating resistor should be resistors with small temperature coefficient and noise.


Reference address:A Cheap and Practical Dual-Integral A/D Converter

Previous article:Proteus simulation 51 single chip microcomputer C language - single chip microcomputer sends a string to the host
Next article:Very simple 8×8LED dot matrix c51 source code

Recommended ReadingLatest update time:2024-11-16 16:46

Special chip CS5460A for energy measurement
    Abstract: This article introduces the principle, characteristics and typical applications of the single-phase bidirectional power/energy chip CS5460A newly launched by Cirrus Logic Company in the United States. Using it as the core to manufacture electric meters has a simple structure, complete functions, excelle
[Test Measurement]
Analysis of technical indicators, characteristics and functions of E4982A LCR meter
The E4982A LCR meter provides optimal performance for manufacturing testing of passive components such as SMD inductors and EMI filters, where impedance testing is required at high frequencies (1 MHz to 3 GHz). In addition to manufacturing testing, the E4982A can also be used in R&D to provide quality assurance with p
[Test Measurement]
Spectrum Analyzer Maintenance--N9030A Startup Error Failure Case
1. Fault phenomenon: 10db and above attenuation power is inaccurate; startup error Error finding operating system, operating system not found 2. Testing process After receiving the instrument, we first checked whether the instrument had passed the original factory warranty. After checking, the instrument had passed
[Test Measurement]
Spectrum Analyzer Maintenance--N9030A Startup Error Failure Case
Self-developed brain-computer interface chip to be released Ningju Technology receives millions of dollars in Pre-A round of financing
NeuraMatrix, a domestic brain-computer interface company, has completed a multi-million dollar Pre-A round of financing, led by Matrix Partners China. Tianyancha shows that Ningju Technology has previously received investments from Huachuang Capital and Zhen Fund. Ningju Technology was founded in 2019 and was incuba
[Mobile phone portable]
stc12c5a60s2 independent baud rate device - serial port
//11.0592M #include reg51.h char flag; sfr AUXR= 0x8E; //The 4th bit of the auxiliary register is the independent baud rate operation control bit. If the 0th bit is 0, the serial port 1 uses timer 1 as the baud rate generator. If it is 1, the independent baud rate generator is used. sfr BRT = 0x9C; //Independent b
[Microcontroller]
Design of closed-loop digital control system for power amplifier based on C5509A
introduction With the development of communication systems, communications are required to have higher transmission reliability and stronger anti-interference capabilities. In the process of wireless signal transmission, the RF signal must be amplified by the power amplifier and then transmitted through the
[Embedded]
5G base station construction drives the antenna array industry to explode, and many A-share manufacturers are vying to enter the market
As one of the most anticipated infrastructures in the new infrastructure, 5G base stations bear the foundation of 5G construction. Not long ago, on the first anniversary of 5G commercial use, data released by the Ministry of Industry and Information Technology showed that basic telecommunications companies have built
[Mobile phone portable]
Design of Audio Signal Analyzer Based on DSPIC30F6014A Single Chip Microcomputer
O Introduction At present, most audio signal processors are not only large in size but also expensive, and are difficult to be widely used in some special aspects. Embedded system analyzers are small and reliable, so the development of audio analysis instruments based on special function microcontrollers is the basis
[Microcontroller]
Design of Audio Signal Analyzer Based on DSPIC30F6014A Single Chip Microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号