Multipurpose Clock Generator (MCG)
MCF51CN128 Reference Manual, Rev. 6
6-28
Freescale Semiconductor
approach to search for the best trim value is recommended. In example #4 later in this section, this
approach is demonstrated.
If a user specified trim value has been found for a device (to replace the factory trim value), 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 to the user specified value 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.
6.5.4.1
Example 4: Internal Reference Clock Trim
For applications that require a user specified tight frequency tolerance, a trimming procedure is provided
that allows an 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 is calibrated for the 9-bit MCGTRM and FTRIM collective value.
This value is referred to as TRMVAL.