Plugging grblshield v3 into Arduino Uno while using interrupts


I am partially involved in a project involving operating a small motor with an encoder. The motor is being powered through a grblshield v3, which has worked just fine for the previous motor it was used with, which didn't have an encoder. The problem is I'd like to take the pulse-data the encoder gives us to track the motor's orientation, as shown in some sketch examples here:

However, these all involve using the Uno interrupt pins (2 and 3), which, when the grlbshield is plugged on top of it, seem to be used for grbl-specific things (in this case I think the pins are labeled 'Xstep' and 'Ystep'). So, I was hesitant about plugging the motor wires into these labeled pins for fear that it would interact with the grblshield strangely. Researching further I learned that grlbshield apparently operates using its own kind of code for motor-control specific applications, effectively hijacking the Arduino microcontroller in the process. We have no particular interest in using the grblshield in this way (it is currently being used for powering purposes, as far as I can tell).

My question is this: if we do not do any special Grbl coding, simply upload a sketch to the Uno, mount the grblshield on top, and plug the motor outputs into the grblshield pins corresponding to Uno pins 2 and 3, will this have any particular effect on the grblshield/Arduino? Will it be functionally the same as plugging the motor output directly into Uno pins 2 and 3? My first instinct is yes it would, but the grblshield seems to be a somewhat special case.

Sorry if the answer to this question seems obvious or easily learned: I'm afraid I don't know much about grblshield or motor control and was not able to find the answer with relevant searches. I also understand that using the grblshield in this way may not be strictly necessary/efficient, but it's kind of the constraint I'm working in right now. If the answer is effectively no, I can still implement ways around it.

Thanks for your time!

I don’t have access to the data sheet for a grbl shield, and I think you need that to understand exactly what it does. My limited understanding is that it’s essentially a motor driver, and that the control logic resides in the Arduino. If that understanding is correct, it ought to be possible to use it as a motor driver without involving grbl. If the grbl shield happens to use pins that you need for some other purpose, you need to know whether it’s using those pins in some special way (for example, some pins are dedicated to SPI use and you can’t simply use different pins instead). If they’re just being used as ordinary I/O pins then I don’t see anything stopping you from redirecting the connections so that the grbl shield pins connect to different pins on the Arduino. There is a redirection shield from Mayhew Labs to let you do this redirection neatly, or you can just link up all the pins you need using jumper wires rather than mount the shield on the Arduino directly. Occasionally, people have even resorted to bending pins.

If you’re going to be facing significant time and/or cost to make this work with different pins, consider whether it would be cheaper/quicker/easier to adopt a different motor driver board instead - there are plenty to choose from and typically they are not very expensive.

Edited to add:

Also check your assumption that you need to use particular interrupt pins. The external interrupts are only available on specific pins, but you can use pin change interrupts on any of the digital pins.