Design of 10-bit high-precision ADC based on STC12C5410AD

Publisher:琴弦悠扬Latest update time:2012-11-08 Source: 代电子技术 Keywords:STC12C5410 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
Testability refers to the design characteristics of a product that can determine its status (operable, inoperable, performance degradation) and internal faults of the isolator in a timely and accurate manner. In 1976, F. Liu et al. first proposed the concept of testability in the article "Automatic Testability Design of Equipment". Subsequently, testability has been used in the design of diagnostic circuits and other fields. With the increasing complexity and technical content of equipment, maintainability and testability have had an increasingly important impact on the combat capability, survivability, mobility, and maintenance personnel of equipment.
In the era of rapid development of information, the built-in technology (BIT) of modern radar equipment pursues real-time, accuracy, and efficiency. Therefore, the signal acquisition technology in state monitoring needs to have high-speed and stable characteristics. Many non-electrical physical quantities (such as temperature, pressure, etc.) and some other electrical parameters (such as capacitance, resistance, power, etc.) in radar equipment can be converted into voltage form, and stable and high-precision digital signals can be obtained with the help of ADC (analog/digital converter), providing reliable guarantee for signal feature analysis.
The technology of using single-chip microcomputers to realize ADCs for various needs has been widely used, and the technology is becoming more mature and stable. In order to meet the requirements of different signal processing and signal detection, a large number of single-chip data acquisition circuits with different structures and performances have been born. The mainstream trends are nothing more than two algorithms: successive approximation digital-to-analog converter and dual-integral digital-to-analog converter. Each has different advantages and disadvantages and is widely used in different fields. Considering stability, this paper selected a single-chip microcomputer that uses a successive approximation digital-to-analog converter: the STC12C5410 series.

1 Hardware Design
1.1
The selection of the STC12C5410AD chip is directly related to the design of the hardware circuit and the sensitivity of the built-in test system. The single-chip microcomputer STC12C5410AD is a new generation of enhanced 8051 single-chip microcomputer with high speed and low power consumption, as shown in Figure 1.

The STC12 series MCU is an enhanced 8051 MCU launched by the American STC company after making significant improvements on the standard core structure of the 8051 MCU. The STC12 MCU is fully compatible with the 8051 MCU from the core to the instructions; C represents the operating voltage of 5.5 to 3.8V; 12 represents that the speed is 12 times that of 8051 at the same CPU operating frequency; 54 represents that the RAM is 512B and the PCA/PWM is 4-way; 10 represents the program storage space size of 10 KB. AD represents the A/D conversion function, with a total of 8 ADC ports, namely P1.0 to P1.7. You can set any one of them as an A/D conversion port through programming (the selected I/O port needs to be set to open drain and high impedance mode) and set the conversion rate. The fastest conversion rate is 210 clock cycles/time (the fastest speed can reach 200kHz), and the other 3 options are 420 clock cycles/time, 630 clock cycles/time, and 840 clock cycles/time.
There are 23 I/O ports in total, including 8 P1 ports, 8 P2 ports, and 7 P3 ports;
there is a built-in reset circuit, which can be reset through soft design.
1.2 Circuit Design
The circuit schematic diagram is shown in Figure 2. The internal crystal oscillator of the STC12C5410AD chip is 5.2~6.8 MHz. In order to improve the accuracy, an external crystal oscillator can be used during design. The crystal oscillator can select a fixed value according to the actual situation. STC12C5410AD can guarantee a 10-bit digital signal output, which just meets the design requirements. The power supply voltage circuit uses a 9805 voltage regulator. In order to improve the accuracy of the conversion output, the power supply circuit of the LM317 voltage regulator can also be used to adjust the output voltage to 5 V. The input voltage of the A/D conversion circuit is 0-5 V. The input is adjusted with a potentiometer. The circuit is designed to follow up in real time and convert the output to a stable signal.

