M16C/5L Group, M16C/56 Group
7.4.3.2
Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset
Table 7.6 lists Procedure for Setting Voltage Monitor 2 Interrupt/Reset Related Bits.
Table 7.6
Procedure for Setting Voltage Monitor 2 Interrupt/Reset Related Bits
Step
Voltage Monitor 2
Interrupt
1
Set the CM14 bit in the CM1 register to 0 (125
kHz on-chip oscillator on)
2
Wait for digital filter sampling clock x 3 cycles.
3
Set the VW12E bit in the VWCE register to 1 (voltage detector enabled).
4
Use bits VD2LS3 to VD2LS0 in the VD2LS register to select Vdet2.
5
Set the VC27 bit in the VCR2 register to 1 (voltage detector 2 enabled).
6
Wait for td(E-A).
7
Use bits VW2F0 to VW2F1 in the VW2C
register to select the digital filter sampling
clock.
(2)
Set the VW2C1 bit in the VW2C register to 0
8
(digital filter enabled).
(2)
Set the VW2C6 bit in
9
the VW2C register to 0
(voltage monitor 2
interrupt mode).
10
Set the VW2C2 bit in the VW2C register to 0 (Vdet2 passage not detected).
11
Set the VW2C0 bit in the VW2C register to 1 (voltage monitor 2 interrupt/reset enabled).
Notes:
1.
Set the VW2C7 bit to 1 (when VCC reaches Vdet2 or below) for the voltage monitor 2 reset.
2.
When the VW2C0 bit is 0, steps 7, 8, and 9 can be executed simultaneously (with one instruction).
When using voltage monitor 2 interrupt or voltage monitor 2 reset to exit stop mode, set the VW2C1
bit in the VW2C register to 1 (digital filter disabled).
When voltage monitor 2 reset is generated, the LVD2R bit in the RSTFR register is automatically
becomes 1 (voltage monitor 2 reset detected). Refer to 6.4.5 "Voltage Monitor 2 Reset" for status
after reset.
Figure 7.6 shows Voltage Monitor 2 Interrupt/Reset Operation Example.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
When Using the Digital Filter
Voltage Monitor 2
Reset
Set the VW2C6 bit in
the VW2C register to 1
(voltage monitor 2
reset mode).
When Not Using the Digital Filter
Voltage Monitor 2
Interrupt
—
—
(no wait time)
Use the VW2C7 bit in the VW2C register to
select the timing of the interrupt and reset
(1)
request.
Set the VW2C1 bit in the VW2C register to 1
(digital filter disabled).
Set the VW2C6 bit in
the VW2C register to 0
(voltage monitor 2
interrupt mode).
7. Voltage Detector
Voltage Monitor 2
Reset
Set the VW2C6 bit in
the VW2C register to 1
(voltage monitor 2
reset mode).
Page 87 of 803