Go Down

Topic: High-voltage programming for AVR chips (Read 5236 times) previous topic - next topic

nickgammon

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

http://www.gammon.com.au/bootloader


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

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

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.
Please post technical questions on the forum, not by personal message. Thanks!

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

Budvar10

#1
May 27, 2015, 07:29 am Last Edit: May 27, 2015, 07:30 am by Budvar10
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
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

mrburnette

#2
May 28, 2015, 02:53 am Last Edit: May 28, 2015, 02:54 am by mrburnette
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

Coding Badly


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



larryd

Quote
maybe I should have tossed it into the county recycle bin?
Send them to Aussie land from now on.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

CrossRoads

Nice work again Nick!
I think I like the serial version, looks a lot cleaner :)
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

If I'm reading the datasheet correctly (for the m328p) parallel requires manipulating the XTAL pins.  Is that correct?
Certain operations require that XTAL1 be pulsed, yes.

I think I like the serial version, looks a lot cleaner :)
Yes, but only some chips support it. Namely the smaller ones (I'm guessing, those with less than 28 pins).
Please post technical questions on the forum, not by personal message. Thanks!

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

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.)

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 (http://www.fischl.de/usbasp/) 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.

nickgammon

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.
Please post technical questions on the forum, not by personal message. Thanks!

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

Riva

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?
Don't PM me for help as I will ignore it.

nickgammon

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.
Please post technical questions on the forum, not by personal message. Thanks!

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

nickgammon

If I'm reading the datasheet correctly (for the m328p) parallel requires manipulating the XTAL pins.  Is that correct?
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.
Please post technical questions on the forum, not by personal message. Thanks!

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

mrburnette

#12
May 29, 2015, 12:42 am Last Edit: May 29, 2015, 12:45 am by mrburnette
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

nickgammon

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.
Please post technical questions on the forum, not by personal message. Thanks!

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

westfw

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

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

Go Up