Hi,
Just got my MSP430G2 launchpad (MSP430G2553 mcu) and stepper driver boostpack BOOST-DRV8711 and started testing them. I got the tutorial program working according to the user guide (The one done with code composer studio and BOOST-DRV8711_GUIv1.0). However when I tried to start coding with Energia I ran into troubles. I cant get the stepper motor to spin. I think its because of the enable bit is not set to 1, but i don't know how to change it with Energia. Does anyone have any tutorial codes for DRV8711/MSP430. Just seeing working code would help so much. Here is the code I was able to come up with. Its copied from the Energia's examples and changed a bit to work with MSP430 (or in this case not working).
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// These are the pins for the driver STEP/AIN1 , DIR/AIN2, BIN1,BIN2
Stepper myStepper(stepsPerRevolution, 9, 10, 12, 13);
void setup() {
pinMode(9, OUTPUT); // same as above
pinMode(10, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(6, OUTPUT); // pin for the nSleep which wakes up the board
digitalWrite(6, HIGH);
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(100);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(100);
}
Best regards,
Harri Harju