Data Acquisition Subsystem of ADμC812 and Its System Programming Technology

Publisher:SparklingStar22Latest update time:2011-08-24 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

ADμC812 integrates 8-channel 12-bit ADC acquisition system , 2-channel 12-bit DAC, 80C52 MCU core, 8KB flash/electrically erasable program memory, 640 bytes flash/electrically erasable data memory, watchdog timer, 640 bytes flash/electrically erasable data memory, watchdog timer, power monitor, I2C compatible SPI and standard UART serial I/O module and flexible power management scheme in a single chip, truly realizing the single-chip microcomputer application system. Due to space limitations, this article only introduces its ADC acquisition subsystem and its in-system programming technology.

1. ADC acquisition subsystem of ADμC812

1. Hardware composition structure

The ADC acquisition subsystem of ADμC812 consists of an analog multiplexer, a temperature sensor, a sample-and-hold circuit (T/H), a 12-bit successive approximation ADC, a +2.5V reference source, and ADC calibration and control logic. Its composition is shown in Figure 1.

 ADC acquisition subsystem structure of ADμC812

The effective input range of the voltage at the analog input of ADμC812 is related to the reference source. When the internal reference source is used, the effective input range is 0~+2.5V; when the external reference source is used, the external reference source should be introduced from the Vref terminal, and its suitable range is +2.3~+5V, and the corresponding analog input voltage range is 0V~Vref. In any case, the input level should not be negative or exceed the absolute maximum allowable value AVDD+0.3V. When the signal input is bipolar, a level shift network must be added to make it a unipolar signal input, as shown in Figure 2.

ADμC812 can work in the industrial range of -40~+85℃, with 3V and 5V power supply modes to further reduce power consumption. ADC simulation includes a 5μs, 8-channel, 12-bit, single-power A/D converter. Among them, the A/D converter is composed of a conventional successive approximation converter based on a capacitor DAC, which can guarantee ±1LSB differential nonlinearity and ±1/2LSB integral nonlinearity. The calibration coefficients programmed by the factory are automatically downloaded to the ADC at power-on to ensure the best ADC performance. The calibration coefficients include internal offset and gain calibration. Users can rewrite the factory-programmed calibration coefficients as needed to minimize the impact of endpoint errors in the user's target system. The voltage output from the on-chip temperature sensor is proportional to the thermodynamic temperature, which can be input through the 9th ADC channel of the multiplexer, which facilitates the implementation of temperature measurement.

Level Shifter Network

2. Software control features

Programmability is an inevitable trend in the development of application systems. To meet the actual needs of different signal sources, all components in the ADC module of ADμC812 can be easily set through three SFR registers.

(1) ADCCON1 - Control conversion and acquisition time

(2) ADCCON2 - Control ADC channel selection and conversion mode

(3) ADCCON3——ADC status indication

[page]

2. System debugging and programming technology of ADμC812

At present, since ADμC812 only provides surface mount packaging, it will cause some problems when using the simulator for program debugging. In order to facilitate debugging, ADμC812A not only integrates various hardware modules with unique features, but also integrates convenient and practical monitoring and debugging software, so that it can realize online debugging with only a small number of peripheral devices, which greatly facilitates the user's use and shortens the product development cycle. The circuit connection for enabling debugging mode is shown in Figure 3.

At the moment of power-on reset, connect the EA pin to a high level and the PSEN pin to a pull-down resistor to enable the ADμC812 to enter the monitoring and debugging support mode. In this mode, the user program can be downloaded through the PC-based Quick Start development toolkit. The user program can be debugged in real time by running the ADμC.exe debugging software under the Microsoft Windows system.

The debugging software supports single-step, breakpoint and continuous operation modes, and can easily observe the operation results of the MCU, including the contents of the internal RAM, SFR, program Flash EEPROM and data Flash EEPROM. This improves work efficiency and shortens the product development cycle. The MAX232 in Figure 3 is an RS232 level converter, which is used to convert the TTL level to the RS232 level so that it can be directly connected to the serial port of the PC for online debugging or downloading programs.

