Dave Poo 2 recently took a deep dive into the Amiga real-time clock (RTC), focusing on the Amiga 1200’s implementation—or rather, its lack of one. It might not sound like the most exciting topic, but there’s a surprising amount to unpack here.
A real-time clock is a simple but useful component. It keeps track of the time, even when the computer is turned off. The Amiga itself can count time while it’s running, but without an RTC, it forgets everything the moment it’s powered down. The Amiga 1200 motherboard includes a designated area for an RTC, complete with solder pads and component outlines, but none of the parts were installed at the factory. This means no built-in clock, but also no dreaded nickel-cadmium battery leaking onto the board and corroding everything in sight.
Looking at the schematic, it’s clear that Commodore intended to include an RTC. The main chip, the RF5C01A, is designed to communicate directly with the CPU, using a 4-bit data bus and 4-bit address bus. The design suggests an easy way for software to read and write time data. However, there’s a small oddity—the chip is supposed to have 18 pins, but the board layout has 20. The extra pins don’t seem to be connected to anything, so it’s unclear why they’re there.
Addressing is another interesting detail. The RTC is mapped into the system memory at address DC000000, even though it only uses 16 bytes. AmigaOS expects the data in binary-coded decimal (BCD) format, meaning each decimal digit is stored separately in a 4-bit binary form. For example, the time 10:36 is stored as separate digits: ‘1’ and ‘0’ for hours, ‘3’ and ‘6’ for minutes. The year is handled similarly, with only the last two digits stored. AmigaOS determines the full year by adding either 1900 or 2000, depending on whether the stored value is 78 or higher. That works well—until the year 2079. At that point, the system incorrectly resets the date to 1979, since it has no concept of a year beyond 2099.
Since the onboard RTC was never populated, Amiga users rely on external modules instead. One popular option is a plug-in RTC from AmigaKit, which uses a different chip, the RTC62423. Unlike the RF5C01A, this chip has a built-in crystal oscillator and uses a coin cell battery instead of a rechargeable one. This makes it simpler to implement and avoids the battery leakage issue. The AmigaOS recognizes it just fine because it’s pin-compatible with the older MSM6242 used in the Amiga 500’s add-on board.
Accessing the RTC in software is fairly straightforward. In assembly language, you can directly read the clock registers via their memory-mapped addresses. However, due to how the Amiga 1200 wired the address lines, each register is spaced four bytes apart instead of one. A quick bitwise mask operation filters out unwanted data, leaving clean time values ready for use.