Pin 13 led circuit conflicts?

Can anyone give me examples or explain how the LED on pin 13 can conflict or mess up a project using that pin?

What about a status led on a PWM pin what would or could be the loss or conflict?

I know I have seen problems talked about before but looking for pin 13 in search here is like looking up the word the on the internet.

Boz:
Can anyone give me examples or explain how the LED on pin 13 can conflict or mess up a project using that pin?

The main problem when using pin 13 for external circuit needs is if it is used as a input pin then the device or component driving the signal would have to be able to source enough current when trying to drive the signal HIGH to power the on-board pin 13 led/resistor. I think most designs use a 1k ohm resistor so there would be a 3-4 ma current source requirement for the signal.

What about a status led on a PWM pin what would or could be the loss or conflict?

As long as the pin is used in output mode the fact that the pin has a status resistor/led should not be a problem. As long as total pin current load is kept at around 20-30ma max there should be no problem. If the pin is used as a input pin then same concern as the pin 13 situation above.

I know I have seen problems talked about before but looking for pin 13 in search here is like looking up the word the on the internet.

?

Pin 13 has a 1K resister to an LED to ground in parallel with the shield connector; i.e. the signal does not go thru the LED/resister and then go out the connector.
If the pin is an output, the LED uses up about 3mA of the outputs drive capability.
If the pin is an input, then there is a 3mA load on whatever is driving the pin.
This should not be a problem for standard logic interfacing.

Same for PWM - an LED/resister in parallel with the shield connecter should not cause a problem.

retrolefty:
I know I have seen problems talked about before but looking for pin 13 in search here is like looking up the word the on the internet.

?

Thanks Again Lefty, I should probably just put you and few others like westfw, grumpy mike, on some kind of retainer so I can repay you for all the help you guys supply.

The search term "pin 13" in the arduino forum search returns so much signal to noise because pin 13 is more commonly talked about in posts than any other pin on the arduino, that it is practically useless to try to search for that term, GRIN.

This should not be a problem for standard logic interfacing.

No, it is a problem if interfacing to CD4000 series CMOS which can only drive about 0.5mA. 74HC series can just manage it (4mA).

Thanks Again Lefty, I should probably just put you and few others like westfw, grumpy mike, on some kind of retainer so I can repay you for all the help you guys supply.

Your welcome, and not a problem, just as I rely on Coding Badly, PaulS, and many others for software advice.

Lefty

0.5mA, I am not used to dealing with such wimpy parts.

Some of the more modern boards isolate the LED from the pin through the use of a MOSFET driver. So far, I haven't run into any problems with pin 13 on these boards.

The main problem when using pin 13 for external circuit needs is if it is used as a input pin then the device or component driving the signal would have to be able to source enough current when trying to drive the signal HIGH to power the on-board pin 13 led/resistor. I think most designs use a 1k ohm resistor so there would be a 3-4 ma current source requirement for the signal.

If you want to get a little more technical, noting that the forward voltage drop of a red LED is typically 1.7V, the current consumed by it will be equal to the minimum logic HIGH input voltage for the processor, e.g. 3V for 5V Vcc, minus 1.7V, divided by the series resistor value, typically 1K.

Vih(min) - Vf(typ) / 1000 = 1.3mA

So, if your driver can supply 3V @ 1.3mA you should be okay. This is at DC, of course. If you are driving the pin at any frequency above zero, things like the non-linear conductance and the impedance of the LED start to come into play. Easier just to avoid using pin 13, usually. :smiley:

Easier just to avoid using pin 13, usually.

That's our usual advice to newcomers, as well as avoiding using pins 0 and 1. The pin 13 thingee has a long and interesting history. Originally the pin 13 led design wired the shield connector pin 13 after a series resistor rather then directly to the avr chip pin, leading to tutorials showing connecting a led directly to shield pin 13 and ground. Of course that caused pin & LED damage to people using such tutorials with newer boards and confusion has continued ever sense. :smiley:

