Electronic – AVR ISP – SCK pin shared with LED

isp

I made a board with an AVR Attiny MCU and an ISP connection. I missed that I made the SCK pin an output for an LED. Luckily, this arrangement seems to work; I can program the chip just fine. But, during programming the SCK signal from the programmer is driving the LED on. Is this ok in principle or did I just get lucky that it works?

Please see the attached schematic which shows basically how my board is connected during programming. Assuming the following- the SCK pin (PB2) must be used as the LED output pin, the value of R1 cannot be increased, and the programmer will never be connected while the SCK pin is driving the LED- what could I have done to the circuit to improve the situation?

ISP SCK Line Shared With LED

Best Answer

what could I have done to the circuit to improve the situation?

Most Arduinos have a LED on Arduino header pin 13 - the SCK pin.

Some random ideas in no particular order:

  • have a jumper or even a switch that isolates the LED.
  • use an ultrabright LED with a higher valued resistor?
  • provide a socket for the ATtiny and do programming off-board.
  • use a FET to buffer the LED (high impedance input).