Hi, Refering to Microchip's AN521, it shows a PIC connected to AC supply line (of "several hundred volts") using just a 5 megaohm resistor in series in between. Safety issues apart, it looks too simple to be true. Is this enough to detect a zero-crossing (eg. for a PIC based triac dimmer)or should I put two clamping diodes on the pin detecting the zero-crossing? I'm using a PIC16F870. I've read the manual and I believe it doesn't have protection diodes in its i/o pins. --->|---o Vdd R | 240VAC o-------/\/\/\---o----o---------o PIC i/p 5 M | | | ---|<---o Vss \ R / 100K \ | o Gnd Btw, the PIC in my dimmer is powered from a transfomer on the same AC line (and bridge rectifier) so both the commons are going to be same. Off topic, sitting here in India I can only guess what is "HOT OUT" and "HOT IN"... its LINE and NEUTRAL, right? Pity we don't have such interestingly graphic lingo down here. Mohit. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.