Gerhard Fiedler wrote: > This can work. But you only get an interrupt every other zero > transition. There are some easy ways to deal with this. First, the power line frequency is quite accurate, so a timer will tell you very well where the second zero crossing is if you know the first. Second, it's only a few instructions to change the edge polarity of the interrupt every interrupt. You only have to do this ever 8.3mS. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist