Hi there
I am using the DRV8833 with an Arduino Nano rp2040 to control two DC motors.
The wiring looks like this:
Vmotor - 9V
GND - ground
SLP - GPIO12
AIN1 - GPIO26
AIN2 - GPIO27
AIN1 - GPIO28
BIN2 - GPIO29
The code I am using is the following:
#define RIGHT_FORWARD 26
#define RIGHT_BACKWARD 27
#define LEFT_FORWARD 28
#define LEFT_BACKWARD 29
#define SLP 12
void setup() {
Serial.begin(9600);
Serial.println("Stepper test!");
pinMode(LED_BUILTIN, OUTPUT);
pinMode(RIGHT_FORWARD, OUTPUT);
pinMode(RIGHT_BACKWARD, OUTPUT);
pinMode(LEFT_FORWARD, OUTPUT);
pinMode(LEFT_BACKWARD, OUTPUT);
pinMode(SLP, OUTPUT);
}
void loop() {
Serial.println("loop");
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(SLP, HIGH);
digitalWrite(RIGHT_FORWARD, HIGH);
digitalWrite(RIGHT_BACKWARD, LOW);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(200);
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(RIGHT_FORWARD, LOW);
digitalWrite(RIGHT_BACKWARD, LOW);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(200);
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(RIGHT_FORWARD, HIGH);
digitalWrite(RIGHT_BACKWARD, LOW);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(200);
}
The LED is blinking which indicates the program does run.
Also when I measure the GPIO26 I do get the expected 0 or 3.3v and on the GPIO12 I get the expected 3.3v.
But in the AOUT1 I would expect to see some voltage that goes to the DC motors, but there is nothing.
Does anyone have an idea why?
I did change the DRV (i have 4 of them, same problem with all of them) and I did change the Arduino, but nothing helps..