Quadrature encoder interface callback, does what, exactly?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
ode
Posts: 2
Joined: Fri Oct 05, 2018 6:19 am

Re: Quadrature encoder interface callback, does what, exactly?

Post by ode » Fri Oct 05, 2018 6:26 am

What I'm looking at here is turning a 16 bit quadrature counter into a 32 bit counter, since ST in their infinite non-wisdom mapped timer2 and timer5 to conflicting I/O such that you can't use both of the 32 bit quadrature counters at the same time. If anyone has other ideas of how to handle the encoder roll-over I'd like to hear them.
[/quote]

would'nt it be possible to use TIM5CH3 and TIM5CH4 instead of TIM5CH1 and TIM5CH2 ?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Quadrature encoder interface callback, does what, exactly?

Post by pythoncoder » Fri Oct 05, 2018 9:57 am

This repo provides solutions using interrupts: the simple module encoder.py is Pyboard-specific. The hardware solution handles higher frequencies, but the software one allows more channels.
Peter Hinch
Index to my micropython libraries.

ode
Posts: 2
Joined: Fri Oct 05, 2018 6:19 am

Re: Quadrature encoder interface callback, does what, exactly?

Post by ode » Fri Oct 05, 2018 11:21 am

Ok,
I will look to the solution of chaining a second Timer on the overflow signal to keep the HW encoder speed...

Post Reply