I've written a script for uploading HEX files to Atmel chips using AVRDUDE.
The script will also verify, erase, read (eeprom, flash and fuses) and perform multi-writes.
This was written to allow "customers" the ability to upload replacement programs themselves without them having access to the sketch. The script is written to work with BASH and works on MacOS and should also work in Linux.
Download the zip, un-compress it and place it in the Applications directory.
Inside the folder is a directory "Drivers". Run the relevant driver file (if this computer does not have the Arduino IDE already), the driver directory can then be deleted or just left as it is.
To run the script double click on "Cowascript"
The folders are:
hex - This is where the script looks for new HEX files and will list them all for the user to select one.
bin - This is where the script keeps the AVRDUDE program and config files
read - This is where the script writes the contents of the chip when it reads them
What it does....
The script starts by asking the user what they want to do: program/erase/read or verify a chip or multi-write a batch of chips.
The script then reads all the serial ports on the computer, it decides which of these are relevant and if there is just one it automatically selects it, if there are more than one it gives the user the ability to select the right one and if none it aborts.
The user can also select the chip type (but by setting a labelled variable in the script this question can be automated too).
The user will also be shown all the HEX files within the "hex" folder.
The script will work as it is but it may be necessary to make a few minor changes......
The chip select menu is defined using the following lines:
chip="atmega328p" ; name="Atmel Mega 328p"
chip="atmega8" ; name="Atmel Mega 8a"
chip="atmega1280" ; name="Atmel Mega 1280"
chip="atmega2560" ; name="Atmel Mega 2560"
chip="atmega1284P" ; name="Atmel Mega 1284P"
If you wish to add a chip just follow the same layout. So lets add a Tiny4, we do this by adding the following line:
chip="t4" ; name="Atmel Tiny 4"
The array "chip" is the definition code for the specific chip, there is a full list at the end of the script. The array "name" is a user readable title for that device or chip. You could just list devices as I have done so far or you could use the name array for the device names instead.
chip="atmega328p" ; name="Device 1"
chip="atmega328p" ; name="Device 2"
chip="atmega328p" ; name="Device 3"
chip="atmega328p" ; name="Device 4"
chip="atmega1280" ; name="Device 4 serial number 20000 onwards"
chip="atmega1280" ; name="Device 5"
chip="atmega1280" ; name="Device 6"
chip="atmega2560" ; name="Device 7"
If your only want the user to be able to upload a new program then you can force the "menu" to option 1 by setting menuoption=1 after the chip definitions. You could set this to any of the menu options by selecting that number. If you do specify the option number then the menu will not display.
The sketch makes an intelligent guess at which serial ports are relevant. If this missed ones you need such as bluetooth ones etc then you can list them all by going to the serial port select section and removing the "if" and "fi" lines. There is a label in the script which explains this.
I have created this script for everyones use. If there are any suggestions for improvements, bug fixes, changes etc then post them and I can add them to the download.
I did post this in the wrong section so deleted it and sticking it in here instead
DOWNLOAD CURRENT VERSION : www.cowasaki.co.uk/cowascript/Cowascript100.zip