Freescale Semiconductor MCF51QE128RM manual Interrupts, ACMPxSC Field Descriptions, Acme, Acmod

Models: MCF51QE128RM

1 424
Download 424 pages 63.71 Kb
Page 213
Image 213

 

 

Analog Comparator (S08ACMPVLPV1)

 

 

Table 10-1. ACMPxSC Field Descriptions

 

 

 

Field

 

Description

 

 

7

Analog Comparator Module Enable — The ACME bit enables the ACMP module. When the module is not

ACME

enabled, it remains in a low power state.

 

0

Analog Comparator disabled.

 

1

Analog Comparator enabled.

 

 

6

Analog Comparator Bandgap Select — The ACBGS bit selects the internal bandgap as the comparator

ACBGS

reference.

 

0

External pin ACMP1 selected as comparator non-inverting input.

 

1

Internal bandgap reference selected as comparator non-inverting input.

 

 

5

Analog Comparator Flag — The ACF bit is set when a compare event occurs. Compare events are defined by

ACF

the ACMOD0 and ACMOD1 bits. The ACF bit is cleared by writing a logic one to the bit.

 

0

Compare event has not occurred.

 

1

Compare event has occurred.

 

 

4

Analog Comparator Interrupt Enable — The ACIE bit enables the interrupt from the ACM. When this bit is set,

ACIE

an interrupt is asserted when the ACF bit is set.

 

0

Interrupt disabled.

 

1

Interrupt enabled.

 

 

3

Analog Comparator Output — Reading the ACO bit returns the current value of the analog comparator output.

ACO

The register bit is reset to zero and reads as logic zero when the ACMP module is disabled (ACME = 0).

 

 

2

Analog Comparator Output Pin Enable — ACOPE enables the comparator output to be placed onto the

ACOPE

external pin, ACMPx1O.

 

0

Analog comparator output not available on ACMPx1O.

 

1

Analog comparator output is driven out on ACMPx1O.

 

 

1:0

Analog Comparator Modes — The ACMOD1 and ACMOD0 bits select the flag setting mode that controls the

ACMOD

type of compare event that sets the ACF bit.

 

00 Comparator output falling edge.

 

01 Comparator output rising edge.

 

10 Comparator output falling edge.

 

11 Comparator output rising or falling edge.

 

 

 

10.4Functional Description

The ACMP module can be used to compare:

Two analog input voltages applied to ACMP0 and ACMP1 or

An analog input voltage applied to ACMP0 with an internal bandgap reference voltage

The ACBGS bit selects the mode of operation. The comparator output is high when the non-inverting input is greater than the inverting input, and low when the non-inverting input is less than the inverting input. The ACMOD0 and ACMOD1 bits select the condition that cause the ACF bit to be set. The ACF bit can be set on a rising edge of the comparator output, a falling edge of the comparator output, or either a rising or a falling edge (toggle). The comparator output can be read directly through the ACO bit.

10.5Interrupts

The ACMP module is capable of generating an interrupt on a compare event. The interrupt request is asserted when both the ACIE bit and the ACF bit are set. The interrupt is deasserted by clearing either the

MCF51QE128 MCU Series Reference Manual, Rev. 3

Freescale Semiconductor

213

Page 213
Image 213
Freescale Semiconductor MCF51QE128RM manual Interrupts, ACMPxSC Field Descriptions, Acme, Acmod