2011-12-06 03:18 PM
On an STM32F103Z (ST3210E eval) I set up TIM4 in encoder mode, QEI interface with phase A on CH1 and phase B on CH2. Encoder mode is T1T2, triggering on falling edge of either phase. The encoder is a 400 position optical wheel, so I set the auto reload to 399.
The problem is the count register (TIM4_CNT) sometimes shows 400 instead of rolling over at 399 back to zero. Otherwise the timer is working as expected, tracking direction and position ticks. What condition allows a timer to exceed the reload when in encoder mode? Jack Peacock #timer-encoder-qei