I have configured eMios channel 4 of HW instance 0 as ICU_MODE_SIGNAL_MEASUREMENT.
I am able to read Period, duty with this configuration. But I would like to measure edge/Pulse count as well. So, is it possible to get period and Edge count simultaneously using ICU_MODE_SIGNAL_MEASUREMENT? If not, please guide me to do the same.
Thanks for details. Do you have any example code "to route the external signal to be measured to a pin configured as trgmux_inX."
I am not aware of trgmux_inX.
This is my pin configuration for my input PWM.
Hi again,
Please give me more time to give you a proper answer.
Hi again,
Please find attached project.
This example perform two eMIOS ICU modes, PEC (EMIOS_0_CH_5) and IPWM (EMIOS_0_CH_5), in the same pin (PTD2). It is archived routing the same PWM input signal to two eMIOS channels though TRGMUX (trgmux_in5).
The PWM signal is generated using the EMIOS_1_CH_0 (PTA0) in OPWMB mode and using EMIOS_CH_23 in MCB mode as time base.
Please use S32DS 3.6, RTD 5.0.0, S32K3X4EVB-T172 (and connect PTA0 to PTD2).
If you need different SW and/or HW, you can create a new project, do manual config and code copy.
Note -> Although you are able to read period and duty cycle, please consider that IPWM measurements in attached project should be improved, meanwhile please refer to the following community posts:
Hope it helps you.
Have a nice day!
Hi,
Thank you so much for your interest in our products and for using our community.
Each eMIOS channel allows just one of the following ICU modes:
ICU_MODE_SIGNAL_EDGE_DETECT
ICU_MODE_EDGE_COUNTER
ICU_MODE_SIGNAL_MEASUREMENT
ICU_MODE_TIMESTAMP
And your seems that your application needs two ICU modes.
What comes to my mind is that you could route the external signal to be measured to a pin configured as trgmux_inX. And then, route its trgmux ouput to a two eMIOS channels. One performing ICU_MODE_SIGNAL_MEASUREMENT and the other one performing
ICU_MODE_EDGE_COUNTER.
Hope it helps you.
Have a nice day!