MK64:How can I initialize FTM with max 60MHz

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MK64:How can I initialize FTM with max 60MHz

跳至解决方案
1,001 次查看
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 解答
934 次查看
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 回复
935 次查看
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 项奖励
回复