Switching The Cpu Clock - Samsung S3C8275X User Manual

8-bit cmos microcontrollers
Table of Contents

Advertisement

S3C8275X/F8275X/C8278X/F8278X/C8274X/F8274X

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
RET
2. This example shows how to change from sub clock to main clock:
SUB2MA
AND
CALL
AND
RET
DLY16
SRP
LD
DEL
NOP
DJNZ
RET
OSCCON,#01H
OSCCON,#07H
DLY16
OSCCON,#06H
#0C0H
R0,#20H
R0,DEL
; Switches to the sub clock
; Stop the main clock oscillation
; Start the main clock oscillation
; Delay 16 ms
; Switch to the main clock
CLOCK CIRCUIT
7-7

Advertisement

Table of Contents
loading

This manual is also suitable for:

F8275xF8274xC8278xC8274xF8278x

Table of Contents