Technically, it's a reset issue caused by power coming from the clock line. There are several options that revolve around the following two fixes: 1) limit power coming from clock line 2) reset the chip properly on power up The ideal solution will use both. 1) The clock input is sensitive enough that you should be able to put a 1K or larger resistor in series with it. This should prevent the clock line from powering the circuitry through the protection diode as long as the circuit draws 10mA or more under normal operation. If it draws very little current you may need to add a load resistor (470 ohm, 1/4 watt) across the +5 and GND pins of the PIC to pull the voltage down. This should prevent the PIC from starting, as the voltage across the chip should be less than 1.5V. If you still experience problems, then go to a 100ohm resistor across the +5 and GND lines of the chip. Worst case this will allow the voltage to go as high as 0.5V. 2) You can also use a diode to block the current. Place a diode in the clock path so it will only sink current, not source it (ie, current can only go from the PIC to the clock source). Then use a pull up resistor on the PIC side of the diode. 3) The next simplest solution would be to use a transistor to buffer the clock. A simple PN2222 with a couple of resistors will prevent the clock from powering the circuit. 4) You can also employ gates inbetween the chip and the clock source. Many high speed TTL and CMOS gates don't have protection diodes IIRC, so they shouldn't pass the clock signal to +5 when the circuit is off. Check the datasheet carefully. 5) On the reset side, a typical solution is to employ a brownout detector/reset circuit. These aren't expensive, and you can create a simple one with a few components if you don't want to buy a packaged IC. There are a few application notes on suitable reset circuits from microchip, usually conisting of a resistor and capacitor. Make sure you are following something similar. For this particular case, however, you can use a diode to make sure the reset gets no power from the circuit: 6) From the power supply have one diode going to +5 for the rest of the circuit. The reset circuit connects directly to the +5 supply. Even if the clock line powers the rest of the circuit, the diode will prevent that from powering the reset circuit, and upon +5V powerup you should have a clean reset. Out of all of these, I'd go for #2 first. This should make your circuit work as needed. If not, #6 and #1 together should work very well regardless of the clock source. -Adam On 4/9/06, Brooke Clarke wrote: > Hi: > > I have a 16F54 that's being used to divide a precision 10 MHz frequency > source down to a precision 1 PPS output by using the 10 MHz as the PIC > clock and managing the number of instructions executed. > http://www.leapsecond.com/tools/PPSDIV.ASM > > If the DC is applied then the clock input connected it works the way the > code would suggest. But if the clock is connected before the DC power > is applied strange things happen (LEDs not in the states the code would > suggest). Then manually grounding MCLR gets things back to normal, but > I don't want to add a START switch if there's a way around the phantom > power problem. > > Is there a way to programmatically determine if phantom power has caused > problems? > > Thanks, > > Brooke Clarke > > -- > w/Java http://www.PRC68.com > w/o Java http://www.pacificsites.com/~brooke/PRC68COM.shtml > http://www.precisionclock.com > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist