Hello,
we want to measure multiple Input PWM Signals by periodically calling the API function Icu_GetDutyCycleValues. Therefore, Icu_Channels are configured with ICU_MODE_SIGNAL_MEASUREMENT with property ICU_DUTY_CYCLE. The User Mode for dutycycle is set to IPWM, master bus and ISRs are configured as well.
Most of the time everything works fine, but in some cases we Archive incorrect values for period and pulse width. After debugging into the ICU module (i.e. Icu_eMios.c, Icu_eMios_SignalMeasurement() ), we observed that the wrong values results from equal content in Register A and B, so that further computations are invalid for the current, as well as for the next cycle (since IcuTempB -> Icu_TimeStart).
First, I thought of syncronous read/write of CPU/eMios like mentioned in Application Note EB651 (MPC5500), but the workaround shown in there is not working since a1/a2 and b1/b2 always containing the same values (a1 == a2, b1 == b2).
Which circumstances can cause Registers A and B to have the same content?
Do you have any suggentions how to solve this issue? Any help would be appreciated.
Thank you and BR