EasyManua.ls Logo

Cypress FM4 Series - Page 122

Cypress FM4 Series
1102 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
Xtrm_coarse=
No
Yes
Xtrm_fine=
Yes
End
Calculate the coarse adjustment
(TRD[9:5]) bit (Xtrm_coarse)
Set an Xtrmmin_coarse value as the MCR_FTRM
(TRD=0b0000000000)
Base timer ch.0
PWC timer operation
Set a trigger for base timer on the rising of
the divided high-speed CR clock
Read TIMER1 value
Set an Xtrmmax_coarse value as the MCR_FTRM
(TRD=0b1111100000)
Base timer ch.0
PWC timer operation
Read TIMER2 value
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}
F
CRH
<= 4MHz ?
Set an Xtrm_coarse value as TRD[9:5]
Base timer ch.0
PWC timer operation
Read TIMER value
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
(TRD[9:5]=Xtrm_coarse)
Base timer ch.0
PWC timer operation
Read TIMER1 value
Set an Xtrmmax_fine value as the MCR_FTRM
(TRD[4:0]=0b11111)
Base timer ch.0
PWC timer operation
Read TIMER2 value
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]
Base timer ch.0
PWC timer operation
Read TIMER value
Set an Xtrmmin_fine value as the MCR_FTRM
(TRD[4:0]=0b00000)
4MHz <= F
CRH
<= 4.08MHz ?
Set F
CRH
< 4MHz : Xtrm_fine + 1 as TRD[4:0]
Set F
CRH
> 4.08MHz : Xtrm_fine - 1 as TRD[4:0]
No
Start

Table of Contents

Related product manuals