Question
Encoder Interface STM32F0 Discovery
Posted on July 26, 2013 at 05:16
I have a motor with a quadrature encoder and I want to get the relative (absolute after counting from home position) position. I tried getting the encoder count using an interrupt from one channel of the encoder and checking the state of the other channel. But I found that a lot of counts are missed when the encoders are interfaced this way.
Now I have decided to try the Encoder Interface. The Reference manual says that I don't need 'external interface logic' to connect the encoder so I think I can directly connect the encoder channels to the STM32F0 (the channel voltages shift from 0-3V). I have seen the Encoder mode example for the STM32F0 but cannot fully understand how to implement it. What is the maximum value the timer can count upto? Should I set this value? Which pins correspond to the encoder interface? What register or variable do I read to get the encoder count? #encoder-interface #advanced-timers