Arduino Mega Pins 50-54 stepper motor driver

Hi all,

I'm new to the Arduino world (so far loving it) and I am wanting to control 4 stepper motors (using driver boards) using the Arduino Mega. I am using pins:

Stepper 1: 23, 25, 27 (Enable, Direction and Clock) Stepper 2: 33, 35, 37 Stepper 3: 43, 45, 47 Stepper 4: 50, 52, 53

However pins 50, 52 and 53 won't work. I have tested stepper driver 4 on other pins and it works fine. I have read in the documentation that they are SPI pins and was just wondering if this is the reason I cannot digitalWrite them HIGH and LOW?

Any insight would be a great help thanks!!


Those pins (50..53) are the hardware SPI interface - if any part of your sketch is using hardware SPI those pins will not be available for other uses.

[ for instance they are also brought out on the ICSP header, perhaps something is connected to that? ]

Awesome thanks!