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

Interfacing the MSP430 with the A4988 Stepper Motor Driver

$
0
0

Hello guys!

I am trying to interface 4-wire, 12 V stepper motor using the A4988 Stepper Motor Driver from Polulu. As far as I understand (and according to the A4988's Datasheet), all that it needs to make the motor move is a simple pulse to the STEP input. I did this and it is not making the motor move. I will attach a few pictures that will allow you guys to understand what's happening a little bit better:

 

This is how the chip is supposed to be connected:

 

StepperMotorDriver_zpsec626bb1.png

 

 

Now, my configuration is the following:

 

5E44658F-0338-4693-B230-0F6BEA7BF5DB_zps

 

3177C808-9787-4415-B29E-604CDA9708C4_zps

 

 

The yellow and purple cables are of an external 12 V voltage supply. The red and black are the from the 5 V and GND pins in the MSP 430. The brown cable is from pin 1.4 of the MSP. The Red, Blue, Green, and Black cables are from the Stepper Motor.

 

This is the code I am using:

#include <msp430.h>				

unsigned int i;

void delay(int val)
{
	for(i = 0; i < val; i++) {;}
}

int main(void)
{
	WDTCTL = WDTPW | WDTHOLD;		// Stop watchdog timer
	P1DIR |= 0x04;					// Set P1.0 to output direction

	while(1)
	{
		P1OUT = 0x04;
		delay(200000);
		P1OUT = 0x00;
		delay(200000);
	}

	return 0;
}

Is there something that I am doing wrong?? Any help would be great! 

 

Thank you all.


Viewing all articles
Browse latest Browse all 2077

Trending Articles