The Microchip website has examples of running micros off the AC line... search the app notes...