Hello,
For context -
I am using an eMIOS ICU channel to measure a varying PWM duty cycle in IPWM mode. I am currently able to successfully measure duty cycle in a "blocking" manner.
My input transitions from 100% duty cycle (effectively no PWM) to a PWM signal of a given duty cycle which I need to measure.
My .mex configuration is as follows -


My sample code is as follows -

While this works, I would prefer to start signal measurement once and periodically call Emios_Icu_Ip_GetDutyCycleValues(), without having to call Emios_Icu_Ip_StopSignalMeasurement(), to avoid being blocked before the measurement is complete. Alternatively, if there is a interrupt fired whenever a measurement has completed, that would work for me too.
I have tried only calling Emios_Icu_Ip_StartSignalMeasurement() initially and calling Emios_Icu_Ip_GetDutyCycleValues() periodically (every 1 second, while the PWM frequency is 1kHz), but the data is inaccurate.
From my understanding, SAIC is better suited for varying PWM signals (which I believe fits my usecase), but I assume I could also use IPWM, with a delayed measurement reading. I do not mind if the returned result is slightly delayed or stale by few milliseconds as I am not expecting rapid changes in duty cycle, and the frequency will be constant.
If someone can clarify how I can achieve this using IPWM, or if I can only implement this via SAIC, that would be great.
Thanks