Connect the serial port RXD and TXD to MAX232 and connect it to the PC, which is convenient for burning and modifying programs, online debugging of programs, and online monitoring of output results. The parallel output port selects P2.0~P2.7 (high 8 bits) and P1.0~P1.1 (low 2 bits). Each pin is connected to an LED light to observe whether the pin can output high and low levels normally. The A/D conversion interface selects P1.7. After the external grounding capacitor is connected, it can be directly connected to the adjustment potentiometer, and the adjustment voltage range is 0~5 V. [page]

2 Software Design
2.1 Related Settings of Registers
To implement the above design, the STC12C5410AD microcontroller must set the related registers:
By setting the two registers P1M0 and P1M1, the P1 port is selected as the input port of the A/D conversion. For example, if P1.7 is selected, set:
P1M0=0x80;
P1M1=0x80;
Select the I/O port mode as open drain (Open Drain), which can be used as A/D, and you can also choose high-impedance input, set to:
P1M0=0x80;
P1M1=0x00;
ADC_CONTR special function register, from high to low, represents:
ADC_POWER SPEED1 SPEED0 ADC_FLAG CHS2CHS1 CHS0;
Select P1.7 as the A/D input pin and set CHS2/CHS1/CHS0 to:
CHS2=1;
CHS1=1;
CHS0=1;
SPEED1/SPEED0 is the control bit of the digital/analog conversion rate. In order to achieve the fastest conversion rate, this design uses 210 clock cycles to convert once, set to:
SPEED1=1;
SPEED0=1;
ADC_FLAG bit is the end of analog/digital conversion flag bit, which automatically jumps to "1" after the conversion is completed and needs to be cleared by software;
ADC_START is the ADC start control bit, set to:
ADC_START=1; // Analog/digital conversion starts
ADC_DATA, ADC_LOW2 are the high 8 bits and low 2 bits of the 10-bit analog/digital conversion result registers. The conversion calculation formula is:
(ADC_DATA[7:0], ADC_LOW2[1:0])=1 024*Vin/Vcc;
Where: Vin is the input voltage of the analog input channel; Vcc is the power supply voltage of the microcontroller, which is determined by the output end of the microcontroller power supply circuit 9805 or the LM317 voltage regulator circuit.
2.2 Software debugging
A/D initialization subroutine and subroutine to start A/D conversion:
f.JPG

3 Conclusion
The proportion of the in-machine test system in the equipment system shall not exceed 10% of the equipment, otherwise it will affect the normal operation of the equipment. In signal acquisition, the simplification of hardware design is particularly important. This design not only meets the requirements of simplifying the components of the design circuit and sharing multiple test points. The resolution of the 10-bit ADC can theoretically reach 1/1 024. In order to stabilize the output frequency, a transfer register is added in the test to maintain the conversion result, and a sliding filter is used to eliminate the noise influence of unstable signals. Finally, the test results can maintain a long-term stable output and meet the expected requirements of the test. At the same time, the lowest bit can jump continuously to ensure the continuity and accuracy of the output. This design has high precision requirements for the analog-to-digital converter. During the debugging process, the power supply voltage of the STC12C5410AD microcontroller needs to be fine-tuned. The LM317 voltage regulator power supply circuit is used in the design to adjust the input voltage to ensure that the voltage is accurately and stably at 5 V. The effect and efficiency achieved are far higher than the analog-to-digital conversion requirements of the BIT of the radar equipment. At the same time, the design is simple and effective, with a low failure rate, and can maintain stable operation. The design optimizes the hardware circuit design, simplifies components, reduces costs and the failure rate of actual circuit operation while ensuring the design requirements. There are two shortcomings of this design: the degree of integration is still too low, and the solution is to use a small patch board design; there is no ability to process signals at the same time. Subsequent research will mainly focus on improving these two points.

Keywords:STC12C5410 Reference address:Design of 10-bit high-precision ADC based on STC12C5410AD

Previous article:Temperature plotter based on tinyAVR and Nokia3310 LCD
Next article:Design and implementation of three-dimensional rotating LED based on STC11F02E

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
Guess you like

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号