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.
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.
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.
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
Previous article:MCU software optimization: energy debugging
Next article:Research on Improving the Stability of Single Chip Microcomputer System
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
- Do you know about incomplete types in C language?
- Technical characteristics and wide application of embedded systems
- Student dormitory apartment monitoring system based on Internet of Things
- 【DIY】Make a 5V input car light controller
- Linux self-study notes (II) Linux disk partition
- EEWORLD University Hall ---- Intelligent Information Processing Peking University Tan Ying
- 【Gravity:AS7341 Review】+Received Color Sensor
- Xunwei IMX6Q development board AndroidStudio-calendar test
- Do you repair Mitsubishi PLC, Siemens PLC, servo drive boards, etc.?
- 6U VPX signal processing card based on C6678+XC7V690T