Thread: 3 Encoders
View Single Post
  #5   Spotlight this post!  
Unread 17-11-2005, 19:16
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: 3 Encoders

Quote:
Originally Posted by stephenthe1
Hello,
I was wondering if anyone has a modified version of Kevin's encoder code with support for 3 (or more) quadrature encoders. If you do I'd be quite thankful . My Email address is "slinkydeath@sbcglobal.net" if you're willing to share your code. Thank you very much,
Stephen
Stephen,

Last year we used 2 encoders plus a gear-tooth counter. All three devices were driven by interrupts. I've attached the encoder.c file showing the initialization, and interrupt service routines. I've also included user_routines_fast.c which shows the handler InterruptHandlerLow ().

In short, interrupts are available in digital inputs 1-6. The caveat is inputs 3-6 can only be enabled or disabled as an entire block. You either get all or none. This also means that we chose to modify Kevin's code further, and move the phase B encoder signals to inputs 7 and 8. Leaving them on 5 and 6 would have caused unnecessary interrupts (this was done in encoder.h).

-SlimBoJones...
Attached Files
File Type: c encoder.c (17.3 KB, 48 views)
File Type: c user_routines_fast.c (12.2 KB, 43 views)
File Type: h encoder.h (3.6 KB, 37 views)