BAT32G1x9 user manual | Chapter 4 Clock generation circuit
126 / 1149
Rev.1.02
4.8.4
The operation of the vibration stop detection circuit
4.8.4.1
The operation method of the vibration stop detection circuit
1. After the external reset is released, the master system clock (fmx)/secondary system clock (fsx)
begins to vibrate.
2. Writes the peripheral enable register (PER2) to enable the oscillation stop detection circuit
note
.
3. Write the Oscillation Stop Detection Mode Register (SCMMD), select the vibration state that detects
the main system clock (fmx) or the subsystem clock (fsx), and select whether the action after the
vibration stop is detected, whether to generate a reset or an interrupt.
4. Write the OSDCE bit of the vibration stop detection control register (SCMCTL), and the vibration
stop detection circuit begins to operate.
5. During the operation of the vibration stop detection circuit, the main system clock (fmx)/sub-system
clock (fsx) has been stopping the vibration during the vibration stop judgment time, and the output
vibration stop detects the signal, generating a reset or interrupt.
6. When the CPU clock is the main system clock (fmx) or the CPU clock is a PLL clock with the main
system clock (fmx) as the PLL input, and the main system clock (fmx) oscillation stop detection, the
CPU clock switches to the partition 8 (fHOCO/8)
of the internal high-speed oscillation clock
, and when
the CPU clock is a sub-system clock (fsx) and there is a subsystem clock (fsx) vibration stop
detection, The CPU clock switches to the internal low-speed oscillation clock (fIL). Clearing OSTDF
by software writing the SCMST register to 0 will cut the CPU
clock back to the original clock.
Note: Because the BIT4 (OSDCEN) of PER2 may be detected by mistake when writing 1, when using
vibration to stop detecting interrupts, you must clear the interrupt flag bit after writing PER2, and
then turn on interrupt enable. For more information about interrupt registers corresponding to
oscillation stop detection interrupts, refer to Chapter 25 Interrupt Functions.
Figure 4-33
Timing of the vibration-stop detection circuit
(Take the detection object as fsx, and the interrupt occurs after the vibration stop is detected)
reset status
12
位计数器
oscillation stop
detection period
oscillation stop
detection period
oscillation stop
detection
determination time
note
INTOSDC
OSDCE
OSDCEN
fsx
Note: Vibration stop determination time = internal low-speed oscillation clock (fIL) period
╳
((OSDCCMP11~OSDCCMP0 setting
value)
+1).