Page 1 of 1

Newbie Setup Issues w/ Mega 2560

Posted: Thu Aug 24, 2017 2:26 pm
by SSD42
Hi all,

I'm attempting to run the shield on a Mega 2560, but am unable to get any motor movement on any channel & am at my wits end.

Here's the setup I'm using:
  • Current model shield (v3.51)
  • Arduino Mega 2560 (Clone w/ Genuine Atmel USB-Serial chipset)
  • GRBL 1.1f (have tried both MEGA and traditional branches w/ both the pre compiled .HEX and by self-compiling in Arduino IDE)
  • 7x Stepstick A4988 driver board (only 1 connected at any given time, including known good ones from the original Banggood controller shield)
  • FSP Group PSU @ 19VDC 3.45A (pulled from a working embedded PC project)
  • 3x Eleksmaker 42hs34-1304a stepper motors (only 1 connected at any given time during testing)
I originally got a motor whine at my first powerup, but that disappeared on all subsequent starts. Currently, I can make the connected motor briefly jump when I hit the reset button, and GRBL shows that it's rebooted on the serial monitor, so I know the shield's connected correctly.

From what I can tell, Pin 8 on the Arduino stays low regardless of GRBL's idle/run/sleep state, which should mean that the driver is enabled at all times, but the motor barely resists me regardless of where I set the VREF resistor on the driver.

There are no obviously blown traces on the shield, and I've triple-checked the capacitor polarity.

Any assistance would be greatly appreciated.

Re: Newbie Setup Issues w/ Mega 2560

Posted: Thu Aug 24, 2017 7:23 pm
by Bertus Kruger
CNC shield was mainly designed for use with Arduino UNO's.

Don't quote me but I don't think the Pin configuration on the UNO and the MEGA are not the same.

Re: Newbie Setup Issues w/ Mega 2560

Posted: Thu Aug 24, 2017 8:18 pm
by SSD42

On a semi-related note, I also discovered that the RepRap-compatible DuPont to JST cables I was using were wired A+B+A-B- instead of A+A-B-B+ - swapping the pins so the coils energize correctly fixed the torque issue, but still no movement.

It'll take me a day to get an Uno from a friend (no one carries them locally since RadioShack went bankrupt) & I'll post a followup then.

Re: Newbie Setup Issues w/ Mega 2560

Posted: Thu Aug 24, 2017 8:42 pm
by gmoney484
Some of the pins are different and/or unassigned between the Uno (328 chip) and the Mega (2560 chip). Also some of the internal registers are different as are the external interrupt assignments. Most shields should work, but some won't. Some code written for the 328 won't compile on the 2560 either.

I suspect the most likely cause will be pin assignment. The IDE calls the analog pins as pins 15-17. However, on the Mega pins 15-17 refer to serial communication pins. The correct (from the CNC Shield) pins are pins 54-58 on the Mega.

Theoretically, you could edit the GRBL pin config file cpu_map.h and change the pin assignments - without further investigation, I'm sure there might me much more to it than that, but its worth a try. Personally, I'd just buy and Uno ;)

UPDATE: GRBL only works on ATMega328 - so that's that..

Re: Newbie Setup Issues w/ Mega 2560

Posted: Fri Jan 11, 2019 3:56 am
by relic48 Any progress on this? (I know, it's an old thread but Megas are dirt cheap now at the local Micro Center )