Go Down

Topic: High Voltage Fuse Reset on ATMega2560 (Read 8752 times) previous topic - next topic

bigal83

Hi, for a few months ago I set some fuses wrong and ended up with a ATMega2560 prototype board that was of no use. I knew from the beginning that it could be "saved" through HV programming but put it to the side because I had more boards to work with...It's now time to save this one.

I have had a read through this tutorials of how to do it:
http://www.societyofrobots.com/member_tutorials/node/239

and the original one that the above is based on:
http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/

The first questions I have is regarding using a ATMega2560 as a programmer instead of the smaller boards they use in the tutorials, do I use the same ports (PD,PC,PA..etc) as in the tutorial or the same arduino pins? Do I have to change the sketch?

Second question, what pins should I use on the bricked MCU for HV programming? Same ports (PA,PB,PC..etc) or different pins from the smaller MCUs?

Cheers!

Erdin

This explains a lot, http://www.gammon.com.au/forum/?id=11635

Are you sure you need HV programming ?
Can you read the fuses with avrdude ?
http://www.engbedded.com/fusecalc

For the MEGA, you need to use the MISO, MOSI, SCK pins.
Only the Reset pin is fixed to pin 10.

Uno:
MOSI = D11
MISO = D12
SCK = D13 

Mega:
MOSI = 51
MISO = 50
SCK = 52

bigal83


...
Are you sure you need HV programming ?
...

I'm pretty sure because I disabled ISP on the Mega, but do you have any suggestions besides HV programming the resets the fuses?

Cheers

Erdin

No, disabling the ISP disables the fuse access.
Some AVR chips can use the DebugWire interface that is also capable to get to the fuses. But the ATmega2560 doesn't have that.

I read that HV programming is not that hard to do for a standalone chip.
This has some information, http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.

bigal83


...
I read that HV programming is not that hard to do for a standalone chip.
This has some information, http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.
...


Yes, I've been reading that too as I wrote previously and the main question is how to hook it up on another MCU then the one he uses.

Is it still port B,D and C that is used to HV program my ATMega2560?

Cheers

retrolefty


No, disabling the ISP disables the fuse access.
Some AVR chips can use the DebugWire interface that is also capable to get to the fuses. But the ATmega2560 doesn't have that.

I read that HV programming is not that hard to do for a standalone chip.
This has some information, http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.



Yes, if it's a rev3 board there is a diode installed between the reset pin and +5vdc that would have to be removed before you could safely apply +12vdc to the reset pin.

Lefty

bigal83



...
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.


Yes, if it's a rev3 board there is a diode installed between the reset pin and +5vdc that would have to be removed before you could safely apply +12vdc to the reset pin.
Lefty


To clarify, I have a custom board that is "bricked". And I have a normal Arduino Mega to use for the HV programming..

I found the answer myself, different MCUs may use different pins for HV programming. The specifics can be found under the chapter "Memory Programming -> Parallel Programming Parameters, Pin Mapping, and Commands" in each MCU documentation.

And to make the setup simpler the HV sketch needs to me modified slightly.

Cheers

nickgammon

Try this first:

http://www.gammon.com.au/forum/?id=11633

If no response, you are going to need a high-voltage programmer. Might be cheaper to just replace the chip. However there are some HV kits around I think for around $40. The AVR Dragon is about $60 from memory.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Retroplayer

What about JTAG programming? The ATMega2560 supports that. And buying a JTAG programmer introduces you to the world of JTAG debugging as well.

That is unless you disabled that as well (it is enabled by default.)

CrossRoads

Be careful with JTAG  - Nick, didn't you run across JTAG being enabled would disable ICSP and prevent bootload installlation, something along those lines?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Retroplayer

I don't see how that would be possible when it is enabled from the factory and thousands of people use ICSP to program their brand new fresh chips.

Quote

Programming through the JTAG interface requires control of the four JTAG specific pins: TCK,
TMS, TDI, and TDO. Control of the reset and clock pins is not required.
To be able to use the JTAG interface, the JTAGEN Fuse must be programmed. The device is
default shipped with the fuse programmed.


I have never had a problem with it.

CrossRoads

I admit I could be a little mixed up in this area.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

nickgammon


Be careful with JTAG  - Nick, didn't you run across JTAG being enabled would disable ICSP and prevent bootload installlation, something along those lines?


Not bootloader installation, however with JTAG enabled certain output ports are overridden.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Retroplayer



Be careful with JTAG  - Nick, didn't you run across JTAG being enabled would disable ICSP and prevent bootload installlation, something along those lines?


Not bootloader installation, however with JTAG enabled certain output ports are overridden.


Actually, that is if OCD is enabled if I read the datasheet correctly. Then the JTAG pins are held exclusive to the debugger. But there is no issue with just enabled JTAG and using it for boundry scan or programming, erasing, etc... As I mentioned, it is set to enabled by the factory.

I know that you guys know what OCD is, but for the sake of the original poster and those that stumble on this thread... OCD is On Chip Debug which some AVRs support. It allows interactively stepping through the program, setting breakpoints, and getting the values of the registers and IO pins while code is running through AVRStudio. A bit tricky to fully understand, but a huge asset when developing and debugging your code/hardware. You need an ICE (In circuit Emulator) to make use of it.

I have an expensive one I purchased way back when, and a cheaper clone of the official JTAGICE from ATMEL that doubles as an AVRISP programmer.
http://www.atmel.com/tools/avrjtagicemkii.aspx

But, as mentioned, enabling OCD in the fuse settings will make the pins associated with JTAG unavailable for GPIO. It will also draw excessive current in sleep modes. So, don't leave it enabled in the final application. Only during debug. The mode can actually be set in software as well as through the fuses.

Go Up