Hello!
After somehow burning up/shortening my first Mini LV attempting this, I’ve ordered a new set of components to start fresh, and made sure that the wiring is proper this time around. My goal is to have 1 board with an IR receiver, which then drives 4 pairs of motors using 2 DRV8835 dual carriers (each driver output goes to 2 motors, which should roughly turn at the same time/rate). The problem is that some pins (5/4?) do not seem to work. The pinout that I have planned for this is as follows:
| PIN | Function |
|---|---|
| 0 = | Status LED OUT |
| 1 = | IR Receiver IN |
| 2 = | Carrier 1, Input B, Phase OUT |
| 3 ~ | Carrier 1, Input B, Enable OUT |
| 4 = | Carrier 1, Input A, Phase OUT |
| 5 ~ | Carrier 1, Input A, Enable OUT |
| 6 ~ | Carrier 2, Input A, Enable OUT |
| 7 = | Carrier 2, Input A, Phase OUT |
| 8 = | Carrier 2, Input B, Phase OUT |
| 9 ~ | Carrier 2, Input B, Enable OUT |
Each driver has mode and logic VCC connected to the A-Star’s 5V output. The motor side is connected to the battery pack, which also feeds BAT+ and BAT- for the controller itself.
The problems are:
- Carrier 1, Motor A does not seem to work at all, so at least setting pin 5~ does not seem to work. Not sure if the phase/direction pin 4= works as a result.
Carrier 2, Motor A only goes in one direction, so I assume that setting pin 7= does not seem to work- faulty soldering, this works now!
I’m a software person, so I’d like to apologize if this comes across as very amateurish (because it probably is!). Is the usage of pins 5(/4) limited somehow? Do I need to do something special to access them (i.e. more special than just pinMode(5, OUTPUT)/analogWrite(5, 200)? Besides the pins listed above, I don’t really have any utility that I need, i.e. no special need for other pins. It’s really just a stupid GPIO/PWM project to control a truck trailer’s crane. So if I would need to e.g. call/set something to free those pins up, that should probably be doable.
I did notice - but am not sure about it - that when I set pins 4/5 on the board it sometimes seems to freeze/go into an undefined state of some kind (until the next powercycle) - is that related somehow? At least, it seems to ignore IR commands, but the timer-based logic continues as usual.
I’m using the standard bootloader, Arduino IDE, and the Pololu board type. It detects the board properly, and the other pins/motors work as expected (i.e. carrier 1B using pins 2/3 is OK; as is carrier 2 with 6/7/8/9).
I’ve set the pins in an array so I can easily switch between them using the IR. Skipping the IR and general state handling, this is how I’m accessing the pins/drivers:
int8_t selectedMotor = -1;
int8_t direction = 0;
uint8_t motorPWMs[] = /*~*/ { 3, 5, 6, 9 }; // [AB]ENBL
uint8_t motorModes[] = /*=*/ { 2, 4, 7, 8 }; // [AB]PHASE
#define MOTOR_COUNT 4
void initPins() {
for (int i = 0; i < MOTOR_COUNT; ++i) {
pinMode(motorModes[i], OUTPUT);
pinMode(motorPWMs[i], OUTPUT);
}
}
void selectMotor(int8_t newIndex) {
if (selectedMotor != -1) {
analogWrite(motorPWMs[selectedMotor], 0);
digitalWrite(motorModes[selectedMotor], LOW);
}
selectedMotor = newIndex;
analogWrite(motorPWMs[selectedMotor], 0);
digitalWrite(motorModes[selectedMotor], LOW);
}
void setDirection(int8_t newDirection) {
if (selectedMotor == -1 || direction == newDirection)
return;
analogWrite(motorPWMs[selectedMotor], 0);
digitalWrite(motorModes[selectedMotor], newDirection > 0 ? HIGH : LOW);
if (newDirection != 0)
analogWrite(motorPWMs[selectedMotor], 200);
direction = newDirection;
}
Thank you in advance!
Edit: Re-checked the soldering, and pin 7 wasn’t soldered properly on the driver side, hence the pin was okay, but the connection to the chip wasn’t. Fixed that, but the issue with 4/5 remains.
