Atmega328p, 28BYJ-48 steppers and FTD1232 - wont run properly

My project involves two of these stepper motors and a laser.

The program works just fine when I plug the FTD1232 power pins into the circuit, but otherwise stalls out on the first run.

The FTD1232 has 5v and GND shared across the circuit with main power and all of the 328 power/GND pins.
I have checked for loose GND or 5V lines.
I don't even need the FTD1232 attached to the computer, and I only need the power lines of this card attached to my circuit to have it work.

When the FTD card is not attached, the circuit will power up and start to process commands to move the steppers motors, but stalls out at the first movement command, according to the serial monitor.

It will run perfectly when the circuit is attached to a Nano.

I have set up the 328P per this basic setup page:
http://www.jameco.com/Jameco/workshop/JamecoBuilds/arduinocircuit.html?CID=arduinobuild

I have the stepper motors attached to an 8 port motor control chip, then to D5-D12 on the 328P.

I can provide code, schematic and layout if needed (done in Diptrace).

What is an FTD1232?
Post a link to its datasheet.

Post your program.
And please use the code button </> so your code looks like this and is easy to copy to a text editor

The FTD1232 is a USB to serial adapter.
I can find images of exactly what I have all day long, but I can’t find a DS for it.
It’s all over Ebay.

#include <StepperMotor.h>
#include <Sleep_n0m1.h>
//Beginning of Auto generated function prototypes by Atmel Studio
//End of Auto generated function prototypes by Atmel Studio


Sleep sleep;

#define _PIN1M1 8
#define _PIN2M1 7
#define _PIN3M1 5
#define _PIN4M1 6
#define _PIN1M2 12
#define _PIN2M2 11
#define _PIN3M2 9
#define _PIN4M2 10
int laserPin = 3;   //output pin for laser on/off
int timePin = 44;    //input pin for runtime
int modePin = A5;   //mode input pin
int limitM2 = A1;
int limitM1 = A0;
int ledPin = 13;
unsigned long time;     //time in ms since program started
unsigned long timeStart;    //time var when loop started
unsigned long runTime = 90000;  //time in ms to run before sleeping
StepperMotor stepper1(_PIN1M1, _PIN2M1, _PIN3M1, _PIN4M1);
StepperMotor stepper2(_PIN1M2, _PIN2M2, _PIN3M2, _PIN4M2);

// declare functions
void drawCircle();
void drawLine();
void drawRandom();
void gotoSleep();
void setStart();

void setup() {
	pinMode(laserPin, OUTPUT);
	pinMode(timePin, INPUT);
	pinMode(ledPin, OUTPUT);
	Serial.begin(9600);

}

// main loop
void loop() {
	digitalWrite(laserPin, LOW);
	digitalWrite(ledPin,HIGH);
	timeStart = millis(); // set start time
	delay(100);
	Serial.print("Analog read says mode = ");
	Serial.println(analogRead(modePin));

	//read mode and call function
	
	if (analogRead(modePin) > 50) { // if mode pin read medium, do line
		drawLine();
	}
	if (analogRead(modePin) > 20 && analogRead(modePin) < 50) {   // if mode pin read low, do random
		drawRandom();
	}
	if (analogRead(modePin) ==0 ) {
		drawCircle();
	}
}

// function to draw a circle shape
void drawCircle() {
	setStart();     // reset starting point
	int pos1=128;
	int pos2=0;
	int dir1;
	int dir2;
	int maxpos = 128;
	int minpos = -128;
	int steps = 1;
	int del = 3;

	delay(100);
	Serial.println("Running circle code");
	delay(100);
	digitalWrite(laserPin, HIGH);   //turn on laser
	dir1=steps;
	dir2=steps;
	stepper1.setPeriod(1);
	stepper1.move(pos1);
	delay(500);
	stepper1.setPeriod(del);
	stepper2.setPeriod(del);
	while (analogRead(modePin) == 0) {        // while mode is set to Cicle, do function
		time = millis();
		if (time - timeStart >= runTime) {        //repeat function until runTime reached
			gotoSleep();
		}

		stepper1.move(dir1);
		stepper2.move(dir2);

		if (pos1 >= maxpos) {
			dir1 = -steps;
		}
		else if (pos1 < maxpos && dir1 == steps) {     // move forwared by "steps" until max position reached
			pos1= pos1 + steps;
		}
		// then reverse direction
		if (pos1 <= minpos) {
			dir1 = steps;                            //then reverse direction
		}
		else if (pos1 > minpos && dir1 == -steps) {    // move backwards by "steps" until min position reached
			pos1 = pos1 - steps;
		}

		if (pos2 >= maxpos) {
			dir2 = -steps;                          // then reverse direction
		}
		else if (pos2 < maxpos && dir2 == steps) {     // move forwared by "steps" until max position reached
			pos2= pos2 + steps;
		}
		if (pos2 <= minpos) {
			dir2 = steps;                            //then reverse direction
		}
		else if (pos2 > minpos && dir2 == -steps) {    // move backwards by "steps" until min position reached
			pos2 = pos2 - steps;
		}
		
	}
}

void drawLine() {
	setStart();
	int pos1=0;
	int dir1;
	int maxpos = 228;
	int minpos = -228;
	int steps = 1;
	int del = 5;

	delay(100);
	Serial.println("Running line code");
	delay(100);
	digitalWrite(laserPin, HIGH);
	dir1=steps;
	while (analogRead(modePin) > 50 ) {
		time = millis();
		stepper1.setPeriod(del);    // set movement speed
		if (time - timeStart >= runTime) {
			gotoSleep();
		}
		while (pos1 != maxpos && dir1 == steps) { // move CW till limit reached
			pos1=pos1 + steps;
			stepper1.move(dir1);
		}
		while (pos1 != minpos && dir1 == -steps) {  // move CCW till limit reached
			pos1 = pos1 - steps;
			stepper1.move(dir1);
		}
		if (pos1 == maxpos) {dir1 = -steps;}  // change dir when limit reached
		if (pos1 == minpos) {dir1 = steps;}
	}
}

void drawRandom() {
	setStart();
	long lastPos1 = 0;
	long lastPos2 = 0;
	int minpos1 = -228;
	int maxpos1 = 228;
	int minpos2 = -228;
	int maxpos2 = 228;
	int mindel = 2;
	int maxdel = 3;
	long randNum1 = 1;
	long randNum2 = 1;
	long randDel1 = 1;
	long randDel2 = 1;
	int steps = 1;
	delay(100);
	Serial.println("Running random code");
	delay(100);
	digitalWrite(laserPin, HIGH);

	while (analogRead(modePin) >20  && analogRead(modePin) < 50) {
		time = millis();

		if (time - timeStart >= runTime) {
			gotoSleep();
		}
		
		randNum1 = random(minpos1, maxpos1);  // select random position and speed
		randNum2 = random(minpos2, maxpos2);
		randDel1 = random(mindel, maxdel);
		randDel2 = random(mindel, maxdel);
		while (randNum1+lastPos1 > maxpos1) {
			randNum1 = random(minpos1, maxpos1);
		}
		while (randNum1+lastPos1 < minpos1) {
			randNum1 = random(minpos1, maxpos1);
		}
		while (randNum2+lastPos2 >maxpos2){
			randNum2=random(minpos2, maxpos2);
		}
		while (randNum2+lastPos2 <minpos2) {
			randNum2=random(minpos2,maxpos2);
		}
		Serial.print(randNum1);
		Serial.print("\t");
		Serial.println(lastPos1);
		Serial.print(randNum2);
		Serial.print("\t");
		Serial.println(lastPos2);

		stepper1.setPeriod(randDel1);     // set speed
		stepper2.setPeriod(randDel2);
		
		while (randNum1 > lastPos1 && randNum2 > lastPos2) {  // move to position
			//Serial.println("++");
			if (lastPos1 != randNum1) {
				lastPos1++;
			}
			if (lastPos2 != randNum2) {
				lastPos2++;
			}
			stepper1.move(steps);
			stepper2.move(steps);
		}

		while (randNum1 < lastPos1 && randNum2 > lastPos2) {
			//Serial.println("-+");
			if (lastPos1 != randNum1) {
				lastPos1--;
			}
			if (lastPos2 != randNum2) {
				lastPos2++;
			}
			stepper1.move(-steps);
			stepper2.move(steps);

		}
		while (randNum1 > lastPos1 && randNum2 < lastPos2) {
			//Serial.println("+-");
			if (lastPos1 != randNum1) {
				lastPos1++;
			}
			if (lastPos2 != randNum2) {
				lastPos2--;
			}
			stepper1.move(steps);
			stepper2.move(-steps);
		}
		while (randNum1 < lastPos1 && randNum2 < lastPos2) {
			//Serial.println("--");
			if (lastPos1 != randNum1) {
				lastPos1--;
			}
			if (lastPos2 != randNum2) {
				lastPos2--;
			}
			stepper1.move(-steps);
			stepper2.move(-steps);

		}
	}
}

void setStart() {
	int setStart = 10;
	int startP1 = 700;
	int startP2 = 700;
	delay(100);
	Serial.println("Setting start point");  //serial output for debugging
	delay(100);
	Serial.print("Analog read says Limit1 = ");
	delay(100);
	Serial.println(analogRead(limitM1));
	delay(100);
	Serial.print("Analog read says Limit2 = ");
	delay(100);
	Serial.println(analogRead(limitM2));
	stepper1.setPeriod(1);
	stepper2.setPeriod(1);
	while (analogRead(limitM1) < 150) {  // move till limit switches hit
		stepper1.move(-setStart);
		}
	while (analogRead(limitM2) <150) { 
		stepper2.move(setStart);
		}
	
	stepper1.move(startP1);  // move to center point for proper laser tracking
	stepper2.move(-startP2);
	delay (100);
	Serial.println("Start point set");
	delay(100);
}

void gotoSleep() {
	digitalWrite(laserPin, LOW);  //turn off laser & LED
	digitalWrite(ledPin,LOW);
	delay(100);
	Serial.println("Sleeping till interrupted");
	delay(100);
	sleep.pwrDownMode(); //set sleep mode
	sleep.sleepInterrupt(0, RISING); //Sleep till interrupt pin goes high
	loop();  //return to main loop to check mode
}

Can you do simple communication with the Arduino Serial Monitor using the FTDI cable attached to the Atmega's Rx and Tx pins and GND.

I use a similar cable for programming and debugging my Atmega 328s.

I hope you are not trying to power the motors using the FTDI cable?

Make a pencil drawing showing how everything is connected and post a photo of the drawing.

...R