Tom=E1s =D3 h=C9ilidhe wrote: > 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 |=3D 3u; > TRISD &=3D ~3u; > > The idea would be that 20 mA would come from each pin. Bad idea. You don't know how the two PIC pins will share the current. It wouldn't take much for one of them to exceed the 25mA spec. You said the PIC was running at 5V and the LED needs 1.8V, leaving 3.2V to be dropped somewhere. All you need is a single transistor and resistor and you free up a PIC pin. Use a NPN in emitter follower configuration and put the resistor between the emitter and the LED anode. The emitter will be about 750mV below Vdd, which is 4.25V. That leaves 4.25V - 1.8V =3D 2.45V accross the resistor. 2.45V / 20mA =3D 120 ohms. A quick check of power is 2.45V**2 / 120ohms =3D 50mW, so any ordinary 0805 or 0603 resistor will be fine. If your LEDs are only rated for 20mA, you want to go to the next higher value resistor to guarantee the spec will not be violated. Using a 5V supply to run 1.8V LEDs is rather inefficient. Since you are using batteries, I would trim the LED power voltage to only just enough above the LED voltage to allow for somewhat repeatable and predictable LED current. 500-750mV is probably a good headroom above the LED voltage. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist