Then I will have to agree with you.Now you could do it in reverse, on EVERY ZC, call ISR, Check for switch pressed or released, if it is, turn on thingy, of not leave.
Or use the ZC as the timing for main.
while not ZC :WEND
switch pressed do stuff
released do other stuff
continue to twiddle bits, flash LED's, whatever
goto main
As long as main takes less then 333uS (for a 1.5K period) you will never miss a beat, and I don't think you can get any faster
Bookmarks