I am designing a PIC circuit which needs to stay synchronized with the AC line's zero-crossing point. I want to arrange things so that the PIC gets an interrupt every time the AC voltage crosses 0V. My original idea used an H11AA1 optoisolator as shown in this schematic: http://home.quixnet.net/xyzzy/ee/zcopto.gif The optoisolator connects the INT line on the PIC to ground when there's an AC voltage, but when it goes to near 0V, it turns off and lets the INT line pull up to +5V, interrupting the PIC. Someone on another list suggested I use an LM339 comparaotr instead of the optoisolator, but I'm not that savvy about this component. His suggestion was like this: http://home.quixnet.net/xyzzy/ee/zccomp.gif Does this look right? Does it look like a better design than the optoisolator? Thanks! steve -- Steve Willoughby | "It is our choices... that show what we truly | are, far more than our abilities." | --Albus Dumbledore, in Harry Potter and the | Chamber of Secrets, by J. K. Rowling _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist