cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723 TIM2 in encoder mode not working

radekbg
Visitor

Hello,

I have the following problem - I configured TIM2 of STM32H723 in Encoder Mode following all recommendations in the Reference Manual RM0468, chapter Encoder Interface Mode, p. 1694:

• CC1S= 01 (TIMx_CCMR1 register, TI1FP1 mapped on TI1)
• CC2S= 01 (TIMx_CCMR2 register, TI2FP2 mapped on TI2)
• CC1P and CC1NP = ‘0’ (TIMx_CCER register, TI1FP1 noninverted, TI1FP1=TI1)
• CC2P and CC2NP = ‘0’ (TIMx_CCER register, TI2FP2 noninverted, TI2FP2=TI2)
• SMS= 011 (TIMx_SMCR register, both inputs are active on both rising and falling
edges)
• CEN= 1 (TIMx_CR1 register, Counter is enabled)

I also checked these settings in the TIM2 registers in debug mode with halting the micro and they were exactly as recommended. I checked the input quadrature signals - they are there. But still the TIM2 counter value stays 0 and does not change.

Any ideas what I might be missing?

Thanks a lot,

Radek

0 REPLIES 0