Quote Originally Posted by Jerson View Post
Of course you can 'read' the comparator output internally. I still feel you may be better off using an interrupt on the zero crossing as you might have some misses while polling the register in a code loop.
I guess my reticence to use the comparator interrupt method you describe is that I've absolutely no idea the latency between the comparator flipping to getting into the sub routine & being able to do something (this area for me will always be an enigma...in fact it's probably the largest impediment I'll contnue to face...if I don't know the timing impact of something, then I'll veer away from it!), and what is absolutely key for a 'close to zero cross' is that the moment the comparator flips, my switch control voltage needs to be raised as quickly as PIC-ly possible ....wouldn't a while/wend on the CxOUT bit be the quickest vs a comparator interrupt?