Datasheet

Chapter 8 Internal Clock Generator (S08ICGV4)
MC9S08AW60 Data Sheet, Rev 2
Freescale Semiconductor 153
8.5.4 Example #3: No External Crystal Connection, 5.4 MHz Bus
Frequency
In this example, the FLL will be used (in FEI mode) to multiply the internal 243 kHz (approximate)
reference clock up to 10.8 MHz to achieve 5.4 MHz bus frequency. This system will also use the trim
function to fine tune the frequency based on an external reference signal.
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 (f
Bus
).
The clock scheme will be FLL engaged, internal (FEI). So
f
ICGOUT
= (f
IRG
/ 7) * P * N / R ; P = 64, f
IRG
= 243 kHz Eqn. 8-5
Solving for N / R gives:
N / R = 10.8 MHz /(243/7 kHz * 64) = 4.86 ; We can choose N = 10 and R = 2. Eqn. 8-6
A trim procedure will be required to hone the frequency to exactly 5.4 MHz. An example of the trim
procedure is shown in example #4.
The values needed in each register to set up the desired operation are:
ICGC1 = $28 (%00101000)
Bit 7 HGO 0 Configures oscillator for low power
Bit 6 RANGE 0 Configures oscillator for low-frequency range; FLL prescale factor is 64
Bit 5 REFS 1 Oscillator using crystal or resonator requested (bit is really a don’t care)
Bits 4:3 CLKS 01 FLL engaged, internal reference clock mode
Bit 2 OSCSTEN 0 Disables the oscillator
Bit 1 LOCD 0 Loss-of-clock enabled
Bit 0 0 Unimplemented or reserved, always reads zero
ICGC2 = $31 (%00110001)
Bit 7 LOLRE 0 Generates an interrupt request on loss of lock
Bit 6:4 MFD 011 Sets the MFD multiplication factor to 10
Bit 3 LOCRE 0 Generates an interrupt request on loss of clock
Bit 2:0 RFD 001 Sets the RFD division factor to ÷2
ICGS1 = $xx
This is read only except for clearing interrupt flag
ICGS2 = $xx
This is read only; good idea to read this before performing time critical operations
ICGFLTLU/L = $xx
Not used in this example