The Programmer panel in the Program Devices visualizer lets you upload a program (from a
.hex file) to an Arduino (or any device that works with AVRDude). You can also upload a bootloader and set fuses using the Programmer panel and a special
.musx Arduino bootloader configuration file.
The Programmer panel is useful when you want to setup several devices with the same program or are using a 3rd Party IDE to write your Arduino software. It uses AVRDude, the same tool used by the Arduino IDE for uploading programs.
You can get the
.hex file containing your program from the Arduino IDE. Choose Sketch → Export compiled Binary in the Arduino IDE. The IDE will compile your program and copy the
.hex file into the same folder as your sketch (
.ino file). It will be named
[sketchname].ino.standard.hex. This is the file you’ll use with MegunoLink.
To write the version that includes the bootloader, you will need to set fuses on the chip as well. You can use a MegunoLink programming package to do that.
Creating a Panel to Upload Programs
Click the Add Programmer button (or select Programmer) from the menu bar on the Program Devices visualizer. A new upload panel will be created.
Along the top-row of the programmer panel is a description and the source path. The second row lets you configure the programming hardware, device and port to use. The Program button on the last row starts programming the device. It is followed by a lock (to prevent accidental programming), verify and auto-program buttons. A bar shows progress during programming and the console button shows raw output from the AVRDude programming tool.
The time that the
.hex file was last modified and the time it was last uploaded are shown in the bottom right corner of the upload panel.
Description and Multiple Panels
The description is a name for your upload panel. You can add as many upload panels as you like to the Program Devices visualizer. The description helps keep track of what each panel is for. You might have multiple upload panels for:
- final program
- sender and receiver in a wireless system
- versions for different Arduino (Uno and Mega, for example)
- programming multiple devices at once
You can start each programmer separately (with the Program button), all together or one after another. See Programming Sequences for more information.
The source is the path to the
.hex file. Use the browse button to choose the source file.
The path can be absolute or relative to the MegunoLink project file. Relative paths let you move your project and
.hex files between computers without having to update the source path. Right-click on the file-path to change between the two options.
The last-modified time for the
.hex file and the last time the device was programmed are shown in the bottom right corner of the panel.
.hex files, MegunoLink supports a special file-format called a programming package file (
.musx). This special file format can be used to upload bootloaders and adjust fuses on the device. Learn more about Programming Packages.
The second row lets you configure programming options: programming hardware, target device and the port.
The most common programming programming hardware, like the Arduino IDE, is just a USB serial port. But MegunoLink supports a few programmers including:
- Arduino Serial: the standard serial programmer used with
- AVR Dragon: AVR’s Dragon debugger and programmer.
- AVR Mk II ISP: AVR’s ISP programmer.
- Arduino ISP: use one Arduino to program another.
Only the AVR dragon, AVR Mk II ISP and Arduino ISP programmers support changing the bootloader and setting fuses. See programming package for more information.
Next is the board type. You must select the same device you used when creating the
.hex file in the Arduino IDE. This must also match the device you are trying to program!
Finally, select the
COM port that your board is connected to if you are using the Arduino Serial programmer. USB is the only port supported for the other programmers.
On the bottom row, the:
- The Program button starts programming,
- Lock prevents programming (if you accidentally click the program button),
- Verify enables/disables verification of the program. When turned on, the program is read back after it has been written and compared with the original file to ensure no errors occurred during programming,
- Auto-program will automatically reprogram the device whenever it detects a change in the .hex file. This is particularly useful during development when you are making frequent changes to the program and uploading them to the device for testing.
Click the Program button to start programming. If the button is grayed out, either:
- the source file doesn’t exist (right-click the source file and choose Open containing folder to see if the source-file still exists), or
- programming locked (press the Lock button to unlock it).
Output from AVRDude is captured during programming. You can see this output by clicking Show upload details on the visualizer toolbar, or by clicking the Show Output button on the programming panel.