QEI 32bit for STM32F103C8

Working libraries, libraries being ported and related hardware
User avatar
mikikg
Posts: 8
Joined: Tue Mar 07, 2017 4:08 pm
Location: Serbia
Contact:

QEI 32bit for STM32F103C8

Postby mikikg » Tue Mar 07, 2017 4:19 pm

Hello,

I need to interface optical quadrature encoder (QEI, 2000 division per turn) to STM32F103C8.
I need HW supported for QEI, means to detect pulses as fast as possible.

Is there some library for that or any advice how to do that?

Tnx in advance.


User avatar
mikikg
Posts: 8
Joined: Tue Mar 07, 2017 4:08 pm
Location: Serbia
Contact:

Re: QEI 32bit for STM32F103C8

Postby mikikg » Wed Mar 08, 2017 2:23 pm

@zmemw16

Thank you for the info.

User avatar
mikikg
Posts: 8
Joined: Tue Mar 07, 2017 4:08 pm
Location: Serbia
Contact:

Re: QEI 32bit for STM32F103C8

Postby mikikg » Thu Mar 09, 2017 4:55 pm

I found one example in ~/Documents/Arduino/hardware/Arduino_STM32/examples/Sensors/HardTimerAsEncoder/HardTimerAsEncoder.ino

In general this work.

I have one practical question, what to do with "Index" input, I see in code that this input is not handled, and on other side I notice that losing steps is possible and without handler for Index input, error will accumulate over time, question, is it good practice to reset step counter when Index pulse arrive (via ISR)?

I suppose when using Index input to reset counter will at least leeds to smaller error which may occurs in one full revolution of encoder.

Is there maybe some example for encoders with Index support?

BTW: Currently for testing I'm using Toky HY38A6-P4AR-2000 encoder
http://www.klaesb.com/catalogue/251a82f ... a307e1.pdf


Return to “Libraries & Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest