Bob wrote: > > Thank you for your reply. > > I'm not sure exactly what the peak-peak voltage is, but my DMM says it's over > 100 volts DC between either side (+ & -) of the rectifier (sorry, don't have a > scope). I'm using a 5 Mega ohm resistor to keep the injected current well below > the pin's maximum of 500ua. I would think that a 10k resistor would be way to > small at that high of voltage. According to a Microchip app-note on this > (AN521), it is a cheap, safe, and effective way to do this (but they were > polling a port on a 16C5x part, not using an interrupt). I already have the > weak pull ups on portb disabled. > > I've attached a rough schematic of my current circuit. There are a few things > missing on it Bob, your circuit scares the poopoo out of me. I recognise the VB409 high voltage reg but don't know enough about it to comment if it is wired correctly. However, the high voltage is tied directly to a PIC pin, 5mohm or not this is BAD. There is a SPEC for the absolute max voltage allowable to connect to a PIC pin and your 170 vdc peaks (not to mention spikes) are way out of spec. All you need is a 5.1v 1w Zener from the pin to gnd. This will give reverse voltage protection (zener forward conduct) and will limit the max voltage that can ever appear at the PIC pin to about 5v. Always use a zener when there is a possibility that the volts could exceed spec. I don't want to hear about internal clamp diodes, I feel strongly about this like Bob does about overclocking and Olin does about comments. Also use a decent cap 0.1uF? across the zener. You can then lower the 5mohm resistor to a more reasonable value like 1mohm. Smaller resistors like 1/2w and 1/4w are rated at 100v, like all small capacitors and unmarked voltage parts are specced at 100 vdc max. A spec that many people ignore. In TVs, they use a chain of 2 to 6 resistors for a voltage divider with this voltage, and they still fail after a few years. Use 2 Rs of 470kohm and of 1w size or bigger if you can. Well designed units will have 10nF 500v ceramic caps across each diode in the mains rect bridge. Also put a 1 ohm 0.5w fusible resistor between the bridge and VB409, if VB409 goes short this may save the user from electrocution, it may also save the PIC and of course you have a good glass fuse before the bridge? Some tips for getting max reliability. Use series resistors before anything critical, like the bridge, the VB409, etc. Put a cap after the series resistor, this will give a RC filter for spikes. The idea is to dissipate spike energy into the series resistor and cap, and not the load, which is a delicate semiconductor. Make the series resistor as large as sensible power losses allow, I like 5% or more if possible. You show no cap on the bridge, if the VB409 requires full-rect unfiltered dc, you should still use a small cap of 0.33uF or so across the bridge. Coupled with the mains series resistor of 2.2ohm or so this gives a pretty good spike filter. Hope all this helps. -Roman AND that 5.1v zener!!!!!!! -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu