![](http://datasheet.mmic.net.cn/30000/MR80C52CXXX-20SCR_datasheet_2377250/MR80C52CXXX-20SCR_263.png)
263
32142D–06/2013
ATUC64/128/256L3/4U
Figure 14-10. Generic Clock Generation
14.5.15.1
Enabling a generic clock
A generic clock is enabled by writing a one to the Clock Enable bit (CEN) in the Generic Clock
Control Register (GCCTRL). Each generic clock can individually select a clock source by writing
to the Oscillator Select field (OSCSEL). The source clock can optionally be divided by writing a
one to the Divide Enable bit (DIVEN) and the Division Factor field (DIV), resulting in the output
frequency:
where f
SRC is the frequency of the selected source clock, and fGCLK is the output frequency of the
generic clock.
14.5.15.2
Disabling a generic clock
A generic clock is disabled by writing a zero to CEN or entering a sleep mode that disables the
PB clocks. In either case, the generic clock will be switched off on the first falling edge after the
disabling event, to ensure that no glitches occur. After CEN has been written to zero, the bit will
still read as one until the next falling edge occurs, and the clock is actually switched off. When
writing a zero to CEN the other bits in GCCTRL should not be changed until CEN reads as zero,
to avoid glitches on the generic clock. The generic clocks will be automatically re-enabled when
waking from sleep.
14.5.15.3
Changing clock frequency
When changing the generic clock frequency by changing OSCSEL or DIV, the clock should be
disabled before being re-enabled with the new clock source or division setting. This prevents
glitches during the transition.
14.5.15.4
Generic clock allocation
The generic clocks are allocated to different functions as shown in the “Generic Clock Allocation”
table in the SCIF Module Configuration section.
14.5.16
Interrupts
The SCIF has the following interrupt sources:
AE - Access Error:
– A protected SCIF register was accessed without first being correctly unlocked.
Divider
O S C SEL
Gen eric C lock
DIV
0
1
D IVEN
Mask
CE N
S leep C ontroller
fSRC
fGCLK
G e neric
Clo ck
So urces
f
GCLK
f
SRC
2 DIV
1
+
----------------------------
=