Peripherals Tool: FTM Prescale Value missing In CLOCK_SOURCE macro

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

Peripherals Tool: FTM Prescale Value missing In CLOCK_SOURCE macro

1,271 次查看
steve_n
Contributor II

I was using the new Peripheral tools in MCUXpresso IDE v10.1.0 [Build 589] [2017-11-14] to set up a periodic interrupt using the FTM on a MK66F18 chip.

If I set the prescale value to anything other than 1, the periodic interrupt is incorrect, by exactly the ratio of the prescalar.

The generated code is apparently missing the division of the clock by the prescale value. In peripherals.h:

#define FTM_PERIPHERAL_NAME_CLOCK_SOURCE CLOCK_GetFreq(kCLOCK_BusClk)

I believe needs to be something like:

#define FTM_PERIPHERAL_NAME_CLOCK_SOURCE (CLOCK_GetFreq(kCLOCK_BusClk) /  PRESCALE_VAL)

0 项奖励
回复
1 回复

1,074 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Stephen Noonan,

Thanks for highlighting this , I will report it to MUXpressso config tool expert team.

And now the workaround is adding the prescale value by hand like :

pastedImage_1.png

Hope it helps

BR

Alice

0 项奖励
回复