There are many programmers available for AVR micros. The cheapest are the simple parallel port programmers, which just consist of a DB-25 and a few resistors and wires. In CSE a serial port programmer based on an Atmel App Note AVR910 has also been used a lot - and is required if you happen to have a notebook without a parallel port.
Which programmer to use ? Maybe PonyProg is the way to go as it seems to have the most complete coverage of AVR devices at this time. See below for more details,. UISP is a good call if you don't want a grphical interface. SP12 works fine for me - it has a new configurable 'dev' file feature that seems to promise support for all future devices, Mega or otherwise.
A programmer actually consists of two things - the physical hardware and the program that runs on your developmnet machine.
Note that the new Mega versions of the AVR's require page-based programming, while the older members of the family used byte-based programming. Some programmers and/or their support software don't handle page-based programming too well.
sp12 -wF11111111To program the High fuse bits on a Mega323 use
sp12 -wH10111111
The serial port programmer based on Atmel's AppNote #910.
This system broke when the School started using the new Mega323. A bit of sleuthing showed that the problem was that the new Mega AVRs are programmed in page mode - previous processors only supported byte mode. The small programmer itself does support page mode, the problem actually resided mostly in the hosts program.
So changing host program to
uisp 'was tested and does support page programming. The following lines shows how to invoke it for a Mega - this is just a simple script
#!/bin/sh
# -dpart is the hex part number, so ?? for an 8535, etc
# programmer crystals 4MHz->19200 8MHz->38400 12MHz 57600 16MHz=??
uisp -v=2 --upload --erase -dprog=avr910 -dspeed=19200 -dpart=45
-dserial=/dev/ttyS1 if="ledflash.hex"
the 'dpart' parameter is a magic number that tells the programmer what avr
is being used. I had to modify the programmer to say that yes - there did
indeed exist a Mega323 - and its magic number was 45. I have reporgrammed a
number of existing programmer devices to handle this. Other Mega devices are not supported as at today - since we have none to test with. If another comes along, it is easy enough to change it. At least for me :-)
In this directory are two tar files:
The following baud rates apply for different crystals
4MHz - 19200
8MHz - 38400
12MHz - 57600
This can be specified in the command line invocation of 'uisp'
if course changing the crystal may damage the programmer - your call, don't blame me