Hi, now I'm working on S32K344 platform using MCAL pakage.I want to measure more than 4 channels PWM to get their pulse width and period. IPWM mode and interrupt mode are used.I complete the configuration ,and use "void Icu_StartSignalMeasurement(Icu_ChannelType Channel);""void Icu_StopSignalMeasurement(Icu_ChannelType Channel);""void Icu_GetDutyCycleValues(Icu_ChannelType Channel, Icu_DutyCycleType* DutyCycleValues);".
In the test , I find one problem that I can not get exact period value.In the fact, the period value from the function Icu_GetDutyCycleValues() is undulate.Sometimes the period time value is some times than the exact value.At the same time,PWM pulse width value is exact.
This problem has been bugging me for more than two weeks.How can I solve it?
Best regards!
Hello
I am facing similar troubles. I am able to measure the duty cycle & the period when the interrupts are enabled. I am not able to measure the Period when interrupts are disabled.
Hi @xkr,
I had the same issue in my project and fixed that by increasing the divider value of MCL_Emiosx.
Hi,
probably you got overflows (or several one) when using timebase running from high clock. I think ICU driver does not support overflows. You should set timebase with respect of input signal. Try to increase prescaler of used timebase, then you should get right result too.
BR, Petr
No,I review the MCAL code and find that ICU driver supports overflow.I ask some people,someone says that ICU hardware does not support measure period function in IPWM mode.And it is supported by hardware and software but the interrupt can not be delayed.In my project,I have a deep distrust of delayed Interrupt and ISRs.Do you think so?Thanks!