Cowascript
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.
Setup
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.
Making changes....
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[1]="atmega328p" ; name[1]="Atmel Mega 328p"
chip[2]="atmega8" ; name[2]="Atmel Mega 8a"
chip[3]="atmega1280" ; name[3]="Atmel Mega 1280"
chip[4]="atmega2560" ; name[4]="Atmel Mega 2560"
chip[5]="atmega1284P" ; name[5]="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[6]="t4" ; name[6]="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[1]="atmega328p" ; name[1]="Device 1"
chip[2]="atmega328p" ; name[1]="Device 2"
chip[3]="atmega328p" ; name[1]="Device 3"
chip[4]="atmega328p" ; name[1]="Device 4"
chip[5]="atmega1280" ; name[1]="Device 4 serial number 20000 onwards"
chip[6]="atmega1280" ; name[1]="Device 5"
chip[7]="atmega1280" ; name[1]="Device 6"
chip[8]="atmega2560" ; name[1]="Device 7"
etc etc
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