Circuit connection under system debugging and programming of ADμC812

Quick Start also provides the serial download software Download.exe that works in DOS environment. Running this software can directly program the user program into the program Flash memory in the ADμC812 chip, eliminating the need for a programmer and package adapter, and truly realizing in-system programming. The Quick Start development tool package can be downloaded from www.analog.com/microconverter/quick-start.html.

3. Timing ADC Programming Example

This example mainly explains how to use the single conversion function of ADC to achieve the purpose of timing sampling. Timer T0 is used for 1.25ms timing, and it takes 10ms for 8 channels to complete a data acquisition. In order to increase the anti-interference ability, a digital filtering function is also added to the software. Each channel is sampled 16 times continuously and then averaged, and then the high 8-bit result is sent out. The assembly language source program list is as follows:

$NOMOD51$INCLUDE() ; Use ADμC812 predefined symbols

Timer_ms_const equ(65536-9216/8);When the crystal frequency is 11.0592MHz, 10ms corresponds to 9216 cyclesADC_tlag equ 20H.0;AD conversion flag, when =1, it means that the sampled 8-channel AD values ​​are validADC_coun equ 30H;Used to indicate the ADC channel currently being processedADC_result equ 38H;38H~3FH store the ADC results of channels 0~7ADC_acc equ 40H;40~4FH store the accumulated values ​​of channels 0~7ORG 0000Hstart:jmp BeginORG start+0BHJmp Timer0_interruptORG start+100hBegin;mov SP,#60Hmov R0,#20H;Clear working unitmov R7,#40Hclr AiRAM_init;mov @R0,Ainc R0djnz R7,iRAM_initcall Timer0_init; Initialize T0 to 1.25ms interrupt once call ADC_init; Initialize ADC to single conversion setb EAControlloop:Jnb ADC_flag,Controlloop......; Take the result of AD conversion clr ADC_flag; Allow to start the next conversion jmp ControlloopADC_init:mov ADCCON1,#01101100B;

Power on ADCmov ADCCON2, ADC_count; select conversion channel retTimer0_interrupt:

setb SCONV; start single ADC conversion mov TL0,#LOW(Timer_ms_const); load timing constant mov TH0,#HIGH(Timer_ms_const) push PSW mov PSW,#00001000B; use page1 mov R2,A; store A temporarily Timer0_int_ADC: jb ADC_flag,Timer0_int_ADC_end; exit if data is not taken away Mov A,ADCCON3;

Read ADC status jb ACC.7,Timer0_int_ADCmov A,ADC_countanl A,#07Hrl Aadd A,#ADC_accmov R0,Amov A,ADCDATAL;Add ADC conversion result to accumulator add A,@R0mov @R0,Ainc R0mov A,ADCDATAHanl A,#0FHaddc A,@R0mov #R0,Ainc ADC_countmov A,ADC_countanl A,#07Hmov ADCCON2,A;Select next channelmov A,ADC_countcjne A,#80H,Timer0_int_ADC_endmov ADC_count,#0mov R0,#ADC_acc;Store ADC result after digital filteringmov R1,#ADC_resultmov R7,#08Timer0_int_save_ADC:

clr Amov #R0,Ainc R0xch A,#R0mov @R1,Ainc R0inc R1djnz,R7,Timer0_int_save_ADCsetb ADC_flagTimer0_int_ADC_end:Mov A,R2Pop PSWRetiTimer0_init;mov TH0,#HIGH(Timer_ms_const);Load timing constantmov TL0,#LOW(Timer_ms_const)anl TMOD,#11110000Borl TMDD,#00000001BSetb ET0;Enable T0 interruptSetb TR0;T0 starts runningRetEND

Reference address:Data Acquisition Subsystem of ADμC812 and Its System Programming Technology

Previous article:MCU software optimization: energy debugging
Next article:Research on Improving the Stability of Single Chip Microcomputer System

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号