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
Solved! Go to Solution.
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
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
Hi Stan
I'm using S32DS.ARM.2018.R1
As MCU I target a S32K148
Thanks
Mario
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
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
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
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