Arduino 2560 ADK resetting while in run

Hi guys,

I am facing one weird problem, here is the situation. While controlling stepper motor via stepper motor driver from my arduino board, after board receives serial command for controlling motor it starts moving motor but suddenly it resets the board and all thing stops.

Previously I use to control the stepper motor from Arduino duemilanove, and it use to work. But after changing the code to work with arduino2560 this problem is appearing. After few tries and few resets now even i am not able to recognize the board with laptop.

Technical Information
Board = Arduino 2560 ADK
Communication = serial over usb
Computer = Windows7, laptop
stepper motor = MIMY 35 KG
driver = leadshine driver m542

Code snippet

#define STEPS 200
#define PULSE_PIN 23
#define DIRECTION_PIN 25

//stepper moving code
while(digitalRead(ZeroSensorPin)==0)
{

LeadShinestepper.step(1);

}

LeadShinestepper.step(-1600);

Any help would be of great help.
Regards

Hi, just a couple of quick checks, the gnd of the arduino is connected to the ground of the microstep driver even though there is opto coupler isolation
You have a separate power supply for the microstep driver and stepper.

Seems strange after you have had it working on other platform.

Tom..... :slight_smile:

Hi Tom,

Thanks for reply,
Ground of arduino is not connected with ground of microstep driver only 5v is connected as shown in figure. I have seperate power supply for Stepper driver which powers stepper motor and I am powering my arduino from usb port.

Let me know if further information is needed

Regards

Hi there,

Can anybody provide guidance?

Thanks

Guys one more thing

Arduino doesn't get recognized when powering externally, but when I select USB powering option it gets recognized. (I take care of swapping jumpers)

Regards, any help is appreciable.