cancel
Showing results for 
Search instead for 
Did you mean: 

On STM32F103, Encoder Input and Input capture at the same TIM3 available?

kyuhyong
Associate
Posted on June 07, 2015 at 03:36

Hello,

My STM32F103 is working as motor driver and work with pwm as an input runs at about 500hz or 2 ms duty.

An incremental encoder is connected as a speed reference of the motor output.

Pin connection is as follows.

Encoder A --> PA6 (TIM3_CH1)

Encoder B --> PA7 (TIM3_CH2)

PWM1 in  --> PB0 (TIM3_CH3)

PWM2 in  --> PB1 (TIM3_CH4)

I already tested encoder function successful however input capture seems not to work.  

I just want to know if this configuration is correct.

Thanks,

Kyu

#pwm #encoder #stm32f103
3 REPLIES 3
Posted on June 07, 2015 at 03:56

There is only one counting element in the timer, you have it going up/down via the encoder. You can Input Capture those values, but it's probably not going to be helpful measuring unrelated signals.

You'll need to use a different timer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
waaizkhan
Associate II
Posted on June 07, 2015 at 19:35

jpeacock
Associate III
Posted on June 07, 2015 at 20:01

Since the timer is in encoder mode any capture has to be based on a change in the encoder timer, which in this case is either phase A or B depending on your setup.  You PWM measurements would have to be clocked from an encoder phase in order to work.

  Jack Peacock