Arduino Forum

Using Arduino => Microcontrollers => Topic started by: davivid on Dec 04, 2012, 11:59 am

Title: LED's on the ICSP pins
Post by: davivid on Dec 04, 2012, 11:59 am
How do I give the ICSP Pins a dual use? After programming the MCU, I would like to re purpose these Pins for some SMD LED indicators. Is it just a case of finding a high enough resistor, which also allows enough current to LED's for sufficient brightness? Any recommendations?
Title: Re: LED's on the ICSP pins
Post by: Riva on Dec 04, 2012, 12:18 pm
Assuming your using an UNO then the ICSP header pins are already shared with digital pins (11-13) and are not extra pins.
Title: Re: LED's on the ICSP pins
Post by: davivid on Dec 04, 2012, 12:44 pm
Nope I'm using my own board design and so when using the ICSP header, these pins need to have low impedance load other wise the programmer will fail. I'm after some advice as to what constitutes a low impedance load in this case.
Title: Re: LED's on the ICSP pins
Post by: perhof on Dec 04, 2012, 02:11 pm
You can use the same method as with the led on pin 13 on official boards. Put an opamp between the output and the LED.
Title: Re: LED's on the ICSP pins
Post by: davivid on Dec 04, 2012, 04:55 pm
Brilliant didn't think of looking up the schematic for that. So in that case I will use LMV358's and a 1K series resistor with an LED on Pins 11, 12, 13. And that will still enable me to program it using ICSP right?
http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf (http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf)
Title: Re: LED's on the ICSP pins
Post by: retrolefty on Dec 04, 2012, 05:10 pm

Nope I'm using my own board design and so when using the ICSP header, these pins need to have low impedance load other wise the programmer will fail. I'm after some advice as to what constitutes a low impedance load in this case.


I think you mean any loads wired to the pins need to be high impedance (consume less current) so as to not increase the current driving requirement that the programmer has to supply to the ICSP pins. Yes op amps can isolate the led current load from the pins, but so can a cheap mosfet transistor like a 2N7000 which is cheaper and takes up less space.  Of course you still need a series current limiting resistor for any leds no matter what is driving them directly.

Lefty

Title: Re: LED's on the ICSP pins
Post by: perhof on Dec 04, 2012, 06:37 pm

Brilliant didn't think of looking up the schematic for that. So in that case I will use LMV358's and a 1K series resistor with an LED on Pins 11, 12, 13. And that will still enable me to program it using ICSP right?
http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf (http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf)



If you are going to use three LEDs you will need three op amps.
One 324 (quad op amp) might be better than two 358's (dual op amp).

Or you could follow Lefty's advice and use three mosfets like the small 2N7000.
Title: Re: LED's on the ICSP pins
Post by: Coding Badly on Dec 04, 2012, 07:40 pm

I frequently have LEDs + current limiting resistors connected to ISP pins.  The current consumption is a bit south of 16 ma.

Commercial programmers (like the Pololu AVR Programmer) sometimes have series resistors on the ISP lines.  I guess the series resistors plus an LED and resistor may cause problems (it has never caused problems for me).

A piezoelectric buzzer has caused problems for me (Teensy was the programmer).  Adding a small value resistor (22 ohms) eliminated the problem.
Title: Re: LED's on the ICSP pins
Post by: perhof on Dec 04, 2012, 07:46 pm
I have had problems from time to time but it usually works ok with just a 1k series resistor.
Title: Re: LED's on the ICSP pins
Post by: fungus on Dec 05, 2012, 08:54 pm
Anything with a high impedance should be OK to connect to the SPI bus and the bus will still work. A LED with limiting resistor should be OK. The easiest way to find out for sure is to just try it.

Title: Re: LED's on the ICSP pins
Post by: dc42 on Dec 07, 2012, 12:35 am
To ensure that you can program via ICSP, it's best to use the SPI pins either as outputs driving high resistance loads (e.g. LCD displays), or as inputs for connecting normally-open push buttons.