And it doesn't help the situation that pin 13 is the SCK signal used by the ICSP six pin connector.

Lefty

I have one of those early boards. :slight_smile:

And I think the tutorials are still wrong for later boards ...

And I think the tutorials are still wrong for later boards ...

Well, you know, arduino is Italian for "cast in stone"? XD

But still, Italy does make some kick ass luxury sports cars, Varoom-Varoom. :wink:

retrolefty:
But still, Italy does make some kick ass luxury sports cars, Varoom-Varoom. :wink:

Agreed!

Well as I told lefty, another discussion in a different section about possible shield ideas lead me to consider adding LED status circuits to each of the digital lines on my Cidekick project Shield to Breadboard Adapter - #3 by system - Other Hardware Development - Arduino Forum but I was trying to figure out how an isolation circuit would work for each pin or if it was even needed.

The idea was an LED shield that would show the status of each pin high or low and I was thinking RGB for the pwm pins rather than just fade.

The whole idea would only work if it it could be electronically transparent, meaning not affecting other circuits or uses to display the status and if it was low component count.

I would also only use it on outs and make it disconnect on pins being used as input.

Any thoughts, circuits, caveats?

Any thoughts, circuits, caveats?

A 2N7002 MOSFET, in common source configuration, works like the proverbial hose.

I would also only use it on outs and make it disconnect on pins being used as input.

Any thoughts, circuits, caveats?

Well that would take something very clever to accomplish. On reset all pins default to input pins, but after that the bootloader and then sketch code is what decides what mode the various I/O pins will become. How your shield will gain that knowledge is very problematic. And to expect a user to manual change jumpers or switch options on the shield prior to downloading their sketch doesn't sound very user friendly, and very susceptible to user error. I suspect you will have to have the shield led monitors always active, and the use of a FET isolation transistor on each pin is a good solution. That way the pin is always monitored regardless if being driven by the output pin or the external circuit driving the pin. A FET input pin will not effect the signal being monitored. However another challenge is that input pins by default are 'floating', so how will your pin monitor report that state where there is neither a valid low or high voltage being applied to the input pin? A pull-down resistor wired to each pin is probably the only logical option you can consider.

Lefty

Well as I told lefty, another discussion in a different section about possible shield ideas lead me to consider adding LED status circuits to each of the digital lines on my Cidekick project Shield to Breadboard Adapter - #3 by system - Other Hardware Development - Arduino Forum but I was trying to figure out how an isolation circuit would work for each pin or if it was even needed.

The idea was an LED shield that would show the status of each pin high or low and I was thinking RGB for the pwm pins rather than just fade.

The whole idea would only work if it it could be electronically transparent, meaning not affecting other circuits or uses to display the status and if it was low component count.

Yeah, its a nice idea - I thought about this and the best I could think of was using a cheap microcontroller with enough inputs (ATmega 168?) and a bargraph style LED array wired in Charlieplex style. So long as the update is fast enough the human eye won't notice... And having a micro controller means being able to do some of the functions of a logic analyser. You'd not do anything with the analog pins (and the 168's analog pins can be used as digital out to drive the charlieplex array.

The Arduino's digital pins only see one more CMOS input load, not going to affect function.

Couldn't think of a clever way to spot floating pins though, that would be useful...

Couldn't think of a clever way to spot floating pins though, that would be useful...

Well thinking about it some more I suspect a fet(s) input circuit could be designed and drive a tri-color led, led RED = high, GREEN = low, Yellow = floating.

Lefty

One problem I've encountered with the FET is that it appears to be an excellent low pass filter. If you are doing PWM on a pin with the circuit, The LED will remain off until the duty cycle is >50% at which point it will switch on. I couldn't tell if the brightness changed from 50-100%. Too subtle for my eyes. I didn't have a DVM or 'scope handy at the time so I never figured out what was going on. The low pass filter thing is just a theory.