Hello,
I was trying to implement the functionality of measuring the period of a PWM input to my custom board.
To do this, I connected my PIN to CH3 of the eMIOS1 without using the interrupt..
The configuration of the eMIOS1 is in the picture below:
The channel configuration of the eMIOS used is in the image below:
The clock source of eMIOS is the one below:
With these settings, I could not capture the input signal.
In particular, the code I used specifically for this control is as follows:
Upon initialisation of the MCU, the functions called are as follows:
Emios_Mcl_Ip_Init(1U, &Emios_Mcl_Ip_1_Config_BOARD_INITPERIPHERALS);
Emios_Icu_Ip_Init(1U, &eMios_Icu_Ip_1_Config_PB);
Emios_Icu_Ip_StartSignalMeasurement(1U, 3U);
IP_EMIOS_1->CH.UC[3].A = (uint32_t)0x1000U;
Runtime I use this API to get the value (i have test it both in background that every 1ms):
Emios_Icu_Ip_GetDutyCycleValues(1U, 3U, &speedVal);
But what I obtain is always 0 ad period and DutyCycle.
I wanted to know if I was making a mistake or missing something?
MCU S32K324
IDE S32 Design Studio 3.5
RTD 3.0.0
Thank you very much
Hi
Have you already referred to S32K344_Example_Emios_Icu_IPWM_measurement_DS34_RTD_100_v2?
This example will show you how to use IcuMeasurementMode: ICU_MODE_SIGNAL_MEASUREMENT. This example uses S32DSv3.4+ RTD1.0.0. To facilitate your comparison of peripheral configurations, please see the following screenshots:
Best Regards,
Robin
Hi,
I have tried by adapting the example and it works. But what I can't do is doing in polling and not in interrupt. I've disabled from the MEX the interrupt and check the box that say "IcuSignalMeasureWithoutInterrupt" but the API continuously read 0 for the period and duty. Do you have any solution about that?
Thanks
Hi,
Thank you for your reply I will now try this configuration.
However, in my application I would like to try this acquisition without interrupts. Then in polling in a periodically scheduled way and see the count.
How can this be done?
Thank you very much