Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

MSP430G2 Revision 1.5 and Boost-DRV8711 boosterpack

$
0
0

I just got the msp430G2 launchpad with the MSP430G2553 mcu. For stepper motor driver im using the boost-drv8711 boosterpack. I was able to get it running with the tutorial that it came with. However i cant run it with Energia. It might be because of the enable bit (0x0) but i dont know how to set it 1 on energia. Do any of you have any experiance of this setup ? The motor im running is bipolar sanyo denki 103h5208-5240. My code so far is like this (i used the arduino example, board pin layouts in attachment):

 

#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); 
 
 
}

 

 

 

Attached Thumbnails

  • pin layout.png

Viewing all articles
Browse latest Browse all 2077

Trending Articles