Simple manual Atmega8 parallellprogrammer

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!
Like everybody else I've set the fusebits wrong and can't use ISP anymore. Since you only want to change those and, if the they are set, the lockbits, it might be possible to do with only 12v/5v and some switches. I guess some pull-ups would be fine too.
The datasheet for Atmega8 can be found at http://www.atmel.com/dyn/resourc... and parallellprogramming is explained on page 222.

I think the following can be used to factoryreset:
PAGEL and BS2 is always 0 (connected to gnd)
WR is active low (Connect to gnd for action)
XTAL1 is active high (Connect to +5v for action)
I think it is a good idea to use external pull-ups on all signals, but I'm no expert on those things. Suggestions?

Enter programming mode by setting prog_enable to 0b0000
Apply +5v to Vcc and +12v to RESET at the same time. This is the second method. It works even i f RSTDSBL is set and external chrystal/oscillator is slected.
Use some sort of switches to set the signals below in the specified order.

XA1 XA0 BS1 DATABITS7-0 Comment
1 0 0 10000000 ChipErase command
Pulse XTAL1 (+5v) Load command
Pulse WR (to gnd) Execute command
1 0 0 01000000 Fusebitwrite command
Pulse XTAL1 (+5v) Load command
0 1 0 11100001 Lowfusebyte data
Pulse XTAL1 (+5v) Load data
Pulse WR (to gnd) Execute command
0 1 1 11011001 Highfusebyte data
Pulse XTAL1 (+5v) Load data
Pulse WR (to gnd) Execute command

The command stays in memory until a new command is loaded, which saves us a instruction.

Fuses are not really written until the device leaves programming mode. So turn of the device and hopefully it is reset.

I'm still working on this and if I succed I'll post the schematic used and maybe a PCB-layout.
Suggestions are welcome!

Last Edited: Thu. Apr 22, 2004 - 07:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This time it worked!

For those of you that didn't figure it out for your self, here is the pin connections for the DIL28:

Pin Function What to connect
1 Reset +12V
7 VCC +5V
20 AVCC +5V
8 GND GND
22 AGND GND
13 PAGEL GND This is for programming enable, always 0 (in this case)
25 BS2 GND Not used, pull low
4 OE +5V We don't want to read data (Active low) I didn't pull this one high, but worked anyway. (Internal pullups?)

The following pins should be pulled-up to VCC via a resistor (about 470K) and also connected to GND via suitable switches. In my case I hadn't got enough switches so I just used loose cables on my breadboard. The thing to remember is that all inputs (switches) now work active low, except WR.
That means tahat when you want to issue a clock pulse, you have to disconnect the cable going from XTAL to GND. The resistor makes the rest.
If you want to execute WR you have to connect it to GND.

Clock pulse (load instruction)
9 XTAL1

Execute command
5 WR

Pins controlling command mode
12 XA1
11 XA0
6 BS1

Data pins 7:0
24 PC1
23 PC0
19 PB5
18 PB4
17 PB3
16 PB2
15 PB1
14 PB0

When you enter programming mode XA1, XA0 and BS1 have to be 0.

All this can be found in the datasheet, but I hope this will help someone...
Tell me if you can't get it to work.