I'd done the analysis on an LED I purchased off of ebay for a customer job. Here is its graph of mA vs V for the red, green and blue segments.
The graph also has load lines for series resistors of 30Ω, 130Ω and 250Ω. The 30Ω resistance is taken to represent the 30Ω output resistance of the Propeller pin. (or maybe it should be 40Ω? as Invent-O-Doc said). Does everyone know how to solve a load line? You look for the intersection of the resistor line with the diode characteristic. So, if you have leds connected to a Prop output with no external resistors, only the intrinsic 30Ω pin resistance, then the operating point for red comes out at a little over 30mA, and the green and blue are both at about 9mA. If on the other hand, you add a 100Ω external resistor in series with each color, the operating point for red moves to 9mA, and blue and green are at 3mA and 2.5mA. These particular ebay LEDs were advertised as high intensity, and on paper 10x brighter for a given current than the one from the Radio Shack kit. All of these colors were first perceptible in average room illumination at a mere 5 microamps of current. At 1mA they were plenty bright for indoors in the intended project, even with PWM, running directly from 3.3V Prop pins with external resistors.
Here is something I am finding VERY odd. Using my Prop BOE and the below listed code which is suppose to loop indefinitely, after 22 seconds (give or take one) the light stops blinking. I tried using the SimpleIDE blink.c program and I have also tried using SPIN with the same results. This happens on both of my Prop BOE boards and on my Prop Demo board. Any idea why and how could I keep an LED blinking indefinitely?
/*Blink Light.c
Blink light circuit connected to P26.
[URL]http://learn.parallax.com/propeller-c-simple-circuits/blink-light[/URL]
*/
#include "simpletools.h" // Include simpletools
int main() // main function
{
while(1) // Endless loop
{
low(0); // Set P26 I/O pin high
pause(100); // Wait 1/10 second
high(0); // Set P26 I/O pin low
pause(100); // Wait another 1/10 second
}
}
Code in post #31 does the same thing. I am using a wall wart, not battery. I have tried 3 different ones. Also, it does this using SPIN and SimpleIDE C. I am going to swap out USB cable and if that does the same thing I will try a different computer. I doubt either of those are the issue but this really has me stumped.
Would sending the program to RAM instead of EEPROM have anything to do with it?
Would sending the program to RAM instead of EEPROM have anything to do with it?
It shouldn't but if you put it EEPROM, it will reload if there's a reset or brownout. At least try loading it to EEPROM to see if it makes a difference. If this is a PropBOE, you can power it directly from USB. Give that a try.
So apparently even red LEDs are are safe to use without a resistor? I learned something new.
Thanks Invent-O-Doc and Tracy.
Duane,
Safe, maybe, but I don't don't want to be sorry for suggesting it. I don't feel comfortable with a pin sourcing or sinking 30mA, especially if multiple pins have to do so. Well, maybe as a hack. With that current, the transistor or driver is the safe way to go. Also, at 30mA continuous, the red led would be glowing like crazy and getting hot.
With direct connection, I'd prefer a resistor with the LEDs to limit each current to 10mA or less, and, as suggested above, to balance the color values.
So apparently even red LEDs are are safe to use without a resistor?
Keep in mind that 30 ohms output resistance on a Propeller pin is not the same thing as current limiting. It looks like it would be okay with LEDs that have a fairly high voltage drop, but if you just short the pin to ground the current will be "limited" to 110 mA, which is way over the recommended allowable maximum.
Comments
The graph also has load lines for series resistors of 30Ω, 130Ω and 250Ω. The 30Ω resistance is taken to represent the 30Ω output resistance of the Propeller pin. (or maybe it should be 40Ω? as Invent-O-Doc said). Does everyone know how to solve a load line? You look for the intersection of the resistor line with the diode characteristic. So, if you have leds connected to a Prop output with no external resistors, only the intrinsic 30Ω pin resistance, then the operating point for red comes out at a little over 30mA, and the green and blue are both at about 9mA. If on the other hand, you add a 100Ω external resistor in series with each color, the operating point for red moves to 9mA, and blue and green are at 3mA and 2.5mA. These particular ebay LEDs were advertised as high intensity, and on paper 10x brighter for a given current than the one from the Radio Shack kit. All of these colors were first perceptible in average room illumination at a mere 5 microamps of current. At 1mA they were plenty bright for indoors in the intended project, even with PWM, running directly from 3.3V Prop pins with external resistors.
You tried the code in post #31?
If that didn't work either then I suspect a problem with your power supply. Could your battery be bad?
So apparently even red LEDs are are safe to use without a resistor? I learned something new.
Thanks Invent-O-Doc and Tracy.
Would sending the program to RAM instead of EEPROM have anything to do with it?
It shouldn't but if you put it EEPROM, it will reload if there's a reset or brownout. At least try loading it to EEPROM to see if it makes a difference. If this is a PropBOE, you can power it directly from USB. Give that a try.
Do you have anything else connected to the board?
Duane,
Safe, maybe, but I don't don't want to be sorry for suggesting it. I don't feel comfortable with a pin sourcing or sinking 30mA, especially if multiple pins have to do so. Well, maybe as a hack. With that current, the transistor or driver is the safe way to go. Also, at 30mA continuous, the red led would be glowing like crazy and getting hot.
With direct connection, I'd prefer a resistor with the LEDs to limit each current to 10mA or less, and, as suggested above, to balance the color values.
Keep in mind that 30 ohms output resistance on a Propeller pin is not the same thing as current limiting. It looks like it would be okay with LEDs that have a fairly high voltage drop, but if you just short the pin to ground the current will be "limited" to 110 mA, which is way over the recommended allowable maximum.