QE128 Quick Reference User Guide, Rev. 1.0
Freescale Semiconductor
7-1
Chapter 7
Using the Analog Comparator (ACMP) for the QE
Microcontrollers
7.1
Overview
This is a quick reference for using the analog-to-digital comparator (ACMP) module for the QE family
microcontrollers (MCUs).
Basic information about the functional description and configuration options are provided. The following
example may be modified to suit an application. The ACMP project is made for the MC9S08QE128 and
MCF51QE128 MCUs.
The ACMPx module provides a circuit for comparing two analog input voltages for comparing one analog
input voltage with an internal reference voltage. Inputs of the ACMPx module can operate across a full
range of supply voltage
ACMP Quick Reference
Because there is more than one ACMP module on this device, there may be more than one
ACMP status and control registers on your device. In the register name below, where
there’s a small x, there would be a 1 or a 2 in the software to distinguish the register that is
on an ACMP1 or an ACMP2
.
Module Configuration:
The ACMPx module has two analog inputs named ACMPx+ and ACMPx–, and one digital output named
ACMPxO. The ACMPx+ serves as a non-inverting analog input and the ACMPx– serves as an inverting
analog input. ACMPxO serves as digital output and can be enabled to drive an external pin. The ACMP1
module can be configured to connect the ACMP1O to the TPM1 input capture channel 0 by setting the
ACIC1 in the SOPT2. The TPM with the input capture function captures the time at which an external
event occurs. Rising, falling, or any edge may be chosen as the active edge that triggers an input capture.
The ACMP2 output can be driven to the TPM2 channel 0 by setting the ACIC2 in the SOPT2.
ACMPxSC
ACME
ACBGS
ACF
ACIE
ACO
ACOPE
ACMOD
ACME – enables module
ACO – reads status of output
ACBGS – select bandgap as reference
ACOPE – output pin enable
ACF – set when event occurs
ACMOD[1:0] – sets mode
ACIE – interrupt enable