Hi NXP Team:
Regarding the ICU module of K3, I have the following question:
Configure an ICU input channel to measure PWM in SAIC mode, using DMA for data transfer. First, the SAIC DMA mode RTD code will be forced to use double-edge triggering. Then, in double-edge triggering mode, if the input PWM signal line is interrupted and then reconnected, if the PWM waveform is high at the moment of reconnection, the next trigger edge will be a falling edge, causing the duty cycle of subsequent measurements to be inverted. For example, if the PWM waveform is 20 %占空比,ICU的测量结果就是80%
A complete PWM waveform is as follows:
Rising edge -> High level -> Falling edge -> Low level
In dual-edge triggered mode, it is possible to start sampling from the falling edge, and reassemble the low-level area of the previous waveform and the high-level area of the next waveform into a single waveform.
Have you encountered a similar problem before, and do you have any good solutions?
Thanks!
Hi,
The behavior you describe can occur when SAIC is used with both-edge triggering and the software determines the PWM high/low time only from the order of captured timestamps. After the input signal is interrupted, the next captured edge can be a falling edge, which can cause the measurement polarity to become reversed.
However, eMIOS SAIC provides an edge-capturing feature specifically useful for this case. With IcuSaicEdgeCapturing enabled, AS2 bit 31 contains the input signal level associated with the captured timestamp. This allows software to distinguish rising and falling edges even when both-edge triggering is used and therefore to restore the correct PWM edge sequence after the signal is reconnected.
Please consider enabling this feature and using the captured signal-level information when processing the DMA samples. The exact DMA data handling should be checked to ensure that the AS2 signal-level bit is transferred and preserved.
Alternatively, the dedicated eMIOS IPW/IPWM measurement mode can be considered if it fits the application/channel configuration, since these modes are intended specifically for pulse-width/PWM measurement.
BR, Petr
I will try debugging according to the above steps. Thank you very much for your reply!