Reseting fuses of Atmega8 using Arduino Mega 2560

Topics related to the HV Rescue Shield:
http://mightyohm.com/hvrescue2
Post Reply
Tossler
Posts: 3
Joined: Tue Nov 20, 2012 4:08 pm

Reseting fuses of Atmega8 using Arduino Mega 2560

Post by Tossler »

Hi,

I have had few attempts to reset fuses of Atmega8 with no success using Arduino Mega 2560.
I have build a HV shield using the schematic from 12/07/08, checked all the connections few times with the multimeter, everything seems fine. Since Arduino mega had pins 14+ i changed a bit of code to get is working, so now it reads like this:

Code: Select all

....
#define  XA1     A4    
#define  PAGEL   A5    
#define  RST     A0    
#define  BS2     A2
#define  XTAL1   A3

#define  BUTTON  A1   
I got the red led on, press the button, led turns off and on again after a while (as designed) and is suuposed to set fuses to default values :

Code: Select all

#define  HFUSE  0xD9
#define  LFUSE  0xE1
I am using a regulated voltage supply which shows current of like 7mA through the whole operation, I havend checked current form the Atmega itself. After connecting the avr to isp programmer it still refuses to program it :( I would be grateful for any help

User avatar
mightyohm
Site Admin
Posts: 1009
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Reseting fuses of Atmega8 using Arduino Mega 2560

Post by mightyohm »

Which version of the code are you using? Some of the earlier versions don't support the Mega.

Tossler
Posts: 3
Joined: Tue Nov 20, 2012 4:08 pm

Re: Reseting fuses of Atmega8 using Arduino Mega 2560

Post by Tossler »

I noticed that after i posted, updated to version 3/15/11 2.12 and my ouput looks like this

Code: Select all

¦elect mode:
1: ATmega (28-pin)
2: ATtiny2313
3: ATtiny (8-pin) / HVSP
Selected mode: ATMEGA
Insert target AVR and press button.

Existing fuse values:
LFUSE: 1
HFUSE: 1

Enter desired LFUSE hex value (ie. 0x62): E1
Enter desired HFUSE hex value (ie. 0xDF): D9
Burning fuses...
nothing happens afterwards


I have the MEGA define flag set to 1

Tossler
Posts: 3
Joined: Tue Nov 20, 2012 4:08 pm

Re: Reseting fuses of Atmega8 using Arduino Mega 2560

Post by Tossler »

ok, how silly of me. I have used the "old" schematic to build the device:
http://mightyohm.com/blog/wp-content/up ... _fixed.png

however, i managed to get it working, for reference, here's what you need to do in 2.12 version of SW:

1. Change the flag so the MEGA code will be used:

Code: Select all

#define  MEGA         1
2. Set the pins:

Code: Select all

#define  VCC     8
#define  RDY     12     
#define  OE      11
#define  WR      10
#define  BS1     9
#define  XA0     13
#define  XA1     A4    
#define  RST     A6   //I dont have step-up converter, i use regulated voltage supply so i changed it to pin i do not use (not a good practice!)
#define  XTAL1   A3
#define  BUTTON  A1    
3. Find the line that specifies pin for BS2 and cheange it:

Code: Select all

byte BS2 = A2;
proof:

Code: Select all

Melect mode:
1: ATmega (28-pin)
2: ATtiny2313
3: ATtiny (8-pin) / HVSP
Selected mode: ATMEGA
Insert target AVR and press button.

Existing fuse values:
LFUSE: F7
HFUSE: D9

Enter desired LFUSE hex value (ie. 0x62): E1
Enter desired HFUSE hex value (ie. 0xDF): D9
Burning fuses...

Read LFUSE: E1
Read HFUSE: D9
Burn complete.

It is now safe to remove the target AVR.
Violla ! :)

User avatar
mightyohm
Site Admin
Posts: 1009
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Reseting fuses of Atmega8 using Arduino Mega 2560

Post by mightyohm »

Looks like you figured this out, before I had a chance to reply! Yes, the hardware has changed over time and the newer versions of the software won't work with the original schematic. Thanks for posting the fix, I'm sure this will be helpful for others wanting to scratch-build the hardware!

Post Reply