Today, I will show you the MC9S12XS128 A/D module and the development of related drivers.
What is an Analog-to-Digital (A/D) Converter
A device that can convert analog quantities into digital quantities is called an analog-to-digital (A/D) converter.
Overview of the ATD module built into the MC9S12XS
The ATD (also known as A/D) module built into the MC9S12XS128 is a 16-channel, 12-bit precision, multi-input multiplexing, successive approximation analog-to-digital converter.
Let's take a look at the basic features of the ATD module.
The ATD module has the following basic features:
l8-bit/10-bit/12-bit optional conversion accuracy;
l Conversion in stop mode uses the internal clock;
l After the conversion is completed, it will be in low power consumption state;
l Automatic and programmable value comparison, interrupt application can be set when it is greater than or less than or equal to the set value;
l Programmable sampling time;
l Left-align/right-align conversion value;
l External trigger function;
l Conversion completion interrupt request;
l 16-way analog input channel multiplexer;
l Can realize special conversion of V RH , V RL and (V RH+V RL)/2;
l The conversion sequence length is 1 to 16;
l Continuous conversion mode;
l Multi-channel scanning function;
l The external trigger function can be configured as an AD channel or 4 external additional trigger input terminals. The external trigger source can be selected as an off-chip or on-chip signal.
The MC9S12X128 ATD module registers are as follows:
I will not go into detail about the functions of each register. You can refer to the datasheet.
Let's take a look at how the AD module is implemented in detail by combining the code.
I won't talk about PLL multiplication.
The ATD initialization module mainly includes: enabling the module, setting the conversion accuracy (currently 8-bit accuracy), conversion mode setting, clock frequency setting, etc.
To obtain the AD value of the current pin, the conversion completion flag is judged. After it is set, the corresponding register is read to obtain the current AD value.
Previous article:MC9S12XEP100 What to do if local RAM is insufficient
Next article:Interrupt system of MC9S12G microcontroller
Recommended ReadingLatest update time:2024-11-16 13:22
- Popular Resources
- Popular amplifiers
- Practical Development of Automotive FlexRay Bus System (Written by Wu Baoxin, Guo Yonghong, Cao Yi, Zhao Dongyang, etc.)
- Automotive Electronics KEA Series Microcontrollers——Based on ARM Cortex-M0+ Core
- Automotive integrated circuits and their applications
- ADS2008 RF Circuit Design and Simulation Examples (Edited by Xu Xingfu)
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
- EEWORLD University Hall----Live Replay: Future Perception is Predicted by Me-The Latest Application of Sensors in the Internet of Things
- Design of Power Amplifier Circuit for MSP430F449 Single Chip Microcomputer
- Senior Sales Engineer
- [MM32 eMiniBoard Review] + Reunion with Smart Development Board
- [2022 Digi-Key Innovation Design Competition] Home Smart Dashboard - LVGL transplantation and testing
- 5G system core capability indicators
- The relationship between the four major parameters of RF microwave
- DSP basic experiment: light emitting diode display led.c
- [RVB2601 development board trial] speaker experiment
- [Shanghai Hangxin ACM32F070 development board] Light up the LCD screen and touch button function operation, drive the buzzer evaluation