2024-05-16 06:42 AM
Dear Sir,
One of our applications we are using STM32L4S7VIT6 100 pin micro-controller. From external peripheral PWM type signal is coming to Port Pin PA1. We want to measure Frequency and Duty Cycle. It requires two channels of timer. Whereas this pin is supporting only one channel (TIM2-Channel 2) from datasheet. Please suggest how to configure TIM2 for this purpose. Also, request you to share the configuration code.
Thanks, and regards,
Harikant
2024-05-16 07:28 AM
Hello @Harikant, welcome to ST Community,
Please read the PWM Input Mode section in RM, you can use TIM2 Channel2 as input pin to measure the frequency and the duty cycle.
Check this example under STM32CubeL4/Projects/NUCLEO-L432KC/Examples/TIM/TIM_PWMInput
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.