Also see AN521, interfacing to AC power lines. I have used this to make dimmers that work fine. With this zero-crossing sync, you can then do the same thing as with DC PWM, within each half-wave. At 08:50 PM 12/1/97 -0500, you wrote: >At 11:36 AM 12/1/97 -0800, you wrote: > >Check out > >http://www.microchip.com/10/Appnote/AppNotes.htm > >and look for PICREF-4 (PICDIM Lamp Dimmer for the PIC12C508) > >MD > >>>>> >Hi-- > >Does anyone have a circuit and some code for driving a 60 Hz, mains-line >synced PWM? I need to create an AC dimmer for 120V incandescent lights >that will operate under PIC control. I know it's been done, but I have >yet to see a lucid explanation of how the routine works... > >Thanks-- I thought I'd see if anyone can help so I don't spend development >time re-inventing the wheel! > > >--Alan McFarland >Alan McFarland's Applied Magic >Custom Electronics for the Motion Picture Industry >Lighting and Electronics for Models, Miniatures, Props & Sets > >http://www.appliedmagic.com > > ><<<< > >-- >Martin Darwin a.k.a Rambo [CtF] >martin@davin.ottawa.on.ca 3rd year Computer Engineering >http://www.davin.ottawa.on.ca/~martin University of Ottawa >Quake Clan Ctf - http://ctf.clanworld.com - IRC #capture > > Bruce Cannon Style Management Systems Remember: Electronics is changing your world...for good!