2410575_en-US

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

2410575_en-US

2410575_en-US

S32K142 PWM Signal input reading

Hello Team,

Is there any example available for PWM reading in S32K142 using FTM input capture?

If yes, please share the example.

Re: S32K142 PWM Signal input reading

Hello @Julián_AragónM ,

Thank you so much for quick reply.

One small doubt, can i use single CH to measure both duty cycle and period? 

If i set input capture mode as DETECT BOTH EDGE. What measurement value i will get from IC_GetMeasurement?

Re: S32K142 PWM Signal input reading

Hello @nirmal_masilamani,

You can refer to:

You can also refer to some community posts:

Hope this helps.

Best regards,
Julián

  •  
Re: S32K142 PWM Signal input reading

Hello @nirmal_masilamani,

Input capture supports 3 modes:

  • Capture on Rising Edge Only -> period only
  • Capture on Falling Edge Only -> period only
  • Capture on Rising or Falling Edge -> Need to read the level status through GPIO or CnSC [CHIS] bit to know the high-level pulse width or the low-level pulse width.

NOTE: The CHIS bit should be ignored when the channel (n) is not in an input mode.
NOTE: When the pair channels is on dual edge mode, the channel (n+1) CHIS bit is the channel (n+1) input value and not the channel (n) input value (this signal is the input signal used by the dual edge mode).

For PWM duty cycle capture, you should use dual edge capture. Otherwise, you will only get the period of high level or low level. In the dual edge capture mode, only channel (n) input is used and channel (n+1) input is ignored.

Julin_AragnM_0-1788457862022.pngJulin_AragnM_0-1788457862022.pngJulin_AragnM_0-1788457862022.pngJulin_AragnM_0-1788457862022.png

IC_GetMeasurement will return the pulse width in ticks, which you can then use to calculate signal frequency: 

/* Get the latest value */
inputCaptureMeas = IC_GetMeasurement(&ic_pal_1_instanceConfig, channel);
/* Calculate the signal frequency using recorded data*/
inputCaptureMeas = frequency / (inputCaptureMeas);

Best regards,
Julián

Re: S32K142 PWM Signal input reading

Hello @Julián_AragónM ,

Thank you for reply.

I am still little confused.

To measure PWM signal, how many pins i need? 

I am using IC_PAL for measuring. But i am unable to measure PWM using signal pin and single ch.

RTD used V4.0.0

标记 (1)
无评分
版本历史
最后更新:
星期日
更新人: