7 years, 7 months ago.

Encoder read from stm32f429 discovery

I try to read encorder using mbed QEI function in stm32f429 discovery board.How can I configure Timer to specific pin?(for example: TIM2 to gpio port A).Thank you

1 Answer

7 years, 7 months ago.

Hello,
You cannot connect whatever pin to whatever timer. Timer functions are connected by hardware and this cannot be changed. In some cases only, the same timer function is available on several different pins. In this case, you have the choice between those pins only.

You can find out which GPIO pin is connected to what timer by looking at mbed pinout diagram here
PWMx/y means channel y of TIMer x. A N at the end is means it's the complementary output (for half bridge control for example)

Nevertheless, the QEI library on mbed does not use any timer, it's purely interrupt based. You must use independent interrupt lines as input. Choose 2 GPIOs with different bit number for that. (for example PA3 and PD3 won't work as they are mapped on the same interrupt, EXTI3)

TIM1, TIM8, TIM2, TIM5, TIM9, TIM14 have an hardware aquadrature encoder interface built-in, but this is not supported by mbed API.

Accepted Answer