The Commodore 64 did something like this, they took 9VAC from the power supply and ran it through a schmitt trigger to create 60Hz clock pulses for the 6526 TOD counter.
Which is fine until you run your code on a Commodore 64 in Europe and the interrupts come in at 50Hz. Did the C64 ROM correct for this somehow? I know I had a non-volatile real-time clock add-on for the Atari ST that came with clock software that assumed a 60Hz clock and ran slow on 50Hz mains.
Which is fine until you run your code on a Commodore 64 in Europe and the interrupts come in at 50Hz. Did the C64 ROM correct for this somehow? I know I had a non-volatile real-time clock add-on for the Atari ST that came with clock software that assumed a 60Hz clock and ran slow on 50Hz mains.
The TOD clock in the 6526 CIA apparently has a setting for 50/60Hz.
Of course doing a clock using the power line freq for interrupts you wouldn't have this luxury. As long as you only want time to the second it's just a matter of counting pulses and incrementing the clock every 50 or 60 counts.