English
Language : 

MC9S08GB60A Datasheet, PDF (118/302 Pages) Freescale Semiconductor, Inc – HCS08 Microcontrollers
Internal Clock Generator (S08ICGV2)
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 HGO
0
Bit 6 RANGE 0
Bit 5 REFS
1
Bits 4:3 CLKS 11
Bit 2 OSCSTEN 0
Bit 1 LOCD 0
Bit 0
0
Configures oscillator for low-power operation
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
Loss-of-clock detection enabled
Unimplemented or reserved, always reads zero
ICGC2 = $00 (%00000000)
Bit 7 LOLRE
Bits 6:4 MFD
Bit 3 LOCRE
Bits 2:0 RFD
0 Generates an interrupt request on loss of lock
000 Sets the MFD multiplication factor to 4
0 Generates an interrupt request on loss of clock
000 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
MC9S08GB60A Data Sheet, Rev. 2
118
Freescale Semiconductor