Why are some IC's programmable while still connected in a system/circuit, but others aren't? What's the determining factor(s) for whether a chip can or cannot?

This question stems from my research on ICSP headers, and particularly, a statement made that "In most cases the MCU doesn’t even need to be removed from its circuit first [in order to be programmed via an ICSP header]."


Edit: This is in relation to AVR ISP/ISCP.

  • \$\begingroup\$ I never had to remove the MCU from the system when programming via ICSP or through Tx/Rx pins; I personally haven't practiced removing the MCU from system prior to programming. \$\endgroup\$ – Nick Williams Jul 24 '13 at 23:30
  • \$\begingroup\$ Well, if you connect the RX pin to ground, for instance, it is going to be hard to program it in-circuit. \$\endgroup\$ – hoosierEE Jul 24 '13 at 23:55

Depends on the circuit. If the ISP pins are not broken out or accessible, you will need to remove the chip. If the ISP pins, essentially SPI, are being used for something that will mess with the programming, the chip has to be removed. If the ISP pins are being used as GPIO and tied high or low, that could mess with the programming.

If you somehow messed up a circuit and tied a ISP pin to vcc/ground, that would certainly require the chip to be removed.

If you mess up a fuse where the low voltage ISP is not able to fix it, you have to resort to the High Voltage programming mode, which at 12v, could kill some circuits, you would want to remove the chip.

ISP requires that the target AVR chip be running atleast 4 times faster than the ISP clock. If it is not, ISP is not able to be used.

  • \$\begingroup\$ In the PIC datasheets it suggests using a resistor , 10k?, then the ISP can "over power" the resistor. \$\endgroup\$ – Spoon Jul 25 '13 at 11:24
  • \$\begingroup\$ @Spoon, a series or pull up/down resistor, but direct connections to vcc or gnd can't be overwritten. \$\endgroup\$ – Passerby Jul 25 '13 at 18:10
  • \$\begingroup\$ Yes that was what I intended to say.. but messed up. \$\endgroup\$ – Spoon Jul 25 '13 at 19:55

Some chips use voltages outside of normal operating parameters for programming, either because the programming circuitry needs higher voltages than normal operation, or because such a design will avoid the possibility of having a part accidentally entering programming mode during operation. Such a design may make in-circuit programming difficult.

Some chips require the use of many pins for programming. To program an 18-pin PIC 16C54, for example, requires use of VDD and VSS (obviously), MCLR to engage programming mode (drive to 12 volts), all 12 I/O pins to input data, the RTCC pin to act as a read/write strobe, the clock input to advance addresses. The only pin not used for programming is the clock output. Programming such a device in-circuit would generally require disconnecting so many of its pins from other functions that it generally wouldn't be worth the effort.

At minimum, having a device support in-circuit programming generally requires at minimum that it include some way of isolating any internal programmable memory from whatever circuitry would normally try to use it. This need not be overly complicated, but may be difficult in devices which are trying to be as fast as possible during normal operation. In something like the PICC 16C54, the code store didn't need any special addressing circuitry for programming; instead, when MCLR was raised to 12 volts, that effectively forced the processor to execute NOP instructions, and so its program counter could be used to supply addresses. A switchable bidirectional path needed to be added between the I/O pins and the code-store data wires, but that wouldn't have to disable the normal paths taken by those signals (since the I/O pins default to floating, and the "force NOP" behavior (also used by skip instructions) meant that any code arriving at the instruction latch would be ignored. Allowing in-circuit programming would require that programming mode affect the functionality of more circuitry.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.