LoadAVR - program AVR microcontrollers

This is the manual page for LoadAVR version 0.01.

Please also see the project page at SourceForge Logo


NAME

LoadAVR - Program AVR microcontrollers.


SYNOPSIS

loadavr [-ehms] [-pfPF file]


DESCRIPTION

LoadAVR programs the AVR series of microcontrollers using the serial SPI bus. (which is just about all of them) Including support for reading the program/flash, eeprom, signature bytes and lock bits, and writing to the program/flash, eeprom and lock bits. The fuse bits are not accessible using the serial interface.

If the file named is ``-'', I/O is diverted to STDIN or STDOUT as appropriate. All user messages are printed on STDERR. This facilitates flexible use of LoadAVR in pipes etc.

LoadAVR will only program the flash up to the end of your input file and leave the rest as blanks, this saves time as the flash is erased beforehand anyway. The eeprom however will be filled with 0xff after the input file ends to eliminate any old data, as the eeprom may not have been erased before programing. This is generally claimed to be a feature.

Due to the access to the hardware required LoadAVR must be run as root (though not if you only want the help). I do not recommend making LoadAVR setUID root as this would be a security hazard. However if the machine is not networked, it would be handy.


OPTIONS

-e
Erase flash and eeprom memory arrays.

-s
Retrieve and display the signature bytes only.

-f file
Read from file (or STDIN) and write to flash memory. Of necessity erases chip before writing.

-F file
Read from flash memory and write to file (or STDOUT).

-p file
Read from file (or STDIN) and write to eeprom.

-P file
Read from eeprom and write to file (or STDOUT).

-h
Print a brief help message and exit.

-m
Print the manual page and exit.


EXAMPLES

loadavr -f program.file
Takes the file and writes it to the flash. All writes to the flash include a automatic erase of the entire chip, this is necessary.

loadavr -p -
Accepts input on STDIN up to the end of file character (Ctrl-D) and writes it to the eeprom. Handy to write directly from console to eeprom. Ofcorse you are limited to ASCII with the console and this trick would not be of much use with the flash.


HARDWARE

LoadAVR can program any AVR micro using the SPI bus, ie just about all of them. Including the 8 pin, 20 pin, 28 pin and the 40 pin flavors. Please look in the config section for more info. LoadAVR uses 4 pins plus ground pins on the standard PC parallel port. By default these are:

 SPI bus names  Description                     Parallel port
 !RESET         chip reset pin                  pin 4
 SCK            serial clock in                 pin 5
 MISO           data out (from avr)             pin 11
 MOSI           data in (to avr)                pin 2
 GND            0 volts                         pins 18-25
 VCC            +5 volts (optional)             pin 6 perhaps?

The parallel port pins can be easily changed to suit your hardware in the configuration box. Be careful when allocating pins though, some parallel port pins are only input or only output, eg if you try to assert a value on a pin that is only input, absolutely nothing will happen. If you are trying to match a bought or kit programing board documented pinouts, you should be right.

The default settings suit the DT006 programing board from www.dontronics.com.au.

WARNING you can damage your parallel port easily with any home made electronics so if you don't know for absolutely certain, you should buy a programmer or kit.


CONFIG

The first part of the loadavr file contains the config box. Each part is well documented just above the relevant statement. You should make a backup of the file before changing it, else if you stuff it you will have to download it again. Things that can be changed include:

AVR processor speed
The SPI bus is driven at 1/4 this speed and you could also set it really low to perform debugging. The default setting is 4 MHz, to enable people with 4, 8, and 10 MHz chips to start right away, you should adjust this to suit your chip speed and avoid unnecessary waiting.

Parallel port pinouts
You can set the relationship between SPI bus names and actual port pins. Just because it's easy to do don't think you should muck around with this unless you know what you are doing. Backups are essential. Pinouts for the SPI bus on the AVR should be obtained from the datasheet for the actual chip you wish to program.

Parallel Port
You have the choice of LPT1 or LPT2, LPT1 is the default setting.


FILES

loadavr
The main executable, can be placed in HOMEDIR/bin, or more often in /usr/local/bin.

parapin.pm, parapin.so
The parapin perl module and the object file to match. They can be placed anywhere in your @INC, but will normally reside in /usr/lib/perl5/5.6.0/. You should modify this path for your version of perl.


VERSION

LoadAVR version .01 released 11th of July 2001.


FEEDBACK

Please go to http://sourceforge.net/projects/loadavr/ to report bugs and/or request features. Please let me know when it goes well too. :)


AUTHOR

Nathan Dunn <digrizrat@sourceforge.net>.