cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 Motor + Encoder interface problem

Posted on September 28, 2015 at 11:58

Hello there,

I am trying to build a stepper motor driver with encoder interface using stm32F4 discovery board. I have already configured and got working the stepper motor interface. For that I used Timers 1 and 8 like in the picture bellow (2 H bridges):

https://www.dropbox.com/s/31rrg5sldelfthn/Zrzut%20ekranu%202015-09-28%2011.49.10.png?dl=0

Now I would like to add the encoder interface which consists signals A and B. If I am reading the datasheet correctly for that I need timer 1 and 2. But timer 1 is also used for motor driving... Is there a way to overcome this and have both motor and encoder interfaces implemented?

I would apreciate all help!
4 REPLIES 4
matic
Associate III
Posted on September 28, 2015 at 13:01

For encoder interface you have to choose ''Encoder Mode'' under ''Combined channels'' menu. This will reserve 2 pins as inputs for A and B signals.

Posted on September 28, 2015 at 13:16

Thank you for you answer. So I dont have to use TIMER1 but just TIMER2 for the encoder?

matic
Associate III
Posted on September 28, 2015 at 13:28

I am not sure what you need for driving your motor, but for reading A,B signals you definitely need only one separete timer with encoder interface capability. You select this under ''Combined channels''.

Posted on September 28, 2015 at 13:30

Thats what I meant. The documentation made me thing I need 1 timer per channel. Thank you.