Get rid of R2, and use pin RA4.

According to the data sheet, RA4 is an open-collector driver, which
means that it will only sink current- never sourcing it.  Furthermore,
(according to the 18f242 data sheet) the only protection diode on RA4 is
to Vss(Gnd).  You can put a reletively high voltage on RA4 without
worrying about a diode shunting current to Vdd (V+).  I believe all the
other PICs to have the same essential design.

Just like the other ports you need to maintain a current of under 25mA.

Enjoy!

-Adam

Tal wrote:

>Hello,
>
>I noticed the following circuit in a friend design of a very cost
>sensitive product and am curious what the people think about it.
>
>The PIC (e.g. 16F73) is to drive an high voltage LED such as digikey
>441-1009-ND
>(http://rocky.digikey.com/WebLib/Sunbrite/Web%20Data/SSP-01TWB9WB12.pdf)
>. The general idea is to drive the LED directly from the PIC, saving an
>extra high voltage driver (actually, there are few LED in this circuit,
>each is driven seperatly).
>
>The circuit is as follows:
>
>
>  [14V]----[A LED C]----[R1]---(A)----[R2]----[GND]
>
>Where R1 is the current limiting resistor for the LED, point A is
>connected to a PIC digital output and R2 is a relativly large resistor
>(about 50K or so). The idea is that to turn the LED off, the PIC output
>goes to HIGH or TRI_STATE and because of the 'knee' of the LED curve and
>the resistor R2 that draws a minimal forward current, the voltage at the
>PIC will not exceed its VDD.
>
>Does this make sense ? How about if the PIC is operating on 3V only ?
>
>Thanks,
>
>Tal
>
>--
>http://www.piclist.com hint: PICList Posts must start with ONE topic:
>[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
>
>
>
>
>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.