Σ-ΔA/D technology has the characteristics of high resolution, high linearity and low cost. Based on TI's MSP430F1121 microcontroller, this paper introduces a high-precision A/D implementation scheme similar to Σ-Δ using built-in comparators and peripheral circuits, which is suitable for the acquisition of slowly changing signals such as temperature, pressure and voltage.
Among various A/D converters, the most commonly used is the successive approximation method (SAR) A/D, which has the characteristics of fixed and fast conversion time, but it is difficult to significantly improve the resolution; the integral A/D has a strong anti-interference ability, but the conversion time is long; the oversampling Σ-Δ A/D is being used more and more due to its high resolution, high linearity and low cost. Based on these characteristics, this paper uses TI's MSP430F1121 microcontroller to implement a high-precision converter solution similar to the Σ-Δ A/D technology.
MSP430F1121 is a 16-bit RISC FLASH microcontroller. The chip has 14 bidirectional I/O ports with interrupt functions, and a 16-bit timer with counting and timing functions. When the I/O port outputs a high level, the voltage is close to VCC, and when it is low, it is close to Vss. Therefore, an I/O port can be regarded as a DAC with PWM function.
The chip has a built-in analog voltage comparator, and only needs an external resistor and capacitor to form a high-precision single-slope A/D similar to the Σ-Δ technology. Generally speaking, the comparator will be affected by two factors during use. One is the accumulation of bias voltage at the comparator input; the other is that when the voltages of the two input terminals are close to a certain level, the output terminal will oscillate.
When the connection lines between the MCU ports corresponding to the two input ends of the comparator and the external input signals remain unchanged, the MSP430F1121 MCU can exchange the connection lines between the two input ends of the comparator and the corresponding MCU ports through software, and at the same time change the output polarity of the comparator, thus offsetting the accumulated bias voltage at the input end of the comparator. By connecting the output to the low-pass filter internally, even if the two comparison voltages at the comparator input end are very close, there will be no oscillation at the output end after filtering, thus eliminating the problem of output oscillation.
High-precision A/D using built-in comparator
Figure 1 shows a ready-to-use A/D conversion solution, which is a high-precision integrating A/D converter. The basic principle is to use a single I/O port to perform 1-bit digital-to-analog conversion and use the comparator output as feedback to maintain Vout equal to Vin.
Figure 1 Practical A/D converter circuit implemented using MSP430F1121
As shown in Figure 1, the circuit that generates a 1-bit DAC is a universal I/O port, a series resistor and a capacitor . Vout is generated on the capacitor. To maintain Vout=Vin, the capacitor must be charged and discharged through the I/O port, and the output of the comparator determines whether to charge or discharge (that is, the I/O port outputs a high or low level). In this way, the A/D forms a closed-loop system similar to a negative feedback system. Taking the circuit in Figure 1 as an example, when the comparator outputs a high level, it means that Vout>Vin, and the capacitor should be discharged at this time, and the I/O port outputs a low level; when the comparator outputs a low level, it means that Vout The method to determine the duration of charge and discharge is to query the output state of the comparator after a very short and fixed time t. If the output state of the comparator does not change, the output of the I/O port is maintained; when the output state of the comparator changes, the output state of the I/O port should also change. Therefore, the time for a certain state of I/O (high/low level) to be maintained may be Xt (X is an integer), thus forming a series of X1, X2, ..., Xi, ..., Xn in the entire A/D conversion process. Xn is a random number, and its value is determined by the output state of the comparator. After each unit time t, if the output of the I/O port is high, the pre-set count is increased by 1. When the A/D conversion is completed, the number of times the I/O port outputs high level is recorded as m. The time required to complete the A/D conversion depends mainly on the accuracy requirements of the A/D conversion. When a 12-bit A/D is required, the time is 4096t, that is, the comparator output is queried 4096 times, and the interval between each query is t (refer to the following program and instructions). Similarly, the time for a 16-bit A/D is 65535t. Here, 4096 or 65535 corresponding to the conversion accuracy requirement is set as N, and combined with the above, N=X1+X2+...Xn. Then combine the charging and discharging formula of the capacitor: V(t)=V(1-exp(-t/RC)) The following mathematical inference can be made on the integrating A/D to calculate Vin. N=X1+X2+……Xn The number of high level is m Assumption: Vin(t)=Vin According to Vout=Vin and the charging and discharging formula of capacitor, we can get: Vout(t)=Vin+m(Vcc-Vin)(1-exp(-t/RC))-(Nm)Vin(1-exp(-t/RC) m(Vcc-Vin)(1-exp(-t/RC)) is the charging process (Nm)Vin(1-exp(-t/RC) is the discharge process Therefore: Vin = Vcc × m/N (1) The premise for the above formula to be valid is that Vin remains unchanged in a short period of time, and the capacitor that determines Vout must be pre-charged, so that Vout=Vin before starting the A/D conversion. That is, the capacitor is pre-charged through the I/O port so that the comparator starts the integral A/D conversion after the first flip occurs. If we do some processing on formula (1), the A/D conversion process can be made more convenient: if the power supply voltage Vcc is 3.0V, N=3000, the resolution is 1mV, when m=1245, Vin=1.245V; if N=30000, the resolution is 0.1mV, when m=12456, Vin=1.2456V. In this way, the value of Vin can be obtained by simply determining m, avoiding the calculation trouble caused by directly using formula (1). Figure 2: Subroutine code for A/D conversion using a comparator Applications The low-cost A/D converter solution introduced above is suitable for the acquisition of slowly changing electrical signals, such as temperature, pressure, light, and voltage. Combined with the low power consumption characteristics of the chip, this solution is suitable for battery-powered portable instruments. The circuit shown in Figure 1 can be used to form a simple signal measurement system, using the HT1621 as the LCD display driver, and the four I/O ports P1.0~P1.3 to control the HT1621. The measurement results can be directly seen that a millivolt meter with a resolution of more than 12 bits can be constructed using this circuit. Therefore, the measurement results can be put into the FLASH memory, which has the function of memory and playback. MSP430F1121 also has a 16-bit timer, which can form a UART with an I/O port to send the measurement results and upload them to the PC, thus forming a simple storage oscilloscope with a low sampling rate.
Previous article:SAMSUNG S3C9454 Sample Program
Next article:Domestic blood glucose meter based on MSP430F435
Recommended ReadingLatest update time:2024-11-16 11:51
- Popular Resources
- Popular amplifiers
- Microgrid Stability Analysis and Control Microgrid Modeling Stability Analysis and Control to Improve Power Distribution and Power Flow Control (
- Signal and System Experiment Tutorial (Edited by Jin Bo)
- Effective Unit Testing (Lasse Koskela)
- Operational Amplifier Practical Reference Handbook (Edited by Liu Changsheng, Zhao Mingying, Liu Xu, etc.)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- WiFi 6 and "CHIP" will strongly promote the popularization of the Internet of Things. What do you think?
- OMRON H3Y-2 0-10s TIMER
- Cortex-M3 Technical Reference Manual
- Π-type LC filter in power supply in single chip microcomputer circuit
- Low power external wake-up
- FAQ_ How to lock the program in BlueNRG software to prevent it from being read out
- I'm looking for the oem23.inf file under win7 64-bit system (to solve the problem of not being able to install the STM32 virtual serial port driver), thank you!
- Sharing of super practical motor control technology resources
- Ultrasonic transducer drive circuit
- Foreign netizens share their experience of using NXP IoT