Program Device

 In Documentation

MegunoLink Pro’s Program Device visualiser can be used to program Arduino based hex files. This visualiser utilizes the same programming tools distributed with your standard Arduino installation (AVRDude).

The programmers supported include:

All programmers support writing a new program (.hex file) to the device.

The ISP programmers can also program fuses, the device EEPROM, write serial numbers and download the content of the devices EEPROM or program memory to a file.

Setting up a Programmer

Begin by opening a Program Device visualizer in MegunoLink. Use the Add Programmer (add programmer) button on the toolbar to add the appropriate programmer. You can choose from:

  • Programmer: to upload a program (.hex file)
  • EEPROM Id Writer: to write a serial number to the device eeprom (requires ISP programmer)
  • Downloader: to download the device program or eeprom memory (requires ISP programmer)

MegunoLink will add a new programmer panel so you can configure the settings and program your device.

MegunoLink uses AVRDude to upload programs. You can see the output from AVRDude by clicking the Show upload details (show upload details) button.

Uploading a Program

Use the programmer panel (see above) when you want to upload a .hex file to your Arduino.

You can obtain the compiled .hex file by selecting Export compiled binary from the Sketch menu in the Arduino IDE. Your program will be compiled and the .hex file will be written to the folder containing your Arduino sketch. You want the .standard. version. To write the version which includes the bootloader you will need to set fuses on the chip as well. You can use a MegunoLink programming package to do that.

The panel to upload .hex files looks like this:

Program panel for hex files

The MegunoLink panel for uploading .hex files to your Arduino

Along the top-row of the programmer panel is a description and the source path. The description is a name for your uploader. This is a convenient way to keep track of different programs or versions. 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. 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.

Along with .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.

In the second row, you can select the type of programmer you are using (serial, AVR Mk II ISP etc) and the board you are programming. You can also choose the port to use.

On the bottom row, 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 occured 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.

Download Arduino Program/EEPROM

Use the downloader panel to retrieve the content of program memory (FLASH) or the device EEPROM. Serial bootloaders don’t support the commands necessary to download the device data; you’ll need to use an ISP programmer.

Arduino download panel

The MegunoLink panel for downloading program and EEPROM memory using an ISP programmer

Use the Description box to name the downloader to help keep track of multiple panels. Use the browse button to select the file location where the downloaded data will be saved.

On the second row, choose the programmer you are using and the chip you’re downloading from. Select the port and the source: Flash or EEPROM.

Click the Download button on the bottom row to begin the download operation.

Writing Device Ids

MegunoLink’s EEPROM Id Writer panel can write unique serial numbers to the eeprom of your device using an ISP programmer.

Write serial numbers to Arduino devices.

Write unique serial numbers to your devices with the ID Writer panel

Ids can use 1, 2, 3 or 4 bytes with numeric and alphabetic parts. Ids can be written in big-endian or little-endian order. Click the Configure button to set the Id format and eeprom location. Use the Test button to see the data that will be written for the next id.

The next id that will be written, when the Program button is pressed, is shown on the second line. The number of fields available depends on the format selected. When the auto-increment box is checked, the next Id will be increased by one each time a device is programmed successfully. The + lets you increment the next Id by one manually.

When verify is turned on, the value will be read back after writing to check that no errors occured.

Hardware Support

MegunoLink comes preconfigured with support for the a number of devices. Please contact us if you don’t see your device listed here; we may be able to add it easily.

Serial Bootloader

A serial/USB port is one of the easiest ways to program an Arduino. We currently support the serial bootloader on these standard Arduino devices:

  • Arduino Uno
  • Arduino Duemilanove w/ATmega328
  • Arduino Mega 2560 or Mega ADK
  • Arduino Mini w/Atmega328
  • Arduino Pro or Pro Mini (3.3V, 8MHz) w/ATmega328

MegunoLink includes a flag to disable automatically erasing the device during programming. This means any settings stored in the EEPROM will be retained when the device is programmed.

We also include support for a number of custom bootloaders based on Optiboot. The table below lists the parameters that MegunoLink supplies to AVRDude for programming these devices.

Description Part Protocol Baud Rate
ATMega1280 atmega1280 arduino 57600
Mega Pro 2560 (8MHz, Arduino Compatible) atmega2560 wiring 57600
ATmega328p atmega328p arduino 57600
ATmega644p atmega644p arduino 57600

In Circuit Serial Programmer (ISP/ICSP)

MegunoLink can use the AVR MkII or AVR Dragon ISP to program the following devices:

  • ATtiny88
  • ATmega644p
  • ATmega328p
  • ATmega2560
Recent Posts

Leave a Comment

Contact Us

Send us an email and we will get back to you shortly.

Not readable? Change text.

Start typing and press Enter to search