===========================================================================

gAVR is software to program Atmels AVR microcontrollers in circuit.
It was developed to make programming of these controllers from Linux
possible. 

Copyright (C) 2004 Peter van den Bosch
 
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Author:
	Peter van den Bosch
	pvdb@dse.nl
	www.dse.nl/~pvdb

===========================================================================


=================
HARDWARE SPECIFIC
=================

 See below for the simple electronic circuit needed to download FLASH and
 EEPROM data to an AVR serially. You need to connect it to the parallel
 port of your PC. The file avr-isp.h contains the io-address and pin
 definitions. If you choose to order the pins differently adjust the
 corresponding values in the headerfile. If you want to connect to another
 parallel port than LPT1, adjust LPT_BASE accordingly. Standard values for
 PC's are:

	 LPT1		0x378
	 LPT2		0x278


=======
INSTALL
=======

 See INSTALL file.
 
 By default, gavr compiles the GTK GUI, if you want a command line tool, edit
 the Makefile or avr-isp.h, by undefining the GUI variable.
 

===============
RUNNING AVR_ISP
===============

 gAVR supports for both EEPROM and FLASH memory programming, both should
 be provided by Intel HEX formatted files. To produce such files with the
 ava assembler, type

	 ava program.s
	 ava program.o -o program --intel

 This will create 'program.flash' and 'program.eeprom', the first one 
 containing flash memory and the second one EEPROM data (if available). To
 program both into the AVR connect the adapter (see below) to your parallel
 port and start gAVR with root privileges

	 sudo gavr


================
HARDWARE ADAPTER
================

 You will need a connection between your PC and the AVR you want
 to program. You connect the AVR to the parallel port using the
 following scheme:
	                             _______
 P     D0 (pin 2)     ------|150_Ohm|-------   SCK      
 a                           _______	               A
 r p   D1 (pin 3)     ------|150_Ohm|-------   MOSI
 a o                         _______           _____
 l r   D2 (pin 4)     ------|150_Ohm|-------   RESET    V
 l t                         _______
 e   BUSY (pin 12)    ------|150_Ohm|-------   MISO
 l                                                      R
	  GND (pin 25)    ----------------------   GND

 Also the AVR should be connected to a a powersupply and a crystal
 must be installed. Do not forget to add an resistor (+/- 10 kOhm)
 between the reset of the AVR and ground, this will start the program
 as soon as the PC releases the reset.

 Since a while, the "Dontronics" layout is also supported, set the correct
 programmer in avr-isp.h. The layout of this one is:
 
 
 P       D1 (pin 3)    ----------------------  _RESET_
 a
 r P     D2 (pin 4)    ----------------------  SCK           A
 a o
 l r     D3 (pin 5)    ----------------------  MOSI          V
 l t
 e      ACK (pin 10)   -------| 1kOhm |------  MISO          R
 l  
        GND (pin 25)   ----------------------  GND
