Hi there,
I am having issues with the eMIOS ICU on the S32K324. I am trying to use the signal measurement feature to measure a PWM signals period and duty cycle. I have a PWM signal connected to the MCU but the signal measuring function (Emios_Icu_Ip_GetDutyCycleValues()) is returning zero all the time. Configuration of eMIOS:
Initialization code:
Emios_Mcl_Ip_Init(2u, &Emios_Mcl_Ip_2_Config_BOARD_INITPERIPHERALS);
Emios_Icu_Ip_Init(2u, &eMios_Icu_Ip_2_Config_PB);
Loop code:
Emios_Icu_Ip_GetDutyCycleValues(2u, 0u, &dutyCycleValues0);
1) Could it be that I'm doing something wrong? How does the signal measurement feature work?
2) If my approach is not correct, how do I get the duty and period values? As I understood it is possible with both SAIC and IPWM modes but am currently only able to use SAIC because I cannot change the wiring on the PCB.
Hi,
be sure you enabled interrupt for used channel and start measurement using Emios_Icu_Ip_StartSignalMeasurement function.
There are few examples that shows SAIC mode usage, you can refer to them
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-eMIOS-DS3-5-RTD500/ta-p/1992245?pro...
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-IP-S32K312-EMIO-PWM-Generation-amp-Duty-cap...
BR, Petr