I’m having similar problems with a single MC33926 board. I have hooked it up in a couple different ways and even tried borrowing code from the dual MC33926 board library (to no avail). I’m back down to simple basic code for testing, as follows:
#define motorpin1 7
#define motorpin2 6
#define D1pin 4
#define D2pin 9
#define ENpin 3
#define INVpin 13
int speed = 200;
void setup()
{
pinMode(motorpin1, OUTPUT);
pinMode(motorpin2, OUTPUT);
// pinMode(D2pin, OUTPUT); don't need to define for analog
pinMode(D1pin, OUTPUT);
pinMode(ENpin, OUTPUT);
pinMode(INVpin, OUTPUT);
}
void loop()
{
digitalWrite(ENpin,HIGH);
digitalWrite(INVpin, HIGH);
digitalWrite(D1pin,LOW);
digitalWrite(motorpin1, LOW);
digitalWrite(motorpin2, HIGH);
analogWrite(D2pin, speed);
delay(1000);
analogWrite(D2pin, 0);
digitalWrite(INVpin,LOW); //this line is here to reverse the direction of the motor in subsequent code
delay(1000);
}
I have the board connected as follows:
MC33926 Pin Arduino Duemilanove Pin
Vin Vin
Gnd Gnd
Vdd 5V
IN2 6
IN1 7
D2 9
D1 GND
SF not connected
FB Not Connected
EN 3 (also tried just tying this to Vdd)
SLEW Not connected
INV 13
VIN (large connection) not connected- using small Vin (5V) for testing with small hobby motor
GND (large) not connected see above
OUT1 motor
OUT2 motor
I have tested the connections at the board, and they all seem to test appropriately, as far as +5V or gnd. The motor does not spin. If I disconnect the motor, I get no output voltage at the OUT1/2 connectors. I’ve been messing with this for hours, and I’m beginning to think there is something wrong with the board. I successfully got a Arduinoshield motor driver to work with the same motor, so I know the motor works, and I know the Arduino can drive a motor via PWM.
Assuming I can get this to work, I also read a post where it was better to drive PWM on IN1/IN2, and not use D2. Do you have an example sketch of that? The other post didn’t have it.