Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   3 Encoders (http://www.chiefdelphi.com/forums/showthread.php?t=40511)

stephenthe1 17-11-2005 18:41

3 Encoders
 
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 :rolleyes:. My Email address is "slinkydeath@sbcglobal.net" if you're willing to share your code. Thank you very much,
Stephen

Matt Krass 17-11-2005 18:59

Re: 3 Encoders
 
As far I am informed we only have two (available) hardware interrupts to use for the encoders, which would seem to indicate that we can only use 2 encoders.

However I also said nobody would hang last year :)

Tristan Lall 17-11-2005 19:06

Re: 3 Encoders
 
Without knowing the details of the code or of the implementation, could you use an auxillary processor to take encoder information (from several sources), then pass it back to the RC processor as a package, using one (RC) interrupt?

stephenthe1 17-11-2005 19:11

Re: 3 Encoders
 
I think I heard of someone actually designing something to do this. Wow if one device could somehow keep track of those values and send it to the RC, that would be pretty sweet.
If I remember right, I thought that digitals 3-6 support interrupting, it's just they're banned together somehow.

Mr. Lim 17-11-2005 19:16

Re: 3 Encoders
 
3 Attachment(s)
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 :rolleyes:. 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...

stephenthe1 17-11-2005 19:21

Re: 3 Encoders
 
Thank you very much! I'm going to get going and start working with this. thanks everyone for the help!


All times are GMT -5. The time now is 04:34.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi