Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

LED Issue

Status
Not open for further replies.

perts

Electrical
Jun 30, 2004
39
0
0
US
I have a micro and sinks the current to a 3.3 V LED via 220 ohms to turn it on. It works but as soon as I put my scope probe on the LED (micro side) the LED doesnt turn on. What can cause that?
 
Replies continue below

Recommended for you

Which also leaves the question of where you placed the ground connection.

TTFN
Eng-Tips Forum Policies
7k8p7u3
 
scope is set up properly. It seems like any capacitance on the output line makes the problem appear.

put a .1uf cap on the output and micro was not able to drive the led circuit. It tried to...drove it low for 200ns but went back up.

The ckt:

3.3VCC -----R----led----Micro (PIC16F724 port D)
 
Well, it sounds like you're driving the LED at a VERY HIGH frequency. Is that the intent?

Your reported symptom seems to be directly opposite of what one might expect, since most micros have fairly robust sinking capability, so loading the output should simply make it harder to rise (turn off).

TTFN
faq731-376
 
It does sound like the output is some high frequency PWM or something like that. Also, I'm curious about the original post saying it's a "3.3 V LED". Do you have any data on that LED that says that? What color is the LED? For example, if it's blue or white, it might be barely enough voltage to turn it on and any capacitive load on the PWM output might keep the voltage from rising high enough. You should still see a waveform on the scope, even if the LED is not lit.

Glenn
 
its not a high frequency output. The period is 1 second. The forward voltage drop on the LED is 2.0V.

itsmoked-- what can be causing it in the software?
 
Uh, perts, itsmoked is pretty good, but I don't think even he can debug your software without having seen it. He is suggesting that there is a high probability that your code doesn't say what you think it says, so this would be a good time for a code review, preferably by a person other than yourself.



Mike Halloran
Pembroke Pines, FL, USA
 
Have you really gone through the datasheet? With 3.3Vcc, your chip is supposed to sink about 6mA. (3.3V-0.6V)/220ohm = 12 mA, which is double what the pins are individually rated at. To confirm this, you should wire 4 outputs in parallel doing the same thing as the original and see if that improves things.

TTFN
faq731-376
7ofakss
 
I say software, because for me, anything inexplicable occurring with a PIC is always due to mis-configurations.

A most common one is this:
The ANSELD register must be initialized
to configure an analog channel as a digital
input. Pins configured as analog inputs will
read ‘0’.

The pins DEFAULT to being AIN pins. You may think this doesn't matter because they also state that when set to an OUTPUT it will BE AN OUTPUT. But then PIC's crappy read>modify>write system means that a subsequent 'read' can screw up the 'modify>write' which happens every time you write the pin (every second in your case).

See here:

A pin with TRIS clear and ANSEL set
will still operate as a digital output, but the Input mode will be analog. This can cause unexpected behavior when executing read-modify-write instructions on the
affected port.

If you've correctly de-AIN'd your pin then I offer this as a possible problem.

The PIC16F72X devices have an internal low dropout voltage regulator. An external capacitor must connected to one of the available VCAP pins to stabilize the regulator. For more information,
Section 5.0 “Low Dropout (LDO) Voltage Regulator”. The PIC16LF72X devices do not have the volt
regulator and therefore no external capacitor is required.

Keith Cress
kcress -
 
perts is back now

still trying to figure it out. We have 6 leds that get driven from that port on the mico. We noticed that when we drive all the leds on that port to 0 and then turn on the ones we want, it works.
 
Status
Not open for further replies.
Back
Top