That's what I suspected! I also had problems with a PIC (12C508) resetting when using that circuit, although I is suggested in a Microchip app note... Eventually I used a bc337 in between with a resistor to Vdd and the sense resistor onto the base with another res. to Vss from the base. ----- Original Message ----- From: To: Sent: Monday, September 15, 2003 7:34 AM Subject: Re: [PIC:] Why is my 12F629 resetting? George wrote: > How do you detect zero crossings? I have had problems in > that area with > pics connected to the mains. Make sure that there is no input > that can go > below Vss or above Vdd as current into the protection diodes spells > problems. The Neutral terminal of the Mains is connected to a PIC input through a 4.7M resistor for detecting zero crossings. (Some may consider this dangerous, but since the power supply itself makes the whole circuit "live", this doesn't make any big difference.) The software checks for 0 to 1 and 1 to 0 transitions. I didn't have any problems with detection of zero crossings and as I had mentioned earlier, everything worked perfectly on the breadboard. Regards, Bala -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics