Hello Amir,
Do you use the SDK drivers or your own SW? Which S32K1xx derivative?
In the Dual-edge mode, there should be no problem to capture both edges, the frequency would be limited by the delay as shown below and the FTM clock/period (without overflows).
In single channel mode, it would depend on the SW overhead as well.
Could you share a test project so that I can test it.
BR, Daniel
Hello Daniel,
Yes i am using SDK drivers, this issue appeared on s32k144(i think it will be on all variants).
Actually this issue appears on the SDK auto generated example itself.
Hello Amir,
Sorry for the delay.
I modified the SDK ftm_signal_mesurement_s32k144 example to measure a PWM signal from a signal generator.
I'm able to measure for example 4MHz input frequency (conf: 48MHz FTM clock, prescaller 1, dual edge, period between two falling edges). But in this case, the difference between C1V and C0V is only 12 FTM clock cycles.
The next frequency that can be captured is 4.364MHz (11 FTM clock cycles).
I'm not sure how you can measure 100 ~ 120 kHz max at 48MHz FTM clock, prescaller 1.
Could you please elaborate?
Thank you,
BR, Daniel
Hello Daniel,
Thanks for your reply.
So, i need from ICU fully signal measurements (DutyCycle, Frequency), and to be consistent in these measurements with fast changing frequency(e.g. the feedback from servo_motor), i adapt ICU to work in Duty_On mode at Dual_Edge to capture rising edge and failing edge from each interrupt, so from two interrupts i would get Rising_Failing_Rising_Failing, so time between rising rising will be the period and between rising failing will be the pulse time and then i calculate duty&frequency, it works fine till 120 kHz, and then the interrupt doesn't come ?!
and to follow the same criteria in signal measurements at single edge icu mode, i configure it at both edges control sense. so, from four interrupts i will get Rising_Failing_Rising_Failing by reading the digital value for assigned input pin. at this situation, after 15 kHz the IO pin returns always zero for all edges (may be the frequency of the IO peripheral itself). i hope everything is clear now ?
Hello Amir,
Thank you, this is a very important piece of information.
As you know, in dual-edge FTM IC mode, the interrupt is called on the detection of the second edge.
Then, the data are processed and another measurement can be taken.
The SDK drivers are quite big, the overhead is significant, and that is probably the issue here.
And the same applies to the single edge IC mode.
I think you could get better performance with your own SW implementation or use DMA to transfer the data (2 captures) into SRAM and use one interrupt on DMA complete .
BR, Daniel