Shield conflict (motor driver/encoder reader) four questions

Hello All,

I'm a newbie to Arduino, although I have been making hardwired embedded systems since the 80s. I'm building a controller for my latest telescope mount and have opted to abandon the electronics I've built for it to date and use an Arduino to accomplish the tasks namely control and position acquisition.

I'm using an L293D based board I got off eBay from an American seller to control the DC motors bi-bidirectionally. I hope to use a Robogaia 3 axis encoder reader to read the quadrant encoders. I'm not married to either board. Please point out other non conflicting boards if you know of any.

First I could use a little clarification. The literature refers to lines as "pin" numbers. For example below it is noted that of the motor shield "Digital pins: used: 3,4,5,6,7,8,9,10,11,12 Pin 9 and 10 are only used for the servo motors." It makes sense that D9 and D10 would be used to control servos as they are both PWM lines but those lines actually come out of pins 15 and 16. Is it general practice to refer to the digital data lines as "pins?"

The problem I'm having is there are a few pin (digital line) conflicts. Specifically D8,D9,D10

From various places in the motor driver documentation

// Pin usage with the Motorshield
// ---------------------------------------
// Analog pins: not used at all
// A0 ... A5 are still available
// They all can also be used as digital pins.
// Also I2C (A4=SDA and A5=SCL) can be used.
// These pins have a breadboard area on the shield.
// Digital pins: used: 3,4,5,6,7,8,9,10,11,12
// Pin 9 and 10 are only used for the servo motors.
// Already in use: 0 (RX) and 1 (TX).
// Unused: 2,13
// Pin 2 has an soldering hole on the board,
// easy to connect a wire.
// Pin 13 is also connected to the system led.
// I2C is possible, but SPI is not possible since
// those pins are used.

The schematic can be seen at:

I can do without the servos so D9 and D10 aren't a problem but D8 still is. As you can see from the schematic D8 is used as a serial direction line (SER_DIR)

The schematic for the encoder board is at:

http://www.robogaia.com/uploads/6/8/0/9/680998/robogaia_arduino_encoder_shield_schematics_v3.pdf

It seems to me that D2 could be used to replace D8 with a simple change to the code. I believe this can be accomplished physically by cutting the D8 pin from the motor controller card and then running a jumper from the D2 pin. No additional cutting or routing should be necessary?

There doesn't appear to be anything special about D8. The encoder code uses it as an output and drives it high and low as needed. The motor control code similarly uses it as a output control line that could be changed in code. Does my idea have any merit? Are there other conflicts I'm not seeing?

-Anthony-:
Pin 9 and 10 are only used for the servo motors." It makes sense that D9 and D10 would be used to control servos as they are both PWM lines

No that doesn't make sense: you can run servos from any pins. Servos don't use PWM (not in the way meant in Arduino-land anyway) and the servo library takes care of the pulse.

(However, the use of the servo library actually disables PWM on those very pins 9 and 10; some timer thing iirc.)

-Anthony-:
Pin 9 and 10 .... actually come out of pins 15 and 16.

That part I don't get, must say.

-Anthony-:
I'm using an L293D based board.... I'm not married to [it].

Good, since the L293 is really old technology and you would be better looking for a suitable controller from (as an example) Pololu. Nice thing about those is they're not shields, so do your own thing with the wiring.

edit: This site may help if you want to see how shields might conflict.

Every controller chip has its own physical pin numbers assigned to the I/O ports and bits. That's why Arduino boards have their own (virtual) numbering of digital and analog pins, starting at zero, and (usually) occupying contiguous locations on the external connectors. This way e.g. an Uno shield can be used with a Mega board as well, with the same program and library code.

DrDiettrich, Generisizing pins numbers is a great idea. I'm still confused but gladly accept the nomenclature.

JimboZA, It seems the adafruit library does just that. Thank you for the links, I followed them into the wilderness and got lost but learned a little along the way.

To the issue at hand.

Is it uncommon for people to cut and reroute lines to solve shield pin conflicts?

Are there other conflicts I'm not seeing?

Is it uncommon for people to cut and reroute lines to solve shield pin conflicts?

No. Providing you adjust the software and the pins that you reroute have no hardware behind them like timers then it is fine.

Generisizing pins numbers is a great idea. I'm still confused but gladly accept the nomenclature.

This might help you see how virtual pin numbers map to physical pin numbers on the chip. Most of the time here the physical pin numbers are ignored.

https://www.arduino.cc/en/Hacking/PinMapping168