S32K324 Input Capture measurement acquisitoin mode eMIOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K324 Input Capture measurement acquisitoin mode eMIOS

475 Views
Simone9
Contributor III

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:

Simone9_0-1706287272172.png

 

The channel configuration of the eMIOS used is in the image below:

Simone9_1-1706287272201.png

 

The clock source of eMIOS is the one below:

Simone9_2-1706287272223.png

 

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

0 Kudos
3 Replies

434 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

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:

IcueMios S32K344_Example_Emios_Icu_IPWM_measurement_DS34_RTD_100_v2.pngIcuChannels S32K344_Example_Emios_Icu_IPWM_measurement_DS34_RTD_100_v2.pngIcuHwInterruptConfigList S32K344_Example_Emios_Icu_IPWM_measurement_DS34_RTD_100_v2.pngEmiosCommon S32K344_Example_Emios_Icu_IPWM_measurement_DS34_RTD_100_v2.png


Best Regards,
Robin

0 Kudos

337 Views
Simone9
Contributor III

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

0 Kudos

428 Views
Simone9
Contributor III

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

0 Kudos