Hello,every body,can u help me ?

Programming the 6502 microprocessor and its relatives in assembly and other languages.
coredump
Posts: 44
Joined: 09 Mar 2004
Location: Bristol, UK
Contact:

Post by coredump »

blackadder wrote:
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.
blackadder
Posts: 24
Joined: 20 Mar 2006

Post by blackadder »

coredump wrote:
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.


BTW, you can see the schmitt trigger circuit here, it's at the bottom of sheet 2.
http://www.devili.iki.fi/Computers/Comm ... Schematic/
Post Reply