Pages: [1]   Go Down
Author Topic: Bootloader / serial port communication.  (Read 465 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Faraday Member
Karma: 30
Posts: 2524
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has anyone come across any good links, tutorials... on uploading .hex files?

I'm thinking of having libraries of programs I've written in one area and then selecting a program (*.hex) I've made it uploads to it, so I guess the protocol..

If not, is copying avrdude an option?

SF Bay Area (USA)
Offline Offline
Tesla Member
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are some GUI front ends for avrdude that should do what you want.,8450.0.html

Atlanta, USA
Offline Offline
Edison Member
Karma: 56
Posts: 1848
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can even read images from Arduinos and rewrite that into another (identical) chip:

My article:

If you have a folder full of these HEX files, you can modify the write to disk part of the Batch File to do the dirty for you.  With a little VBA or something free like  you can frontend the process.

Some other of my possibly useful scripts:

A critical item is that from Windows, you want to open the Command Prompt with the correct path to the AVR tools, such as AVRDUDE, which is not generally included in a standard Arduino installation.  I use:

PATH=%path%;C:\Program Files\Arduino_105\hardware\tools\avr\utils\bin;

Then, to invoke AVRDUDE to use my ArduinoISP to program an attiny85 would look something like this:
avrdude -c arduino -P com9 -p attiny85 -b 19200 -U flash:w:flash_me_lv.hex:i -U lfuse:w:0xF1:m -U hfuse:w:0xD5:m -U efuse:w:0xFE:m
As the USB on the UNO is out on port #9.  The file I am writing is named flash:w:flash_me_lv.hex and it is in Intel format.

I recently purchased an Adafruit Trinket which is attiny85 based.  I wanted a copy of everything in HEX, and this is how I got it:
ECHO Beginning dump of ATtiny Flash, Fuses, & EEPROM
ECHO ------------------------------------------------------------------ START FLASH
avrdude -c USBtiny -p ATtiny85 -U flash:r:%temp%\backup_flash.hex:i
ECHO ------------------------------------------------------------------ START Hfuse
avrdude -c USBtiny -p ATtiny85 -U hfuse:r:%temp%\backup_hfuse.hex:i
ECHO ------------------------------------------------------------------ START Lfuse
avrdude -c USBtiny -p ATtiny85 -U lfuse:r:%temp%\backup_lfuse.hex:i
ECHO ------------------------------------------------------------------ START Efuse
avrdude -c USBtiny -p ATtiny85 -U efuse:r:%temp%\backup_efuse.hex:i
REM ECHO ------------------------------------------------------------------ START eeprom
REM avrdude -c USBtiny -p ATtiny85 -U eeprom:r:%temp%\backup_eeprom.hex:i
ECHO Dump of ATtiny85 completed.



Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
Karma: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check out Nick Gammon's page on loading .hex files from SD cards as well.

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at
Arduino for Teens available at

Pages: [1]   Go Up
Jump to: