Nav:  [home][elec][pdev][avr][parport] > [parallel]
Go:  [index] [parallel] [serial] [supply circuit] [software]

Electronics -- Atmel/AVR-programming

Please note that I am now using the USB-based download cable. Content on this page is no longer maintained/developed. However, the presented solution is cheap, easy to build and still working nicely.

Parallel downloading circuit

Photo of first working Atmel programmer [7kb]
[click to enlarge: 178kb]

If you already have a Latch16Bit board and just want to get on with it, have a look at the "quick hack" circuit which uses very few additional parts: All you need is a CD40106 (hex Schmitt trigger, but trivially replaceable by a CD4011 (quad NAND) or similar), two resistors, a diode and some cable as well as a socket for the microcontroller, of course.
On the left you can see my first working (parallel) Atmel programmer which is basically the just mentioned circuit.

Note however, that I recommend a somewhat more advanced circuit for power supply and reset logic instead of then above quick solution. Unlike the quick circuit above which reqiures two stabilized voltage sources for it to work (5V and 12V), this one just needs 12V.

Parallel downloading software

Now, if you have build the circuit and connected to to the Latch16Bit board at the PC's parallel (line printer) port, you can access the the microcontroller's Flash and EEPROM using Atmelprg, a piece of software developed by me and available at no warranty under the GNU GPL.

Note: After downloading the source code, you need to manually configure the code before compiling it:
You may need to set some delays for port access using CONTROL_OUTPORT_DELAY and DATA_OUTPORT_DELAY in lpportio.h because fast computers may be too fast for the port, especially if the control port works in pull-only mode with a pull-up resistor to +5V. For my P1 with 100MHz, I need no data port delay but a 35 iteration for() loop for the control port. Expect much more for faster PCs. If in doubt, use large values or check using a DSO.
Next, look up your PC's parallel port base address and assign a proper value to parport_baseaddr in

After configuring and compiling Atmelprg, you can start writing and reading the microcontroller's Flash and EEPROM using e.g.

atmelprg -load firmware.bin -erase -writeflash firmware.bin

Programming the EEPROM works similar using -writeeeprom.
In order to see if everything worked fine, you can read the flash content and compare it to the downloaded file:

atmelprg -load firmware.bin -readflash -compare firmware.bin flash

For a more detailed description on atmelprg, see the the software page.

[home] [site map] [Impressum] [Datenschutz/privacy policy]
Valid HTML 4.01!
Copyright © 2003-2007 by Wolfgang Wieser
Last modified: 2007-06-09 20:11:40