Electronic – How to plan for in circuit programming of an AVR

avrisp

My usual method of reprogramming AVRs (so-far limited to ATtiny13 and ATtiny2313) is to disconnect the chip from the host circuit, plug it into another breadboard with all of the ICSP hookups in place, program, then replace. However, I keep hearing that one can program the chip in place (which is, I understand, the whole point of ICSP).

Are there any special hardware considerations one has to take into account before programming the chip in situ? For instance, I worry that the ICSP process may damage circuit components connected to the same AVR pins which are used for ICSP. Does one occasionally need to add diodes or some other kind of buffering to protect these components?

I know this question sounds kind of vague, and I guess it is – but I've not provided details of my particular circuit because I'm interested in more general rules of thumb. I.e. does one never have to worry about this, or does the answer really depend on the particular circuit the MCU is a part of?

Best Answer

I've used ISP for just about every AVR board I've done; it's nothing to be afraid of. The AVR ISP mkII manual gives a pretty good summary of the limitations you need to look out for in the "Target Interface" section. Basically, if you run the MISO/MOSI/SCK pins directly to the programmer and have about 820 ohms between them and the rest of the circuit (and aren't doing anything funky with the reset pin) you're okay. I wouldn't worry about the ISP damaging other components; it's not a high voltage programmer. The signals all run at 5V, so if it can damage an external component, so can your microcontroller.

If you're really stuck with a board that doesn't permit ISP programming, I'd at least try to use a ZIF socket for your programming board. They're pricey, but it will greatly improve your quality of life.