Input capture: Measure 100% Duty

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

Input capture: Measure 100% Duty

跳至解决方案
3,973 次查看
EE_CW
Contributor III

Hi together

In a project I use the FTM_IC component to measure the duty cycle of a signal.

All works fine except the duty cycle changes to 0% or 100%.

Then the last measured value stays until the duty cycle changes to other values than 0% or 100%.

Is this case not handled in the processor expert component?

Regards

Mario

标记 (3)
0 项奖励
回复
1 解答
3,807 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Mario,

yes, you can read out the current state of a pin even if it is configured for FTM function. You can find this note in the reference manual:

"Whenever a pin is configured in any digital pin muxing mode, the input buffer for that
pin is enabled allowing the pin state to be read via the corresponding GPIO Port Data
Input Register (GPIO_PDIR) or allowing a pin interrupt or DMA request to be generated."

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
6 回复数
3,807 次查看
stanish
NXP Employee
NXP Employee

Hello Mario,

Seems You are using S32 SDK drivers to measure duty cycle. I'm going to move your question into S32 SDK comunity.

Could you please indicate in the meantime which version of S32DS are you using and which MCU are you targeting?

Thanks

Stan

0 项奖励
回复
3,807 次查看
EE_CW
Contributor III

Hi Stan

I'm using S32DS.ARM.2018.R1

As MCU I target a S32K148

pastedImage_1.png

Thanks

Mario

0 项奖励
回复
3,807 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Mario,

I can see this is not handled by the driver. It would be necessary to use a timer and define timeouts depending on measured signal period. This should be handled rather by application.

Regards,

Lukas

0 项奖励
回复
3,807 次查看
EE_CW
Contributor III

Hi Lukas

Thank you for your answer.
This is what I thought about to do. But Is there is possibility to read out the state of the Pin?

Because if I mux the pin to the FTM and not to the GPIO. Is it then still possible to read out if the pin is HIGH or LOW (to differr if the signal is 100% or 0% duty cycle)?

Thanks

Mario

0 项奖励
回复
3,808 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Mario,

yes, you can read out the current state of a pin even if it is configured for FTM function. You can find this note in the reference manual:

"Whenever a pin is configured in any digital pin muxing mode, the input buffer for that
pin is enabled allowing the pin state to be read via the corresponding GPIO Port Data
Input Register (GPIO_PDIR) or allowing a pin interrupt or DMA request to be generated."

Regards,

Lukas

0 项奖励
回复
3,807 次查看
EE_CW
Contributor III

Hi Lukas

Yes you are right. I didn't think about this.

I tried it it an it work perfectly for me.

Thank you!

Regards

Mario

0 项奖励
回复