The most common way of programming AVR microcontrollers is the In System Programming port. That little six-pin header with MOSIs and MISOs coming out of it will program every AVR you’ll ever come across. The ISP does have a downside – fuses. Set your fuses wrong, and without a High Voltage Serial Programmer, your chip is bricked. [Dilshan] designed his own HVSP that’s less expensive than the Atmel STK500 and has a nice GUI app.
Instead of following in the footsteps of the USBtinyISP, [Dilshan] is using a PIC18F as the main microcontroller in the programmer. This chip was chosen because of its built-in USB functionality. Because the High Voltage part of a HVSP operates at 12V, actually providing that voltage needed to be taken into consideration. For this, [Dilshan] is using standard 78xx regulators with an 18V input.
The app to control this programmer does everything you would expect, including all the usual AVRdude commands. A great build, and just what we need to reset the fuses on a few dozen chips we have sitting around.
50 thoughts on “High Voltage AVR Programmer”
I think perhaps the concept of HVP and HVSP may be being conflated here. Most AVR chips use HVPP – with a large number of connections to the majority of the data pins. Only sparse-pin chips, such as the ATTinyx5, use HVSP.
Oh, I’ll also mention that it’s not too difficult to difficult to make a low-current 5V->12V boost converter for this application. The +12 volts isn’t a power supply for HVP, it’s more of a distinct signal to get the chip to change modes. Generating 10 mA @ 12V would require less than 50 mA @ 5V – not too terrible an added load.
The result is an HV programmer that would operate on just USB supplied power. What makes the concept difficult, however, is the wide variety of HVP wiring pinouts for the AVR chips. Plus, if you’re talking about SMD devices, you’d need to either make some sort of HVP header available on your board (and there is no standard pinout for that, so it would be necessarily proprietary), or you’d need to resort to “acupuncture programming.” For me, the path of least resistance has been to just swap out and throw away the controller.
That said, I suspect the incidence of bad fusing on SMD controllers is much lower. People tend to play with fusing more on the breadboard, and SMD controllers tend more to be in final designs, where programming-at-manufacture tends to be scripted so there’s much less opportunity for error.
HVPP needs an insane number of signal pins, one of which tends to be the clock input, so for any design which uses an external clock (which I suspect is the vast majority of SMD based designs), it’s near impossible to use HVPP in-circuit.
If I may tout my own project, for occasional high voltage programming, it seems to me it’s easiest to use an Arduino with ScratchMonkey: http://microtherion.github.io/ScratchMonkey/index.html
Not to uh… reject this project but uh… PIC?
At a professional level, I can see this as being a solution but at a hobbyist level? I know very few hobbyists who dabble with AVR also play with PIC (though the reverse seems to not be true). Practically if the 8-bit AVR isn’t going to do the trick most of those guys jump up to AVRs 32-bit line or like me move to ARM.
PIC isn’t bad, my very first AVR programmer is PIC based. I’m just wondering as to the practicality of this when it seems like the bulk of AVR (ie Arduino-land) people seem to have no interest in the PIC line.
To clarify, by “professional” I don’t mean major corporations churning out thousands of boards.
The PIC is one of your only choices if you want hardware USB support AND a DIP package…
It does result in a bit of chicken and egg problem.
Ah… I see the point now.
I don’t have a problem soldering SMD after years of trepidation. Except for the fact I keep losing the parts, I find them much easier to solder.
DIP parts can be shared between projects, so it’s easier to have a couple lying around and swap them quickly. The sockets are way cheaper than the chips.
I rarely share either AVR or PIC between projects so I don’t see the real benefit for me. If it was a concern, I would install a socket and use a socketable version.
Bought generic smd breakout boards and keep a few controllers and generic parts around, another useful tip is soldering the microcontrollers in over sized breakouts and use the excessive pins to solder a standard ICSP header
Yep, PIC blows away AVR as far as offering a variety of parts in DIP. Was one of the primary reasons I chose them to start learning MCUs, since I wanted to start from bare chips on an old-fashioned breadboard. I can solder a SMD package just fine, but still favor DIP due to the ease of moving parts to newer projects, upgrading MCUs when a project scope changes, or swapping them for troubleshooting. There’s always SMD-to-DIP adapters, but why bother when a part is available in native DIP? And for those who suggest I’m stuck in the past or have a “handicap” because I still prefer DIP, let’s try a MCU swap and see who finishes first. ;)
I am ditching AVR in favor of the SiLab Universal Bee line for USB. They are cheap enough (on par or cheaper than Microchip) that you don’t care about reusing them. Their “free” development environment seems to be nice enough and their debugger or eval board are $30 range.
It seems to be a good part is assuming that your soldering skill has kept up to QFP parts and not forever stuck in 1970’s obsoleted DIP world. Not everyone shares that handicap.
If you really need to breadboard, just make up a few breakout board with 0.1″ headers next time you order a set of PCB. Surfboard or other breakout board vendors probably have something for the package.
Is there no love for the MSP430 with USB? With the $12 launchpad, it makes prototyping and development cheap, quick and easy.
Someone who is familiar with AVR microcontrollers needs about a day to get familiar with PIC microcontrollers, and it works both ways. Good thing about PICs is you can get 18F2550 for about 2€, I’m not sure if you can get AVR with native USB 2.0 support for that money.
I tend to disagree, but maybe due to lack of knowledge… I do know to get an AVR running, alls I needs to do is grab a GCC package and a few others, no matter what OS I’m using… but what with PIC? Seems (to me) the *majority* of PIC solutions involve custom closed-source software, written only for Windows, that cost money… That’s more than a turn-off, it’s a huge hindrance turning a day of familiarization with register-conventions into days of setting up a dedicated computer, saving moolah for a dev-environment that only works with PICs, and more. Got no problem with them, otherwise, and agree that the peripheral (and other) options seem quite promising… Every few years I check whether there’s an open-source PIC path, maybe I just don’t know what to search for. (Note that “every few years”, when combined with a moolah-costing dev-package could very-well mean a new version of Windows to deal with, and a new dev-package to buy!)
At the *coding* level, I think you’re right about familiarization-time. The joys of C :)
The PIC32’s are somewhat appealing, being based on MIPS, maybe they’re GCC-compatible. OTOH, the learning-curve from an 8-bit MCU to a 32-bit *processor* with virtual-memory, etc… well, for me anyhow, that’s proven to be *significantly* more than a day’s familiarization.
(…not at all related to the HV-programmer. It is *kinda* funny that this is PIC-based. Props to the author (and others) for being well-versed in both!)
Exactly. The only reason I chose AVR over PIC is avr-gcc, because the PIC-hardware is clearly more diverse in DIP (and therefore easier to pick an IC to fulfill all of your project’s needs). Windows-only software is not an option for me, so it is really a no-brainer unless pic-gcc or similar starts to get more attention.
Or just ditch the AVR altogether and use the much better PIC18F or PICs in general. But I’m afraid you might have to learn some things, which I know is a sin to the AVR / Arduino generation.
If we were meant to learn PIC then the knowege of how to program an Arduino wouldn’t be written into the genes of all of mankind, accessible to us at birth. Clearly since we have to learn nothing to program an AVR using a PIC is a sin.
PIC18 ! Oh heck, why not just use a GPGPU then if you’re going to go for broke and use a huge amount of hardware?
A PIC12 with two-level deep stack should be enough for anyone.
640K of RAM should be enough for anyone too.
That should be enough for 10 or 20 people!
I wouldn’t say that PIC’s are better than AVR. I find PICs to be a bit more glitchy. That and MPLAB X and the XC8 compiler are infuriating sometimes.
That said, I use both PIC and AVR on a daily basis.
I started out on PICs, but ended up ditching them for AVRs due to the fact at avr-gcc is quite nice and the Linux-based toolchain is far superior to anything that can be found for free for PIC. I still have my K128 programmer though, just in case I go back. Oh, and I loved the 18F series with USB. It was just the lack of an open source compiler that got me to switch.
Oh, and I will respond to your flame bait: I have never nor will I ever use an Arduino, but I love AVRs. Don’t go mixing up the two and throwing them into two categories. I acknowledge many people who use Arduino know nothing of how the processor works underneath or what’s going on (they may never directly touch a register), but I am offended by the thought that just because I use AVRs that I am lumped into that category.
I’m the opposite. I started w/ Arduino, then thankfully got a job and started moving into other Atmel products and Freescale. Now I’m slowly inching into PIC, SiLabs, TI (beaglebone, so AM3359), RasPi, and some others just to try it. I personally like the older IDE’s (when you have it configured and a reasonable code base built up) compared to newer ones trying to do way too much and just annoying.
That being said, none of these platforms mentioned have made an easier bootloader and IDE to work w/ for beginners, so Arduino folks beat pretty much everyone at that. And I’ve replaced my “gaming” time w/ Arduino projects b/c it’s play time.
Is it weird to say I’ve been doing dang-near nothing but developing for AVRs for the past 10+ years, and have never used (or found a need for) a bootloader?
If you’ve got a programmer, no. If you haven’t, then yes. Direct USB support takes a hurdle out of the steps to programming Arduinos.
Thankfully I started with Atmel AVRs before Arduino was a thing so I actually have an STK500 laying around :D
The MAX662A generates +12V @ 30MA from +5 with a few caps.
And for the cost of one MAX662A chip you can get 3 complete step-up modules that can generate 5-35V from 3.3V or 5V source.
I have designed a similar HV parallel programmer but I’ve used an ATMEGA16 as the programmer chip with a serial connection to the PC and a Mono framework based GUI utility. Although it is working fine, I haven’t made a proper PCB for it so it looks ugly on a through hole prototyping board :-(
Wow, so much anti-Arduino hatred following an article that doesn’t even mention it. Are you folks so offended at entry-level gear that you can’t even tolerate the existence of it?
Only 2 posts mentioned the Arduino, and only one bashed it. That post didn’t even bash it that hard, the Arduino isn’t right for everyone. That’s why there are so many micros, and dev boards out there.
That’s the way it is, this thread is particularly well restrained on the bashing so far.
What’s interesting is that PIC had its time in the sun ala OOPic and I’m sure I remember the Motorola guys bashing it. At least the guys at my University certainly were bashing it while we set up our Quake and Duke Nukem 3D (insert joke here) gaming sessions.
I went from the 68HC11 (about four months before the board caught fire), wallowed in OOPic land for a while, moved to AVR then Arm and whatever. I hate the Arduino as well but as a platform, not the AVR itself. Just the same as I detest OOPic but not necessarily the PIC.
The whole cycle will repeat once Arduino is dethroned and something else moves in.
The old 68HC11 is probably one of the first that has a ROM bootloader that let you program the chip with TTL serial input and also a $68.11 (for University program) eval/development board. I made a board with SRAM, ROM, I/O pins and LCD header (wired to the 2MHz multiplex bus).
If i remember correctly from the time i used tinys and megas the only time you really need a high voltage is when you turned the reset pin into a regular pin. And for that, i believe there are quire a few “fuse doctors” around.
I did make some project with reset disable a while ago and it was a pain to work with. For hobby stuff, just upgrade to a larger micro to have enough pins.
In the older ones you would have to use a HVPP if you’ve programmed the clock fuses. I am not sure if this the case for the newer ones.
It’s also the case for the newer ones. If fused for a crystal or external clock, and it’s not there, it won’t program.
There is, however, a workaround. You can apply a square wave to one or other XTAL pin and get it to come up long enough to fuse it back to the internal oscillator.
As Bogdan said there’s a few fuse resetter projects you can build instead of a full HV programmer. Here’s one I like (haven’t accidentally set the reset disable fuse so its just for reference)
If I were to build it I’d add a pwm-based charge pump so it could be powered by 5v.
You wouldn’t need to use PWM – only need a square wave source. I used a Hex inverter e.g. 74HC04 to wire as an oscillator to drive charge 4-5 stages of charge pump. Given the those Vpp requirement usually like 10mA or so, just a Zener diode and a resistor can regulate the output without even needing CPU cycles to regulate.
PWM with a 50% duty cycle requires no CPU cycles. 2 stages with 1n4148s and 100nf caps gives right around 12v; no zener required.
This line-of-thought is appealing… I haven’t ever dared use the reset pin for anything else, despite needing that extra pin on a few occasions…
As an aside, it’s funny they’d rather have two(+!) separate protocols for programming, rather’n, say, using the same ISP protocol with two separate methods of toggling the RESET line. We’re talking, yahknow, like two or three transistors to detect whether the reset-disable fuse is active, then to use a 12V-reset signal with the standard ISP protocol instead of the usual 0V-reset signal… must be something to do with backwards-compatibility.
Don’t do it! Especially if you don’t intent to remove the IC for programming. Friend’s experience: I’ll use the reset as pin and the circuit connected to it will totally be ok with 12V on the reset line…. NOT.
Well, not so much “don’t do it” but realize the full ramifications of it if you intend to do it.
HVP in situ can be done, but it means insuring that the rest of the circuit both survives and does not interfere with the process. Still, it’s probably a lot more cost effective to, say, replace an ATTinyx5 with an ATTinyx4 if you need more pins.
A couple of 9V batteries in series is even easier, if you don’t need to do a lot of it.
For non-professionals I really recommend getting an AVR Dragon for about 50 bucks. Programmer and debugger for AVR and AVR32, interfaces including ISP, JTAG, PDI, debugWire aaand HVP / HVSP.
There’s actually a nice kit out there that does HV programming for AVR parts:
Surprised no one else has mentioned this.
I built one to reset some ATTINY parts I had bricked.
The kit went together easily. But then again, I love soldering :-)
LOL, that was a load of poop! The Arduino is AMAZING!
Please be kind and respectful to help make the comments section excellent. (Comment Policy)