Anand, assuming you use pins capable of Interrupt on Change, you'll get an interrupt on both the rising and falling edge. It's the same as using it for ZC detection in AN236 which also discusses the slight assymetry because of different trigger voltages for rising vs. falling edges.
Look at the second oscilloscope screenshot on this page. It's a ZC detector on pin 13 of the PIC.The protection diodes on the pin effectively give you a square wave. In your case, the higher voltage will give steeper edges. You'll get 100 interrupts per second per phase or 300 total per second.
Interrupt on Change cannot be preset for falling or rising edges. It interrupts on both and sets register bits to indicate the pin and rising or falling. On each interrupt you reset the timer, check the register bits to determine pin & polarity, clear the interrupt and output your coded representation of the event.
P.S. What I'm suggesting is much, much simpler than what Skimask suggested.
Bookmarks