At 10:47 AM 6/29/2008, you wrote: >Let's say I have an LED with a Vf of 1.8 V and I want to put about 40 mA >through it. The cathode goes straight to ground and the anode goes to a >PIC pin. > >I can go from 5 V on the PIC pin, through a 80 ohm resistor into the >LED, but of course the problem is that I'll be drawing more than the >maximum current for a PIC pin. Of course there are other problems. >But I'm wondering if I could use two PIC pins together. Let's say I >connect RD0 and RD1 together and then do the following in C code: > >PORTD |= 3u; >TRISD &= ~3u; > >The idea would be that 20 mA would come from each pin. PIC outputs are not designed to reliably source even 20mA with low voltage drop. *You* still must prevent them from seeing more than 25mA, but that's no indication that they'll work in your application. >This a go-er? Nope. See Figure 18-29 of DS41291E. Max/min is not guaranteed, only 3-sigma distribution, so it's actually even worse than that. At least this data sheet is complete and *has* the curves (not all do), so it's left up to you to read the datasheet and understand it. I have to disagree somewhat with Olin here- the outputs will typically share current quite well (they are well matched -- Idss and Vth-- because they're on the same chip), and 20% derating for matching is probably enough for sharing (especially with such a huge voltage drop), but there are other problems (such as the huge voltage drop). Was it not the Bard himself who said: If current be the food of light, source on give me excess (capability) of it, that buffering.. that the LED brightness may not sicken and so die ? >Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist