Michel Polder wrote: > The time between the AC zero crossing and the triggering determines > the light intensity. This is just like a standard triac based light > dimmer. ... however the problem with the "standard" Triac dimmers is their sensitivity to transients and Zellweger (ripple-control) tones. My suggestion it to run a counter using the PIC timer with a period corresponding to the power line frequency (different in your case to mine), and use a compare function to determine the trigger point for the Triac. No different so far. The trick is not to reset the counter at the zero crossing, but to accumulate the error between the timer and the zero crossing, making incremental adjustments until they coincide. This is called a "Software Phase Locked Loop" (soft PLL) or in TV terminology, a "flywheel", and should allow much more stable control and freedom from flicker. The counter pre-load can be interrupt-driven, but the ZC detection and trigger comparison can probably be done quite well in the main loop. Don't forget the "phase un-lock" inhibit and soft-start algorithms of course! Cheers, Paul B.