English
Language : 

MC9S08GB60 Datasheet, PDF (112/290 Pages) Motorola, Inc – Microcontrollers
Internal Clock Generator (ICG) Module
7.4.2 Example #1: External Crystal = 32 kHz, Bus Frequency = 4.19 MHz
In this example, the FLL will be used (in FEE mode) to multiply the external 32 kHz oscillator up to
8.38-MHz to achieve 4.19 MHz bus frequency.
After the MCU is released from reset, the ICG is in self-clocked mode (SCM) and supplies approximately
8 MHz on ICGOUT, which corresponds to a 4 MHz bus frequency (fBus).
The clock scheme will be FLL engaged, external (FEE). So
fICGOUT = fext * P * N / R ; P = 64, fext = 32 kHz
Solving for N / R gives:
Eqn. 7-1
N / R = 8.38 MHz /(32 kHz * 64) = 4 ; we can choose N = 4 and R =1
Eqn. 7-2
The values needed in each register to set up the desired operation are:
ICGC1 = $38 (%00111000)
Bit 7
0
Bit 6 RANGE 0
Bit 5 REFS
1
Bits 4:3 CLKS 11
Bit 2 OSCSTEN 0
Bit 1
0
Bit 0
0
Unimplemented or reserved, always reads zero
Configures oscillator for low-frequency range; FLL prescale factor is 64
Oscillator using crystal or resonator is requested
FLL engaged, external reference clock mode
Oscillator disabled in stop modes
Reserved for Freescale Semiconductor internal use; always write zero
Unimplemented or reserved, always reads zero
ICGC2 = $00 (%00000000)
Bit 7 LOLRE 0
Bits 6:4 MFD
000
Bit 3 LOCRE 0
Bits 2:0 RFD
000
Generates an interrupt request on loss of lock
Sets the MFD multiplication factor to 4
Generates an interrupt request on loss of clock
Sets the RFD division factor to ÷1
ICGS1 = $xx
This is read only except for clearing interrupt flag
ICGS2 = $xx
This is read only; should read DCOS = 1 before performing any time critical tasks
ICGFLTLU/L = $xx
Only needed in self-clocked mode; FLT will be adjusted by loop to give 8.38 MHz DCO clock
Bits 15:12 unused 0000
Bits 11:0 FLT No need for user initialization
ICGTRM = $xx
Bits 7:0 TRIM
Only need to write when trimming internal oscillator; not used when external
crystal is clock source
Figure 7-8 shows flow charts for three conditions requiring ICG initialization.
MC9S08GB/GT Data Sheet, Rev. 2.3
112
Freescale Semiconductor