-
Notifications
You must be signed in to change notification settings - Fork 2
Flashing Grbl to an Arduino
This wiki is intended to provide various instructions on how to flash grbl to an Arduino. Please feel free to contribute more up-to-date or alternative methods.
Last updated: 2012-01-20 by chamnit. (Tested on OS X 10.7, 10.6, and 10.4 and the Arduino Uno and IDE v1.0/r22)
As with compiling grbl, the tools for flashing grbl to an Arduino are included in the Arduino IDE software. All you need to do is directly access them through the Terminal.app. The following instructions has been tested and works for the Arduino Uno. For others, your mileage may vary.
For most people, the path to the Arduino compiler tools will be: /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr (Note the absence of /bin from the compiling grbl page.) Depending on where you place the Arduino IDE, the /Applications/Arduino.app path may be different. So, lets call your compiler tools path $AVRPATH to help shorten the following commands.
Next you will need to find the device path to your Arduino. First, connect your Arduino to a Mac USB port. To find the device path, from a Terminal.app window, type: /dev/tty.usb and hit Tab once or twice. This will either give you one device path, which is your Arduino, or multiple paths, if you have more than one usbmodem type device connected to your computer. If you have multiple, simply unplug your Arduino, repeat the process, and eliminate the remaining devices that are still listed. Your Arduino device path should like something like this: /dev/tty.usbmodem1811 and lets call this $DEVPATH.
To Flash Grbl: Using the Terminal.app, first make sure you're in the same directory as the grbl.hex file you want to flash to the Arduino, which we'll call $GRBLHEX. Then, type the following commands to flash.
For Release 0023 and prior: $AVRPATH/bin/avrdude -C$AVRPATH/etc/avrdude.conf -pm328p -cstk500v1 -P$DEVPATH -D -Uflash:w:$GRBLHEX
For v1.0: $AVRPATH/bin/avrdude -C$AVRPATH/etc/avrdude.conf -pm328p -carduino -P$DEVPATH -D -Uflash:w:$GRBLHEX
Note the only change between the two versions is the -c flag from the stk500v1 programmer to the arduino programmer. This programmer flag was updated in the v1.0 IDE. If all goes according to plan, you should see three sequential progress bars of reading, writing, and verifying and you're good to go!
- DANK (Last updated 2/2011)
Last updated: 2012-01-19 by edwardrford. (Tested on Windows XP/7 and Arduino ?)
Flashing a hex file to your Arduino is simple with windows. First, plug in your Arduino into any USB port of your Windows machine and then determine the assigned COM port of your Arduino.
To Determine your Arduino's COM port:
-
Windows XP: Right click on "My Computer", select "Properties", select "Device Manager".
-
Windows 7: Click "Start" -> Right click "Computer" -> Select "Manage" -> Select "Device Manager" from left pane
-
In the tree, expand "Ports (COM & LPT)"
-
Your Arduino will be the USB Serial Port (COMX), where the “X” represents the COM number, for example COM6.
-
If there are multiple USB serial ports, right click each one and check the manufacturer, the arduino will be "FTDI".
To flash a grbl hex to an Arduino:
-
Download and extract xloader.
-
Open xloader and select your Arduino's COM port from the drop down menu on the lower left.
-
Set the BAUD Speed to 57600.
-
Select the appropriate device from the dropdown list titled "Device".
-
Now use the browse button on the top right of the form to browse to your grbl hex file.
-
Once your grbl hex file is selected, click "Upload"
After clicking upload, you'll see the RX/TX lights going wild on your Arduino. The upload process generally takes about 10 seconds to finish. Once completed, a message will appear in the bottom left corner of xloader telling you how many bytes were uploaded. If there was an error, it would show instead of the total bytes uploaded. Steps should be similar and may be done through the command prompt.
Last updated: 2012-01-29 by Atrixium. (Tested on Linux Mint 9 (Ubuntu 10.04) and the Arduino Uno and IDE V1.0)
The tools for flashing grbl to an Arduino (called AVRDUDE) are included with the Arduino IDE software. The following instructions have been tested and work for the Arduino Uno. For others, your mileage may vary.
Note that in Linux all commands are Case Sensitive
On a typical install, the AVRDUDE tools can be found in: /home/$USER/arduino-1.0/hardware/tools/, depending on where you placed the Arduino IDE, the /home/$USER part of the path may be different. AVRDUDE has two files that we need to be aware of: avrdude and avrdude.conf. For simplicity, this document will refer to these two files and their paths as $AVRPATH and $CONFPATH respectively.
Next we need to find the device path for your Arduino. Connect your Arduino to a USB port, then, from a Terminal window, enter: dmesg. This will display a long list of text, the bottom of which should look something like the following:
[ 3058.480208] usb 7-1: new full speed USB device using ohci_hcd and address 15
[ 3058.673379] usb 7-1: configuration #1 chosen from 1 choice
[ 3058.675293] cdc_acm 7-1:1.0: ttyACM0: USB ACM device
The part that says ttyACM0 is my Arduino, you're Arduino should be similarly named but may be ttyACM1 or ttyACM2, etc. depending on how many USB modem devices you have installed. When you've determined the name, your Arduino device path should like something like this: /dev/ttyACM0. from here on we'll call this path $DEVPATH.
To Flash Grbl: Using the Terminal, first make sure you're in the same directory as the grbl.hex file you want to flash to the Arduino, which we'll call $GRBLHEX. Then, type one of the following command lines in to flash:
For IDE version 0023 and prior: $AVRPATH -C$CONFPATH -pm328p -cstk500v1 -P$DEVPATH -D -Uflash:w:$GRBLHEX
Example: \home\rob\arduino-1.0\hardware\tools\avrdude -C\home\rob\arduino-1.0\hardware\tools\avrdude.conf -pm328p -cstk500v1 -P\dev\ttyACM0 -D -Uflash:w:grbl_0_7d_atmega328p_16mhz_9600.hex
For v1.0: $AVRPATH -C$CONFPATH -pm328p -carduino -P$DEVPATH -D -Uflash:w:$GRBLHEX
Example: \home\rob\arduino-1.0\hardware\tools\avrdude -C\home\rob\arduino-1.0\hardware\tools\avrdude.conf -pm328p -carduino -P\dev\ttyACM0 -D -Uflash:w:grbl_0_7d_atmega328p_16mhz_9600.hex
Note that the only change between the two versions is the change from -cstk500v1
and -carduino
; the stk500v1 programmer to the arduino programmer. This programmer flag was updated in the v1.0 IDE. If all goes according to plan, you should see three sequential progress bars of reading, writing, and verifying and you're good to go!
- Synthetos grblshield (Last updated 1/2012)