Quote Originally Posted by ardhuru View Post
Personally, I find the software easier to write if I have positive going transitions for each half-cycle. But to achieve this, you'd need to use an opto with 2 diodes in anti-parallel. I find the PC814 ideal for this.
Thanks for the suggestion! I had thought about using a garden-variety opto and getting half the cycle, but your idea is definitely better.

It looks as if, using the PC814, I could maintain isolation from the mains. If the output goes to a Schmitt trigger input on the PIC, that should do very nicely.

How do you factor the opto's diode drop (Vf) into the timing? I think I saw something about this in an article or app note but can't find it now.