Period measurement using emios icu

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Period measurement using emios icu

408 次查看
AManikandan
Contributor I

Hi All,

I have modified the example project - Emios_Icu_Ip_BlinkLed_S32K344 for period measurement. I have configured an emios input pin and connected function generator output to it. Then, tried reading period by using Emios_Icu_Ip_GetTimeElapsed api. But period is always read as 0. I have also tried generating PWM output on one pin and connecting it to the emios input pin instead of using the function generator. In that case also, period is read as 0. Could you please help on this? 

0 项奖励
回复
8 回复数

387 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @AManikandan 

Could you please share your configurations and the RTD version you are working with? In the meantime, I suggest you better use the Emios_Icu_Ip_GetDutyCycleValues() function which provides the Active Time and Period Time of a PWM signal. 

 

B.R.

VaneB

0 项奖励
回复

383 次查看
AManikandan
Contributor I
Please find my RTD version below
S32K3_RTD_4_0_0_D2311_ASR_REL_4_7_REV_0000_20231128
0 项奖励
回复

372 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @AManikandan 

If possible, please share your configurations. 

0 项奖励
回复

305 次查看
dpc
Contributor I
I'm having the same problem when trying to use input capture to period measurement.
 
In my project I use S32K311 device, with PTA3 (emios_1_ch_20_y) => only can be used in SAIC mode.
In both cases the values read were always 0:
  => Emios_Icu_Ip_GetTimeElapsed(PWM_INSTANCE_1, CHANNEL_20);
  and 
  => Emios_Icu_Ip_GetDutyCycleValues(PWM_INSTANCE_1, CHANNEL_20, &ic_result_temp);
   temp_periode = ic_result_temp.PeriodTime;
   temp_dutycycle = ic_result_temp.ActiveTime;
 
I use channel 23 to generate a pwm to channel_19, using BUS_A.
and channel 16 to generate clock to channel_20 (input capture), using BUS_D
 
RTD version: S32K3_RTD_4_0_0_P04_D2312_ASR_REL_4_7_REV_0000_20231220
S32DS v3.5.10 
 
I use a CORE_CLK=120MHz and I'm looking to see if the clock issue could be the cause, 
because I'm trying to capture a 6hz input signal!!Captura_Emios_Icu_00.PNGCaptura_Emios_Icu_01.PNGCaptura_Emios_Icu_02.PNGCaptura_Emios_McI_Ip_00.PNGCaptura_Emios_McI_Ip_01.PNGCaptura_pinout.PNG

      

0 项奖励
回复

301 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @dpc 

You configured the IcuSignalMeasurementProperty as ICU_PERIOD_TIME and IcuSubModeforMeasurement as SAIC; however, the User Manual for S32K3 ICU Driver states that IcuSubModeforMeasurement will be enabled in configuration only when IcuSignalMeasurementProperty is ICU_DUTY_CYCLE.

0 项奖励
回复

267 次查看
dpc
Contributor I

Hi VaneB,

Where can I get these documents? I can't find them
  - Integration Manual for S32K3 ICU Driver (RTD_ICU_IM.pdf)
  - User Manual for S32K3 ICU Driver (RTD_ICU_UM.pdf)
  (referenced in post https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/SIUL2-external-interrupt-example-proje...

 

I have tried changing to duty cycle and the result is still reading value 0.
Debugging in Emios_Icu_Ip_GetDutyCycleValues() function
        instance=1 (emios_1)
        hwChannel=20
I have found that the measurement value that it reads is EMIOS_ICU_NO_MEASUREMENT when it is defined as EMIOS_ICU_DUTY_CYCLE.

Captura-ICU_DUTY_CYCLE.PNG

capture_GetDutyCycleValues-Instance_1-Ch20.png

I'm thinking about removing the pwm I generate with channel 23 and trying just the input capture mode (ch20), in case they interfere somewhere

0 项奖励
回复

255 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @dpc 

The Integration Manual and the User Manual can be found for example at C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Icu_TS_T40D34M40I0R0\doc (S32DS path) or C:\NXP\SW32K3_RTD_R21-11_3.0.0_P07\eclipse\plugins\Icu_TS_T40D34M30I0R0\doc.

0 项奖励
回复

213 次查看
dpc
Contributor I

thanks a lot VaneB!

0 项奖励
回复