Freescale MC9S12 series ATD driver

Publisher:电子艺术大师Latest update time:2021-07-21 Source: eefocusKeywords:Freescale Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:Freescale Reference address:Freescale MC9S12 series ATD driver

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

Freescale MC9S08AW60 Assembly Learning Notes (V)
We have learned the function of table lookup before. We can use the table lookup function to implement many powerful functions, such as looking up cube tables, square tables, function tables, segment code tables displayed by digital tubes, etc. Here is another powerful function that is realized by using table lookup a
[Microcontroller]
Freescale's ECT method for detecting speed
Resources: 1. Incremental rotary encoder. A rotary encoder is a device for measuring speed. Every time the rotary encoder rotates one circle, it will output a specific number of pulses. By recording the number of pulses output by the rotary encoder in a unit time, you can know the number of revolutions of the rotary
[Microcontroller]
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号