Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Third Encoder Channel (http://www.chiefdelphi.com/forums/showthread.php?t=34454)

phillutz 18-02-2005 11:11

Re: Third Encoder Channel
 
I'm not concerned about a third encoder, but that is not to say I don't need help.
Encoders were the last thing on our minds putting the robot together.
Now the team would like to use them to get accurate distance measures.
The problem I am thinking exists is with Kevins code, Digital's 1,2,6&8 are used for the encoders, and I assume the interrupt routines.
We are using those digitals already on the robot. (1-11 and 17,18 are all used)

Where specifically do I need to change the interrupt code to have the interrupts function for say... digitals 12,13,14,15.
I understand needing to change the user_routines.c file for INPUT/OUPUT but interrupts confuse me. :confused:
Also, I see in encoder.h that Kevin is #define ing the XXX_Encoder_Phase_B_Pin's but not the Phase_A_Pins? Am I missing something? :confused:



Thanks in advance for your assistance.

Phil

Alan Anderson 18-02-2005 11:44

Re: Third Encoder Channel
 
Quote:

Originally Posted by phillutz
Where specifically do I need to change the interrupt code to have the interrupts function for say... digitals 12,13,14,15.
I understand needing to change the user_routines.c file for INPUT/OUPUT but interrupts confuse me. :confused:
Also, I see in encoder.h that Kevin is #define ing the XXX_Encoder_Phase_B_Pin's but not the Phase_A_Pins? Am I missing something? :confused:

Digital inputs 1 and 2 are permanently connected inside the robot controller's CPU to the interrupts used by the encoder code. You can't do anything about that. There is a third external interrupt which is triggered on any change of digital inputs 3 through 6, but using it is a bit more complicated than the first two. So far as I know, none of the other digital inputs can cause interrupts.

phillutz 18-02-2005 12:09

Re: Third Encoder Channel
 
1. Can I change at least digital 6&8 to something else.
We have a wiring harness that is pulled into dig 1-11. This can be moved up to 3-13, but has to stay together...

2. Do I need to change anything in the Interrupt routines if the answer to #1 is yes?

Thanks,

Phil

Mark McLeod 18-02-2005 12:24

Re: Third Encoder Channel
 
Quote:

Originally Posted by phillutz
1. Can I change at least digital 6&8 to something else.
We have a wiring harness that is pulled into dig 1-11. This can be moved up to 3-13, but has to stay together...

2. Do I need to change anything in the Interrupt routines if the answer to #1 is yes?

Yes, you can move the encoder Quad B connections on digital inputs 6 & 8 to any other digital input pins.

You'll need to change the following two lines found in encoder.h to reflect the new digital inputs.
Code:

#define LEFT_ENCODER_PHASE_B_PIN rc_dig_in06
...
#define RIGHT_ENCODER_PHASE_B_PIN rc_dig_in08


phillutz 18-02-2005 12:28

Re: Third Encoder Channel
 
I will mod the code tonight (This work thing keeps getting in the way of robotics).

Thanks for the quick responses.

Phil


All times are GMT -5. The time now is 19:18.

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