Chapter 8 Multi-Purpose Clock Generator (S08MCGV1)
MC9S08DV60 Series Data Sheet, Rev 2
148
Freescale Semiconductor
8.4.7
Fixed Frequency Clock
The MCG presents the divided reference clock as MCGFFCLK for use as an additional clock source. The
MCGFFCLK frequency must be no more than 1/4 of the MCGOUT frequency to be valid. Because of this
requirement, the MCGFFCLK is not valid in bypass modes for the following combinations of BDIV and
RDIV values:
BDIV=00 (divide by 1), RDIV
< 010
BDIV=01 (divide by 2), RDIV
< 011
8.5
Initialization / Application Information
This section describes how to initialize and congure the MCG module in application. The following
sections include examples on how to initialize the MCG and properly switch between the various available
modes.
8.5.1
MCG Module Initialization Sequence
The MCG comes out of reset congured for FEI mode with the BDIV set for divide-by-2. The internal
reference will stabilize in tirefst microseconds before the FLL can acquire lock. As soon as the internal
reference is stable, the FLL will acquire lock in tl_lock milliseconds.
Upon POR, the internal reference will require trimming to guarantee an accurate clock. Freescale
recommends using Flash location 0xFFAE for storing the ne trim bit, FTRIM in the MCGSC register,
and 0xFFAF for storing the 8-bit trim value in the MCGTRM register. The MCU will not automatically
copy the values in these Flash locations to the respective registers. Therefore, user code must copy these
values from Flash to the registers.
NOTE
The BDIV value should not be changed to divide-by-1 without rst
trimming the internal reference. Failure to do so could result in the MCU
running out of specication.
8.5.1.1
Initializing the MCG
Because the MCG comes out of reset in FEI mode, the only MCG modes which can be directly switched
to upon reset are FEE, FBE, and FBI modes (see
Figure 8-8). Reaching any of the other modes requires
rst conguring the MCG for one of these three initial modes. Care must be taken to check relevant status
bits in the MCGSC register reecting all conguration changes within each mode.
To change from FEI mode to FEE or FBE modes, follow this procedure:
1. Enable the external clock source by setting the appropriate bits in MCGC2.
2. Write to MCGC1 to select the clock mode.
— If entering FEE, set RDIV appropriately, clear the IREFS bit to switch to the external reference,
and leave the CLKS bits at %00 so that the output of the FLL is selected as the system clock
source.