Identification of motor driver pins
dmalawey opened this issue · comments
You said "pins 1 or 0", but the connectors label the pins 1 and 2. It is common for hardware to begin indexes at 1 instead of 0.
The hardware design convention is pin 1 gets the square solder pad. You can find the solder pad from the bottom of the board or looking at the board layout.
The silkscreen attempts to communicate the clockwise numbering of the motor connectors, starting at the lower-right in your picture.
So, motor 1 pin 1 is the lower-right connector on the upper-most pin within that connector, whereas motor 1 pin 2 is the lower-right connector on the lower-most pin within that connector.
There is a nice TB6612FNG motor driver truth-table on Sparkfun's website. I've mapped the pins to the gpio/pwm numbers as defined in the librobotcontrol motor driver and schematic processor ball numbers below:
| Mx | In1 | In2 | PWM | Out1 | Out2 | SW correction |
|---|---|---|---|---|---|---|
| M1 | GPIO2.0 T13 | GPIO0.31 U17 | EHRPWM1A U14 | 2 | 1 | -1 |
| M2 | GPIO1.16 R13 | GPIO0.10 U17 | EHRPWM1B T14 | 1 | 2 | 1 |
| M3 | GPIO2.9 R4 | GPIO2.8 R3 | EHRPWM2A U10 | 1 | 2 | 1 |
| M4 | GPIO2.6 R1 | GPIO2.7 R2 | EHRPWM2B T10 | 2 | 1 | -1 |
Note that the software accounts for when Out1 is connected to pin 2 by performing a correction.
This helps very much! Will add this to our robot slides. Thank you.


