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.
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?
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, Arduino-based AVR High Voltage Programmer | MightyOhm
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.
Erdin:
...
I read that HV programming is not that hard to do for a standalone chip.
This has some information, Arduino-based AVR High Voltage Programmer | MightyOhm
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?
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, Arduino-based AVR High Voltage Programmer | MightyOhm 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.
Erdin:
... 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.
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.
Be careful with JTAG - Nick, didn't you run across JTAG being enabled would disable ICSP and prevent bootload installlation, something along those lines?
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.
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.
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?
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.
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.