>I have a circuit in which I independantly power a PIC (and it's reset line) >with respect to the components that it interfaces to. The Power is >controlled to the PIC via an Opto-isolator and _MCLR is isolated by a >forward biased diode (the PIC is in an ISP Programmer attached to the >circuit). > >One of the lines the PIC is attached to is an LED, connected to a Current >Limiting Resistor and Vcc. The PIC sinks the LED current. > >The problem comes in when I turn off the Power and _MCLR to the PIC (Ground >is still connected) - the LED lights! Is there anything that I can do to >eliminate the current path? Greetings from chinook country, Myke The obvious solution is to arrange the LED so that it is sourced by the PIC pin. I'm guessing that you may not be able to do this because of limited current from your opto. If this is the case, you may be forced to add another transistor, either as a switch (2n4401, E to port pin, C to LED, B to PIC VDD via a 10 K resistor) or as a standard driver (2n4401, E to gnd, C to LED, B to port pin via 10 K resistor). The first method does not require inverting the port in software. Something that you may not be aware of is that the "sneak" current lighting your LED is also partialy powering your PIC. This can cause all manner of power-up problems. One of the most serious flaws with the PICs that I have used is that if VDD does not fall below 0.4 - 0.5 Vdc, the part may fail to initialise properly and lock up such that even a hard reset will not start it going. PICs that have complex peripherals (timers, uarts, etc) may appear to init except that some of those peripherals may not work. I had a real problem with a 16C71 locking up so solid in one project that the external watchdog couldn't reset it (MCLR was being pulled solidly to gnd by the watchdog but the PIC wouldn't respond). Andrew Warren got me on the right track with that one: it turned out that my supply was only collapsing to about 0.75 Vdc when power was removed. Adding circuitry to ensure that VDD went all the way to gnd with power off fixed that one. Bottom line: if you are supplying independent power to the PIC that might be removed but leaving the remainder of your circuit powered, make sure that signals on your port pins can't power the PIC. Hope this helps. Dwayne Reid Trinity Electronics Systems Ltd Edmonton, Alberta, CANADA (403) 489-3199 voice (403) 487-6397 fax