Doubling up ICSP pins - recommendations?

Are there any recommendations or guidelines as to what you can attach to the pins shared with the ICSP interface - I'm currently working on a Tiny85 project that I would like to leave ICSP access to, but this obviously ties up most of the I/Os - I'm looking at using LEDs on most but may have a jumpered input on one pin.


Can you use SPI to control shift registers to send data out/drive LEDs? Daisy chain them with one other pin used for ssPin/latch. Then ICSP pins are still available as ICSP pins without being disturbed by the rest of your circuit.

Ideally I was going for the very minimum component count due to size limitations (I'm already using an SMD package which would make programming outside of the board impossible once assembled). I did wonder if driving the LED through a transistor rather than direct would prevent the programmer being affected though...

Driving LED, driving transistor, no difference to the programmer.
Don’t want an external component driving the pins while the programmer is driving it.

I probably wasn't clear enough in my goals - a typical programmed scenario would be each of the 5 I/Os on the '85 would be outputs connected to LEDs (with approprate resistor), however I assumed when the device is being programmed, having the LED still connected to the same pins as being used for the ISCP would cause problems, especially if the programmer could not provide the current to drive the LED too.

What I wasn't sure of was if all the '85 outputs were connected to transistors to switch the LED current, whether that would still be consided 'risky' for the programmer?

In the name of experimentation I tried it out - with LEDs direct, definite fail with programmer failing to detect the device. But with 85 driving LEDs trough uln2803 gates, I was able to program successfully.

I fully appreciate just because it appears to work doesn't mean it's not actually doing untold or undetected damage, which is what prompted the question in the first place.

But as I understand it with the 2803, I'm only ever connecting outputs to inputs (run time) and outputs & inputs to inputs (program time) but never outputs to outputs so it should be safe.

What are you using for a programmer?

TinyISP at the moment...

As in the TinyISP sketch with an Arduino board?

Or, as in USBtinyISP the dedicated programmer sold by AdaFruit?

Sorry - USBTinyISP...

I recently had trouble using a 330 ohm resistor and an LED in series with sck pin of the icsp header, that got fixed after i used a 1k resistor, here's some about icsp design considerations you might find useful.

oh and i was also using a USBtinyISP for programming.

Just what I was looking for! Thanks!

The USBtinyISP includes 1.5K series resistors which will limit the current when there is a wiring problem but will also create a voltage divider with things like an LED + resistor. If you use a programmer that does not include series resistors (or the resistors are a lower value), you will be able to have a wider variety of things connected to the ISP pins. For example, I routinely use an Uno as a programmer and have never had a problem with LEDs on the ISP pins.

You're very welcome, those links helped me a lot, also, as stated in one of the examples on the first link (see note) and just as used in the arduino uno rev 3. using a buffer allows you to really add more uses to your icsp pins like being able to read an input and still program your device. will do on my next arduino clone board revision. Have fun! 8)

I only buy LED's with 15 - 20 candela output and I've found that a 10K current limiting resistor provides enough light from the 20 candela LED's to be useful with normal room lighting. I build devices that are battery operated and low current is a requirement. I just plugged a green LED into a breadboard. Cathode grounded a 10K resistor from +5V (4.1Vdc measured) and measured 2.5V across the LED subtracting that from 4.1V = 1.6V divided by 10000 = 160 uA and provides a visible light that could be more visible and draw half the 160uA too if it was pulsed off and on at a 50% duty cycle. There is a small increase in price for the 5 mm high output LED's.. I buy the 5 color assortments and surprisingly the light output from batch to batch has been strangely uniform... An odditie when buying loose parts from China.. IMO