Philips Semiconductors |
|
|
| User’s Manual - Preliminary - |
ANALOG COMPARATORS |
|
| P89LPC906/907/908 | |
| Comparator 1 |
| OE1 |
|
|
|
|
| |
(P0.4) CIN1A | + |
|
|
|
| CO1 |
|
| |
|
|
| CMP1 (P0.6) | |
(P0.5) CMPREF |
|
|
| |
- |
|
|
| |
Vref |
| Change Detect |
| |
|
|
| ||
| CN1 |
| CMF1 | Interrupt |
|
|
| ||
|
|
|
| EC |
Figure 10-2: Comparator Input and Output Connections
| CN1, OE1 = 0 0 |
|
| CN1, OE1 = 0 1 |
| ||||||||
CIN1A |
|
|
| + |
| CO1 | CIN1A |
|
|
| + | CO1 | CMP1 |
CMPREF |
|
| - |
| CMPREF |
|
| - | |||||
|
|
|
|
| |||||||||
|
|
|
|
|
| ||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| CN1, OE1 = 1 0 |
|
| CN1, OE 1= 1 1 |
| ||||||||
CIN1A |
|
| + |
| CO1 | CIN1A |
|
| + | CO1 | CMP1 | ||
|
|
| |||||||||||
|
|
|
| ||||||||||
Vref (1.23V) |
| - |
| Vref (1.23V) |
| - | |||||||
|
|
|
| ||||||||||
|
|
|
|
|
| ||||||||
|
|
|
|
|
| ||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Figure 10-3: Comparator Configurations
INTERNAL REFERENCE VOLTAGE
An internal reference voltage, Vref, may supply a default reference when a single comparator input pin is used. Please refer to the Datasheet for specifications.
COMPARATOR INTERRUPT
The comparator has an interrupt flag, CMF1, contained in its configuration register. This flag is set whenever the comparator output changes state. The flag may be polled by software or may be used to generate an interrupt. The interrupt will be generated when the interrupt enable bit EC in the IEN1 register is set and the interrupt system is enabled via the EA bit in the IEN0 register.
When a comparator is disabled the comparator’s output, COx, goes high. If the comparator output was low and then is disabled, the resulting transition of the comparator output from a low to high state will set the the comparator flag, CMFx. This will cause an interrupt if the comparator interrupt is enabled. The user should therefore disable the comparator interrupt prior to disabling the comparator. Additionally, the user should clear the comparator flag, CMFx, after disabling the comparator.
COMPARATOR AND POWER REDUCTION MODES
The comparator(s) may remain enabled when Power down or Idle mode is activated, but the comparator(s) are disabled automatically in Total Power down mode.
If the comparator interrupt is enabled (except in Total Power down mode), a change of the comparator output state will generate an interrupt and wake up the processor.
2003 Dec 8 | 74 |