Design of High-precision A/D Converter Using MSP430F1121 Built-in Comparator

Publisher:annye_chengLatest update time:2018-01-29 Source: eefocusKeywords:MSP430F1121 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Σ-Δ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

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

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.


Keywords:MSP430F1121 Reference address:Design of High-precision A/D Converter Using MSP430F1121 Built-in Comparator

Previous article:SAMSUNG S3C9454 Sample Program
Next article:Domestic blood glucose meter based on MSP430F435

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

iPhone SE preview: 5G support and A15 chip
According to a forecast report from research firm TrendForce, Apple plans to release the third-generation iPhone SE in the first quarter of 2022. If this time proves to be accurate, we can expect the device to be released before the end of March. As previously rumored, TrendForce says the new iPhone SE will remain a m
[Mobile phone portable]
iPhone SE preview: 5G support and A15 chip
OK6410A development board (eight) 66 linux-5.11 OK6410A linux concurrency race and synchronization
Errors caused by concurrent execution units: race conditions a is initialized to 0 A kernel process adds 1 to variable a B kernel process adds 1 to variable a a is now 2 The following sequence will not be a problem A loads a in memory into register A register increments by 1 A store register value into memory B l
[Microcontroller]
Apple iOS/iPadOS 15 developer preview Beta 4 (19A5307g) released
Apple today pushed the iOS/iPadOS 15 Developer Preview Beta4 update (internal version number: 19A5307g) to iPhone and iPad users. This update was released one week after the last one.   The following are the contents of this update:   Safari Update   Apple continues to improve the design of Safari on iPhone, making
[Mobile phone portable]
Apple iOS/iPadOS 15 developer preview Beta 4 (19A5307g) released
OK6410A development board (V) u-boot-2021.01 ported to ok6410a
The code used is https://github.com/u-boot/u-boot TAG v2021.01 development based on this code The ok6410a related code used comes from https://blog.csdn.net/Golden_Chen/article/details/89077655  The code is available at https://github.com/lisider/u-boot/tree/ok6410a Three submissions have been made so far Commit
[Microcontroller]
A pocket oscilloscope composed of STC12C5A50S2 and NOKIA1100 LCD screen
     This pocket oscilloscope is composed of STC12C5A50S2 and NOKIA1100 LCD screen. Function: It can measure dual-channel waveforms, the sampling rate ranges from 75KHz to 15Hz, and the input voltage should be able to reach 50V (I have not tested higher voltages).               Main components: powered by
[Microcontroller]
A pocket oscilloscope composed of STC12C5A50S2 and NOKIA1100 LCD screen
Intel will continue to be a TSMC customer and aims to win a small number of foundry orders at the 18A node
According to news on March 15, Intel CFO David Zinsner recently stated at the Morgan Stanley TMT conference that Intel will continue to be a customer of TSMC, and its foundry business aims to win a small number of foundry orders at the 18A node. In response to questions, Zinsner said that Intel is currently one of TSM
[Semiconductor design/manufacturing]
Samsung Galaxy Tab A7 Lite tablet will be released with 8.7-inch screen
      According to foreign media Sammobile, the Samsung Galaxy Tab A7 Lite tablet is about to be released. This product, code-named SM-T225, has appeared in the Bluetooth SIG database.   The report said that this entry-level tablet has an 8.7-inch screen, a metal body, and an ultra-thin design. The Geekbench runnin
[Mobile phone portable]
Samsung Galaxy Tab A7 Lite tablet will be released with 8.7-inch screen
Ruishi Technology completed a round A financing of over 100 million yuan and continued to focus on the VCSEL field
According to 36Kr, Ruishi Technology recently completed a round A financing of more than 100 million yuan, led by Chuanggu Capital, followed by Haiheng Capital, Huiyou Capital, Yangzi Xinrui, Guohua Investment and Beijing Bainawell Technology Co., Ltd. It is reported that this round of financing will be mainly used fo
[Mobile phone portable]
Ruishi Technology completed a round A financing of over 100 million yuan and continued to focus on the VCSEL field
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号