Re: Getting at least 5V@15mA output from RA4 pin of PIC16F72

Started by Eirik Karlsen May 29, 2008
you asked for 5V out (source) at high current, and there is just no way of doing that.

If you just want the LED to light up it is probably more common to do as you suggest and
sink instead (LED anode to +5V). No need to do the math very accurately, just select a
resistor that gives 'good' brightness, and check the current. Use lowest acceptable current...
there is little difference in brightness between 5-10mA, and 20mA. Try with 8mA, should
be good enough in most cases, especially if you're using a low current / high brightness LED.
Jason Hsu wrote:

> What about moving the 330 ohm resistor + LED from between RA4 and
> ground to between RA4 and 5V and then manipulating the corresponding
> TRISA bits? The arrangement would be:
> +5V supply->LED->330 ohms->RA4
> Setting TRISA,4 to 1 (high impedance) would mean 5V at RA4. Setting
> TRISA,4 to 0 (low impedance) would mean 0V at RA4. This sounds
> simpler than adding a transistor.


LAST UPDATED: 23/08/2003
Eirik Karlsen