CHAPTER 2-3: High-Speed CR Trimming
122 FM4 Peripheral Manual, Doc. No. 002-04856 Rev. *E
Xtrm Calculation Procedure Example
Figure 4-5 shows an Xtrm calculation procedure example. Perform frequency trimming in the two stages
of coarse adjustment and fine adjustment.
Figure 4-5 Xtrm Calculation Procedure Example
Calculate the coarse adjustment
(TRD[9:5]) bit (Xtrm_coarse)
Set an Xtrmmin_coarse value as the MCR_FTRM
Set a trigger for base timer on the rising of
the divided high-speed CR clock
Set an Xtrmmax_coarse value as the MCR_FTRM
Calculate Tmin_coarse and Tmax_coarse,
based on measured TIMER1 and TIMER2 values:
Tmin_coarse = (TIMER1×PCLK)/DIV
Tmax_coarse = (TIMER2×PCLK)/DIV
Calculate Xtrm_coarse (TRD set value at Ttgt):
{(Ttgt - (Tmax_coarse-Tmin_coarse) / 31-
Tmax_coarse} /{(Tmin_coarse-Tmax_coarse) / 31}
Set an Xtrm_coarse value as TRD[9:5]
Set Xtrm_coarse - 1 as TRD[9:5]
Calculate the fine adjustment
(TRD[4:0]) bit (Xtrm_fine)
Set an Xtrm_coarse value as the MCR_FTRM
Set an Xtrmmax_fine value as the MCR_FTRM
Calculate Tmin_fine and Tmax_fine,
based on measured TIMER1 and TIMER2 values:
Tmin_fine = (TIMER1×PCLK)/DIV
Tmax_fine = (TIMER2×PCLK)/DIV
Calculate Xtrm_fine (TRD set value at Ttgt):
{(Ttgt - (Tmax_fine-Tmin_fine) / 31-
Tmax_fine} /{(Tmin_fine-Tmax_fine) / 31}
Set an Xtrm_fine value as TRD[4:0]
Set an Xtrmmin_fine value as the MCR_FTRM
< 4MHz : Xtrm_fine + 1 as TRD[4:0]
> 4.08MHz : Xtrm_fine - 1 as TRD[4:0]