English
Language : 

S3C825A Datasheet, PDF (224/346 Pages) Samsung semiconductor – 8-BIT CMOS MICROCONTROLLERS
CLOCK CIRCUIT
S3C825A/P825A
SWITCHING THE CPU CLOCK
Data loading in the oscillator control register, OSCCON, determine whether a main or a sub clock is selected as
the CPU clock, and also how this frequency is to be divided by setting CLKCON. This makes it possible to switch
dynamically between main and sub clocks and to modify operating frequencies.
OSCCON.0 select the main clock (fx) or the sub clock (fxt) for the CPU clock. OSCCON .3 start or stop main
clock oscillation, and OSCCON.2 start or stop sub clock oscillation. CLKCON.4–.3 control the frequency divider
circuit, and divide the selected fxx clock by 1, 2, 8, 16.
For example, you are using the default CPU clock (normal operating mode and a main clock of fx/16) and you
want to switch from the fx clock to a sub clock and to stop the main clock. To do this, you need to set
CLKCON.4-.3 to "11", OSCCON.0 to “1”, and OSCCON.3 to “1” simultaneously. This switches the clock from fx
to fxt and stops main clock oscillation.
The following steps must be taken to switch from a sub clock to the main clock: first, set OSCCON.3 to “0” to
enable main clock oscillation. Then, after a certain number of machine cycles has elapsed, select the main clock
by setting OSCCON.0 to “0”.
+ PROGRAMMING TIP — Switching the CPU clock
1. This example shows how to change from the main clock to the sub clock:
MA2SUB LD
OSCCON,#01H
; Switches to the sub clock
; Stop the main clock oscillation
RET
2. This example shows how to change from sub clock to main clock:
SUB2MA
DLY16
DEL
AND
CALL
AND
RET
SRP
LD
NOP
DJNZ
RET
OSCCON,#07H
DLY16
OSCCON,#06H
#0C0H
R0,#20H
R0,DEL
; Start the main clock oscillation
; Delay 16 ms
; Switch to the main clock
7-6