AVR based solution to using 60 Hz mains as a clock reference