Peripherals Tool: FTM Prescale Value missing In CLOCK_SOURCE macro

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Peripherals Tool: FTM Prescale Value missing In CLOCK_SOURCE macro

1,273 Views
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 Kudos
Reply
1 Reply

1,076 Views
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 Kudos
Reply