cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4S7VIT6 PA1 pin for Timer2 PWM Input Capture

Harikant
Associate

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

1 REPLY 1
Sarra.S
ST Employee

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 STM32CubeL4ProjectsNUCLEO-L432KCExamplesTIM/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.