MK64:How can I initialize FTM with max 60MHz

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MK64:How can I initialize FTM with max 60MHz

ソリューションへジャンプ
1,011件の閲覧回数
Vinos
Contributor III

Chip:MK64FN1M0VMD12

The source clock of FTM is kCLOCK_BusClk which is 60Mhz,but in the function

ftm_clock_prescale_t FTM_CalculateCounterClkDiv(FTM_Type *base, uint32_t counterPeriod_Hz, uint32_t srcClock_Hz)

It has two assertation:

assert((srcClock_Hz / 2U) > counterPeriod_Hz);
assert((srcClock_Hz / 128U / 0xFFFFU) <= counterPeriod_Hz);

 

Does it support 60MHz timer?Or what timer can I use with frequency as high as possible?

 

Thanks

0 件の賞賛
返信
1 解決策
944件の閲覧回数
Miguel04
NXP TechSupport
NXP TechSupport

Hi @Vinos 

Please look into chapters from your reference manual:

40.2 FTM signal descriptions Table 40-1 FTM signal descriptions

The external clock input signal is used as the FTM counter clock if selected by CLKS[1:0] bits in the SC register. This clock signal must not exceed 1/4 of system clock frequency.

40.4.1.1 Counter clock source

Due to FTM hardware implementation limitations, the frequency of the fixed frequency clock must not exceed 1/2 of the system clock frequency.

The K64 has a system clock of 120MHz so you should be able to use the fixed frequency clock to get the 60MHz you want. However this values could cause some issues depending on your implementation since it says must not exceed 1/2 of the system clock frequency, and 60MHz is exactly the half.

Best Regards, Miguel.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
945件の閲覧回数
Miguel04
NXP TechSupport
NXP TechSupport

Hi @Vinos 

Please look into chapters from your reference manual:

40.2 FTM signal descriptions Table 40-1 FTM signal descriptions

The external clock input signal is used as the FTM counter clock if selected by CLKS[1:0] bits in the SC register. This clock signal must not exceed 1/4 of system clock frequency.

40.4.1.1 Counter clock source

Due to FTM hardware implementation limitations, the frequency of the fixed frequency clock must not exceed 1/2 of the system clock frequency.

The K64 has a system clock of 120MHz so you should be able to use the fixed frequency clock to get the 60MHz you want. However this values could cause some issues depending on your implementation since it says must not exceed 1/2 of the system clock frequency, and 60MHz is exactly the half.

Best Regards, Miguel.

0 件の賞賛
返信