Skip to main content
mjscott
Visitor II
Jun 20, 2014 12:21 PM UTC
Question

STM8L051 TIM2 & TIM3

Posted on June 20, 2014 at 14:21

Can TIM2 or TIM3 be attached to a quadrature encoder and up/down count? The data sheet says yes, but the reference manual is vague. Has anyone attached an encoder to these Timers yet?

#quadrature-encoder-rotary-tim3 #stm8l-tim2-/-tim3
This topic has been closed for replies.

3 replies

Ian Legg
Visitor II
Oct 29, 2014 12:52 PM UTC
Posted on October 29, 2014 at 13:52

Did you ever get a reply to this question as I too was wondering the same thing!? However, from what I've seen built in support for quadrature encoders via timers appears to only exist in the 32 bit devices.

Thanks,

Ian

zzdz2
Associate
Oct 30, 2014 9:49 AM UTC
Posted on October 30, 2014 at 10:49

I think the manual is quite clear, only advanced timer TIM1 has encoder modes.

The relevant settings are marked as reserved in general purpose timers(SMCR_SMS).

I suppose it's a bug in datasheet.

Ian Legg
Visitor II
Jan 6, 2015 9:08 AM UTC
Posted on January 06, 2015 at 10:08

Hello,

Does anyone know if there is any example code showing how to use a detent rotary encoder with TIM1 in encoder mode?

Thanks,

Ian