The standalone Arduino Programmer can program many atmel chip in stand alone mode which means it does not need a computer to operate. This is very useful for automating the programming of large number of chips.
This product is a shield for the Arduino Mega.
You will need to program the Arduino Mega only once with a computer then the programmer will be stand-alone and only need connection with a power source.
The principle is:
- Program the Arduino Mega with the sketch provided below.
- Flash the target sketch on a SD card
- Insert the SD card / Connect the mega to the power supply.
- Connect the shield to the target device with the 6 pin cable.
- Press OK on the shield.
- Target is now programmed.
- Onboard Micro SD card.
- 3 operation LED (work / ok / error).
- 3 operation button.
- 6 pin SPI connection to target.
- Additional GPIO pins available for expansion.
- Provision for use of a small LCD screen.
Preparing the programmer
- Compile the target sketch on Arduino IDE.
- Locate the produced hex file.
- Copy it to the SD card.
- Rename the file as 'firmware.hex'.
- Insert the SD card in the programmer.
- Connect the 6 pin ribbon cable to the target device.
- Press the OK button.
- Sucessful flash will be indicated with the green led 'ok'
Several firmwares that can be used on the programmer.
This is the basic firmware. It allows programming with the buttons and confirmation is indicated with leds. Download the firmware from this github repo:.
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.
- 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.
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.