High-voltage programming for AVR chips

I gather that my code for uploading bootloaders to chips, without having to use avrdude, is quite popular.

I have now modified three of the sketches in that suite to support both serial and parallel high-voltage programming. Details here:

Using a fairly large number of connecting wires you can use your Uno as a high-voltage programmer:

Extra hardware needed is a 12V supply, and a couple of extra components, to let the Arduino switch on or off the 12V when required. This is described in the post.

Great, good to know where to find.
It is more complicated way of programming but via high-voltage should be possible to program the MCU even if is locked out.
+1

Wow, Nick...

Kind-of looks like an electric chair for an AVR :o

Great concept... last time I needed an HV programmer, I tossed the offending 328P-PU into the round file. Thinking about it all now, maybe I should have tossed it into the county recycle bin?

Ray

If I'm reading the datasheet correctly (for the m328p) parallel requires manipulating the XTAL pins. Is that correct?

maybe I should have tossed it into the county recycle bin?

Send them to Aussie land from now on.

Nice work again Nick!
I think I like the serial version, looks a lot cleaner :slight_smile:

Certain operations require that XTAL1 be pulsed, yes.

CrossRoads:
I think I like the serial version, looks a lot cleaner :slight_smile:

Yes, but only some chips support it. Namely the smaller ones (I'm guessing, those with less than 28 pins).

High voltage serial programming may be of significant interest what with all the tiny85-based things that are appearing (Gemma, trinket, digispark, etc.) (these typically disable RESET to get the extra pin.)

Think you could put together an arduino nano, a charge-pump circuit (like https://sites.google.com/site/wayneholder/12-volt-charge-pump, except I think you should be able to drive it with timers directly), and some ISP software?
Ideally, an USBASP (USBasp - USB programmer for Atmel AVR controllers - fischl.de) clone using VUSB on an ATmega8 would be cool, but I'm not sure that an ATmega8 circuit is enough cheaper than a Nano clone to justify the extra work.

I'm tempted by the charge-pump circuit, but after all, how much is a cheap 12V power supply?

I agree that if you could easily reprogram, you have just freed up the reset pin on your chip, which would be nice.

Does your code use HVP to just program the fuses and then drops back to normal ICSP for the flash memory or are you programming the entire chip with HVP?
How much slower is HVP compared to ICSP?

It does everything that the ICSP does. You can upload code, verify it, and so on. It would be a pain to have to move the wires around once you changed the fuses.

The speed is comparable, especially as I didn't make any real attempt to do it efficiently. A couple of seconds to install a bootloader.

There are other signals too, like /WR to write something (eg. a fuse), /OE to read from the chip, and PAGEL to lock data into the page buffer.

westfw:
High voltage serial programming may be of significant interest what with all the tiny85-based things that are appearing (Gemma, trinket, digispark, etc.) (these typically disable RESET to get the extra pin.)
<...>

Trinket does not... but you are correct about the Digispark. Never worked with a Gemma, but thought it was essentially a Trinket.

Trinket Clone: Chachka

Trinket ==> Digispark

Ray

I think I installed the Digispark code onto an ATtiny85. I did not disable the reset pin. It wasn't required just to make it work.

Yeah; it looks like Gemma doesn't disable reset either.

Probably because there are no conveniently available HV Serial programmers! :slight_smile:

Only required if you want the 3rd PMW output.

Ray

3rd?

HVP must be intended for "high speed" uploading and verification for new processors that have not yet been installed.

Quite possibly. I made no attempts to use it efficiently, after all it would take a lot more time to install the chip into the programmer than the couple of seconds to do the programming. Also you program the flash in words, not bytes, which would have required reworking elsewhere. But if you follow their guidelines for efficiency (and use port manipulation etc.) you could probably flash a new chip in half a second or so.

Wow, I never thought of that. So are you saying if I screw up the fuses on an SMD based Arduino (SMD UNO, Pro Mini, Nano, Leonardo et al., etc...) that I may be really screwed?!?!

Is it just that most boards don't give access to the XTAL pins, or would the signal not work if a crystal or resonator were installed.

I was thinking that I could mess around with fuses and just make a HVPP programmer to clean up my victims mistakes. I may have to rethink that.