Rev. 1.10
142
October 23, 2020
Rev. 1.10
143
October 23, 2020
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
• CMPC Register
Bit
7
6
5
4
3
2
1
0
Name
—
CMPEN CMPPOL CMPO
—
—
—
CMPHYEN
R/W
—
R/W
R/W
R
—
—
—
R/W
POR
—
0
0
0
—
—
—
1
Bit 7
Unimplemented, read as “0”
Bit 6
CMPEN:
Comparator Enable Control
0: Disable
1: Enable
This is the Comparator on/off control bit. If the bit is zero the comparator will be
switched off and no power consumed even if analog voltages are applied to its inputs.
For power sensitive applications this bit should be cleared to zero if the comparator
is not used or before the devices enter the SLEEP or IDLE mode. Note that the
comparator output will ne set low when this bit is cleared to zero.
Bit 5
CMPPOL:
Comparator output polarity Control
0: Output is not inverted
1: Output is inverted
This is the Comparator polarity control bit. If the bit is zero then the comparator output
bit, CMPO, will reflect the non-inverted output condition of the comparator. If the bit
is high the comparator output bit will be inverted.
Bit 4
CMPO:
Comparator output bit
If CMPPOL=0
0: C+ < C–
1: C+ > C–
If CMPPOL=1
0: C+ > C–
1: C+ < C–
This bit stores the Comparator output bit. The polarity of the bit is determined by the
voltages on the comparator inputs and by the condition of the CMPPOL bit.
Bit 3~1
Unimplemented, read as “0”
Bit 0
CMPHYEN
: Comparator hysteresis voltage control
0: Comparator hysteresis disable
1: Comparator hysteresis enable
Refer to Comparator Characteristics section.
Comparator Interrupt
The comparator possesses its own interrupt function. When the comparator output bit changes state,
its relevant interrupt flag will be set, and if the corresponding interrupt enable bit is set, then a jump
to its relevant interrupt vector will be executed. If the microcontroller is in the SLEEP or IDLE
Mode and the comparator is enabled, then if the external input lines cause the comparator output bit
to change state, the resulting generated interrupt flag will also generate a wake-up. If it is required to
disable a wake-up from occurring, then the interrupt flag should be first set high before entering the
SLEEP or IDLE Mode.
Programming Considerations
If the comparator is enabled, it will remain active when the microcontroller enters the SLEEP or
IDLE Mode, however as it will consume a certain amount of power, the user may wish to consider
disabling it before the SLEEP or IDLE Mode is entered.
As comparator pins are shared with normal I/O pins the I/O registers for these pins will be read as
zero (port control register is “1”) or read as port data register value (port control register is “0”) if
the comparator function is enabled.