| Author |
Message |
   
james
Valued Member Username: james
Post Number: 13 Registered: 02-2007
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, 27 January, 2010 - 09:19 am: |
|
Hi I've built a circuit on breadboard around a PIC 16LF88 (The low supply version of the 16F88). I'm running it with a supply of 3V. I have an LED and 130 Ohm 'dropper' resistor connected in series from RB1 down to 0V. With RB1 high I am measuring 1.75V across the LED and 0.75V across the resistor. This gives me a measurement of 2.5V at the port pin, RB1. The circuit is pulling approx 5.8mA, what I,d expect when doing Ohms Law on the resistor and well within the data sheet's 25mA single port pin limit specification. My question is - Is this 'pulling down' or 'loading' effect I'm seeing at the port pin normal. ie. Should there be a drop from 3V to 2.5V when I connect the LED. I'd appreciate your comments. Cheers James. |
   
echase
Frequent Contributor Username: echase
Post Number: 281 Registered: 07-2007
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, 27 January, 2010 - 10:40 am: |
|
There will be some drop. I think the datasheet refers to even higher drops than this. I find that at 1mA or less the drop is tiny (<.1V). But at 5.8mA 0.5v seems reasonable. I assume the output is driven by a FET, which is effectively acting like a resistor with higher currents causing more drop. If it were a bipolar transistor it would have amore constant drop. |
   
zeitghost
Frequent Contributor Username: zeitghost
Post Number: 1423 Registered: 01-2006
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, 27 January, 2010 - 10:51 am: |
|
It's due to the Rds(on) of the output device. P channel devices tend to have a higher rds(on) than N channel for the same dimensions. Also, the lower the Vdd, the higher the rds(on) gets, i.e. its got a higher rds(on) at 3V than it has when running off 5V. |
   
james
Valued Member Username: james
Post Number: 14 Registered: 02-2007
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, 27 January, 2010 - 12:18 pm: |
|
That helps. Thanks for your comments chaps. James. |
   
eagre
Frequent Contributor Username: eagre
Post Number: 353 Registered: 05-2005

Rating: N/A Votes: 0 (Vote!) | | Posted on Thursday, 28 January, 2010 - 03:56 am: |
|
When driving LEDs with PICs it is usually preferable to sink the LED cathode through the PIC output pin (active low) with the LED anode connected to V+ (dropping resistor on either side as convenient). PIC I/O pins can usually sink more current than they can source and at lower offsets. Ed |
   
joe
:::: Super User :::: Username: joe
Post Number: 732 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 30 January, 2010 - 11:10 am: |
|
"PIC I/O pins can usually sink more current than they can source " Really ? I just checked a sample of the datasheets I have stored locally, 16F, 18F, 12F and they all say the same thing; sink / source 25ma per pin. I'd be interested in some part numbers that seem to break from this rule as you describe. Joe Read my ramblings - www.techbites.com/joe-farr
|
   
eagre
Frequent Contributor Username: eagre
Post Number: 354 Registered: 05-2005

Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 01 February, 2010 - 02:56 am: |
|
Joe - This source/sink difference is primarily based on my experience, but it also reflected in the datasheets for some PICs. For the PIC16F8X (DS30430C, pg 87), for example, the maximum per pin source is given as 20 mA and the maximum sink current as 25 mA. Stated "maximum" currents are always subject to interpretation. It is best to check voltage offset vs current draw, for a pin or a port. Ed |
   
zeitghost
Frequent Contributor Username: zeitghost
Post Number: 1428 Registered: 01-2006
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 01 February, 2010 - 08:17 am: |
|
It takes more die area for the pullup than the pulldown. The economics is simple. |
   
epithumia
Frequent Contributor Username: epithumia
Post Number: 715 Registered: 06-2006
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 01 February, 2010 - 10:16 am: |
|
quote:I'd be interested in some part numbers that seem to break from this rule as you describe.
I checked the PIC16F87/88, PIC16LF87/88 datasheet. (DS30487C. 2005) The Absolute Maximum current is 25mA, high and low, which means that you'll damage the chip if you draw more than that. It doesn't mean that the chip will present a sensible output voltage when you take that much current. In the detailed characteristics (section 18.4 in my saved copy) is says: Vol = 0.6V for Iol=8.5mA (characteristic D080) Voh = Vdd-0.7V for Ioh = -3mA (characteristic D090) So when driving low you only lose 0.6V at 8.5mA, but when driving high you lose 0.7V at only 3mA. This PIC is 3 times better at driving low than driving high. There are also graphs of output voltage vs current in section 19. For example, the graph for Voh vs Ioh at Vdd = 3 Volts shows that even if you short circuit the pin, you'll typically only get 13mA out of it. (If you're wondering why they give the maximum as 25mA, it's because you can get 25mA at Vdd=5 Volts.) However, the graph for Vol vs Iol at Vdd = 3 Volts shows that you can draw 25mA and still only drop 1 volt. Epi (Message edited by epithumia on 01 February, 2010) If you need me, Neil and me will be hanging out with the Dream King. - Tori Amos
|
   
joe
:::: Super User :::: Username: joe
Post Number: 735 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 01 February, 2010 - 11:12 am: |
|
hum.... that clears that up. Nothing's simple. Thanks, Joe Read my ramblings - www.techbites.com/joe-farr
|