Connecting Encoder for Pololu Wheel to STM32F4-Discovery

I would like to connect encoder to STM32F4- Discovery board in order to measure speed of my car and also finding the direction of movement.
I need to know which pins on discovery board should I use and later how can I program those pins to read the encoder data.

I would be grate if anybody could help me how can I do that.

Thank you.

Hello.

The two outputs of the encoder are digital outputs. Most generally, they can be connected to any digital input pins; however, it is better to connect them to digital input pins that can use interrupts, so you do not have to spend time monitoring them for state changes.

The microcontroller on your board in particular has hardware timers that will decode the quadrature encoders for you, if you make the connections to the appropriate pins and configure the timer registers the right way, which makes using them a lot easier. I suggest you use this approach and use the microcontroller’s datasheet to help you understand how.

If you are unclear on how quadrature encoders work, National Instruments has an informative guide on quadrature encoder fundamentals.

Additionally, you might try looking through the Wheel Encoders section our AVR library to help get an understanding of how quadrature encoders can be implemented.

-Brandon

Thank you Brandon.