English
Language : 

MC9S08DZ60 Datasheet, PDF (157/396 Pages) Freescale Semiconductor, Inc – Microcontrollers
Multi-Purpose Clock Generator (S08MCGV1)
After a trim value has been found for a device, this value can be stored in FLASH memory to save the
value. If power is removed from the device, the IRC can easily be re-trimmed by copying the saved value
from FLASH to the MCG registers. Freescale identifies recommended FLASH locations for storing the
trim value for each MCU. Consult the memory map in the data sheet for these locations. On devices that
are factory trimmed, the factory trim value will be stored in these locations.
8.5.3.1 Example #4: Internal Reference Clock Trim
For applications that require a tight frequency tolerance, a trimming procedure is provided that will allow
a very accurate internal clock source. This section outlines one example of trimming the internal oscillator.
Many other possible trimming procedures are valid and can be used.
In the example below, the MCG trim will be calibrated for the 9-bit MCGTRM and FTRIM collective
value. This value will be referred to as TRMVAL.
Initial conditions:
1) Clock supplied from ATE has 500 µs duty period
2) MCG configured for internal reference with 8MHz bus
START TRIM PROCEDURE
TRMVAL = $100
n=1
MEASURE
INCOMING CLOCK WIDTH
(COUNT = # OF BUS CLOCKS / 8)
COUNT < EXPECTED = 500
(RUNNING TOO SLOW)
CASE ST.ATEMENT COUNT = EXPECTED = 500
TRMVAL =
TRMVAL - 256/ (2**n)
(DECREASING TRMVAL
INCREASES THE FREQUENCY)
COUNT > EXPECTED = 500
(RUNNING TOO FAST)
TRMVAL =
TRMVAL + 256/ (2**n)
(INCREASING TRMVAL
DECREASES THE FREQUENCY)
STORE MCGTRM AND
FTRIM VALUES IN
NON-VOLATILE MEMORY
n = n+1
CONTINUE
YES
IS n > 9?
NO
Figure 8-12. Trim Procedure
MC9S08DZ60 Series Data Sheet, Rev. 1 Draft E
Freescale Semiconductor
PRELIMINARY
157
Subject to Change