Atmega_Hex_Uploader_Fixed_Filename firmware
This is the basic firmware. It allows programming with the buttons and confirmation is indicated with leds. Download the firmware from this github repo:.
https://github.com/nickgammon/arduino_sketches
Choose the sketch named Atmega_Hex_Uploader_Fixed_Filename
A special version of SDFat library is needed. Download it from here below. Do not use the latest version of this library or compilation will fail.
https://github.com/greiman/SdFat/releases/tag/1.1.4
- Install the above library.
- Open the Atmega_Hex_Uploader_Fixed_Filename sketch in the Arduino IDE.
- Select Tools -> Board: -> Arduino AVR Boards -> Arduino Mega or Mega 2560
- Connect the Mega to the usb port.
- Click on Upload to write the programming sketch.
Usage
Only the OK button is functional. Press OK to start flashing the target. A sucessful flash will be indicated by the green LED blinking. Errors will be reported using the patterns below
Problems with SD card or programming target chip
Red x 1 = Cannot open SD card
Red x 2 = Cannot read file 'firmware.hex'
Red x 3 = Cannot enter programming mode in target chip
Red x 4 = This chip does not have a bootloader fuse
Red x 5 = Cannot read chip signature
Red x 6 = Unrecognised signature
Red x 7 = Bad start address in hex file for code
Red x 8 = Verification error
Problems with firmware.hex file
Red+yellow x 1 = Line in file is too long
Red+yellow x 2 = Line in file is too short
Red+yellow x 3 = Line does not start with a colon (:)
Red+yellow x 4 = Invalid hex digits (should be 0-9, A-F)
Red+yellow x 5 = Bad sumcheck at end of line
Red+yellow x 6 = Line not expected length
Red+yellow x 7 = Unknown record type
Red+yellow x 8 = No 'end of file' record in file
Red+yellow x 9 = File will not fit into flash of target
Credits to the author of this firmware who documented the usage here.