Input capture: Measure 100% Duty

cancel
Showing results for 
Search instead for 
Did you mean: 

Input capture: Measure 100% Duty

Jump to solution
980 Views
michaellüthold
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

0 Kudos
1 Solution
814 Views
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

View solution in original post

0 Kudos
6 Replies
814 Views
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 Kudos
814 Views
michaellüthold
Contributor III

Hi Stan

I'm using S32DS.ARM.2018.R1

As MCU I target a S32K148

pastedImage_1.png

Thanks

Mario

0 Kudos
814 Views
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 Kudos
814 Views
michaellüthold
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 Kudos
815 Views
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

View solution in original post

0 Kudos
814 Views
michaellüthold
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 Kudos