Newbie Setup Issues w/ Mega 2560

Question/Answers related to this version of the board.
Post Reply
Posts: 2
Joined: Thu Aug 24, 2017 1:39 pm

Newbie Setup Issues w/ Mega 2560

Post by SSD42 » Thu Aug 24, 2017 2:26 pm

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.

Bertus Kruger
Site Admin
Posts: 1649
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand

Re: Newbie Setup Issues w/ Mega 2560

Post by Bertus Kruger » Thu Aug 24, 2017 7:23 pm

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.

Posts: 2
Joined: Thu Aug 24, 2017 1:39 pm

Re: Newbie Setup Issues w/ Mega 2560

Post by SSD42 » Thu Aug 24, 2017 8:18 pm


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.

Posts: 135
Joined: Wed Nov 09, 2016 8:52 pm

Re: Newbie Setup Issues w/ Mega 2560

Post by gmoney484 » Thu Aug 24, 2017 8:42 pm

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..
Gavin Milne
HoD Science
Dilworth School

Posts: 3
Joined: Thu Apr 12, 2018 3:29 am

Re: Newbie Setup Issues w/ Mega 2560

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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests