S32K344 eMIOS/ICU problem about measure PWM pulse width and period

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

S32K344 eMIOS/ICU problem about measure PWM pulse width and period

2,937 次查看
xkr
Contributor I

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!

0 项奖励
回复
4 回复数

1,964 次查看
KeyurKulkarni
Contributor I

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.

0 项奖励
回复

2,824 次查看
gumu
Contributor V

Hi @xkr,

I had the same issue in my project and fixed that by increasing the divider value of MCL_Emiosx.

0 项奖励
回复

2,911 次查看
PetrS
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复

2,895 次查看
xkr
Contributor I

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!

0 项奖励
回复