Skip to main content
Visitor II
May 16, 2024
Question

STM32L4S7VIT6 PA1 pin for Timer2 PWM Input Capture

  • May 16, 2024
  • 1 reply
  • 679 views

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

    This topic has been closed for replies.

    1 reply

    ST Employee
    May 16, 2024

    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