Hi all,
Great forum!
"Long time listener, first time caller"...
I apologise for the presumably simplicity of this question, I am fairly new to the Arduino/microcontroller/programming world.
I've had no troubles connecting hardware & uploading/running example sketches to my Arduino Uno & AdaFruit Motor Shield on Windows & Ubuntu.
Slowly understanding a few things on the way...
I'm currently messing around trying to create a simple drawbot/cnc using GRBL (0.7), using steppers for XY & a servo for Z.
I can compile & upload the grbl firmware with no problem (using Ubuntu) but I don't quite understand which pins I need to use for this specific setup & whether Z axis in config.h needs to be a servo/pwm? I'm at a bit of a loss here. Would anybody happen to have any "idiot-proof" reference material or guides handy?
I can compile & upload the grbl firmware with no problem but I don't quite understand which pins I need to use for this specific setup & whether Z axis in config.h needs to be a servo/pwm?
You have access to the code. We don't. Who would be in the best position to answer that question?
Sorry, I didn't think it necessary to post the code (I presumed someone would be familiar with GRBL).
This is the part pertaining to pin assignments in config.h
As I said in first post, I don't have much of a clue, but I do want to learn, that's why my question was mainly if anybody has good reference material &/or guides. Thanks for the reply in any case.
The innermost set of names are short for either PINx (in) or PORTx (out). The digit is the pin number on that port. So, PB5 is the 5th pin on PORTB or PINB, depending on whether the pin is used for input or output.
The text in red then identifies how the Arduino refers to the same pin. PB5 is digital pin 13.
Your stepper motor controllers should be connected to PORTD (output), which is digital pins 0 to 7. The step pins should then be digital pins 2, 3, and 4. The direction pins are pins 5, 6, and 7.
If you have limit switches, they are connected to PINB (input), which is the rest of the digital pins (8 to 13). The limit switches connect to pins 8, 9, and 10.
Pins 11 and 12 are used for the spindle enable and spindle direction pins.
Tl;dr :
GRBL does not officially support H-Bridge drivers (Adafruit motorshield) but there is some modified code (3 files) that is able to use this board with GRBL.
The downside :
This code is for GRBL version 0.7 only. There is no update for 0.8 or anything higher then 0.7.
Since 0.7 a lot of fixes were pushed. So it not seems to be likely to get this shield working with GRBL excpet someone re-writes the code for v0.8+