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)
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 :
Hope it helps
BR
Alice