STM32L431 TIM2 Rotary Encoder
Hi,
I am having issues using the STM32L431RBI6 to read a rotary encoder.
The encoder has a 0-5V output on its 2 channels, and is working with my other STM32 setup (on a STM32L451CCU6).
On the STM32L431RBI6, I am using TIM2 configured in Encoder mode, with TIM2_CH1 & TIM2_CH2 mapped respectively on PA15 and PB3 (5V tolerant). The associated code was generated using STM32CubeMX included in STM32CubeIDE 1.14.1.
When running the code, the TIM2->CNT value does not get updated when I manually move the motor. After tracing the signals on a logic analyser, I noticed that the signal on PB3 was working fine (oscillating between 0 and 5V as expected). However, on PA15, the signal has the correct shape but is only oscillating between 0 and 0.8V.
On the board I am using, there are no intermediate components between the encoder output and each STM32 pin (only the PCB track). Both tracks are routed close to each other.
I am linking my GPIO & TIM2 configuration.
Do you have any input as to what may be causing this issue and how I could resolve it ?
Thank you for your help,
Elena
