MB95630H Series
MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED 599
CHAPTER 28 COMPARATOR
28.5 Operations and Setting Procedure Example
28.5 Operations and Setting Procedure Example
The comparator can be activated by the software according to the setting of the
PD bit in the CMR0C register.
■ Software Activation of Comparator
To activate the comparator using the software, do the settings shown in Figure 28.5-1.
Figure 28.5-1 Settings for Activating Comparator
After the comparator is activated as shown above, it has to stabilize before starting to operate.
Note:
Before activating the comparator, set the IE bit in the CMR0C register to "0" in advance in
order to avoid any unexpected interrupt generated due to the comparator being unstable
at its startup.
■ Setting Procedure Example
Below is an example of procedure for setting the comparator:
● Initial settings
1. Disable the comparator interrupt request. (CMR0C:IE = 0)
2. Activate the comparator according to the settings shown in Figure 28.5-1.
3. Wait until the comparator stabilizes.
4. Clear the interrupt flag bit. (CMR0C:IF = 0)
5. Enable the comparator interrupt request (CMR0C:IE = 1), and enable the comparator output
(CMR0C:VCOE = 1) if necessary.
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
CMR0C — — OS IF IE VCID VCOE PD
××❍❍ 0000
❍ : Bit to be used
× : Unused bit
0 : Set to "0"