Real-Time Clock (RTC) Chip Registers¶
The Amiga motherboard carries a battery-backed Real-Time Clock (RTC) chip that the battclock.resource driver uses to read/set the system clock when the power is off. Different Amiga models use different RTC chips, but the driver abstracts them as a single register file:
- OKI MSM6242RS (A500, A2000)
- RICOH RP5C01A (A3000, A4000)
- Plus "RESET" variants for chip-power-on sequence
The chip sits at $DC0000 on every Amiga model that has a battery-backed clock. The original A1000 did not have a battery-backed clock.
Base address¶
CLOCKBASE = $dc0000
Register file (RawClock)¶
The driver reads/writes the RTC as a 16-byte linear register file. Each register is 1 byte and the registers are spaced every 4 bytes — the unused gaps reflect the chip's internal structure where only every fourth byte carries meaningful data on the chip bus.
| Offset | Absolute | Field | Meaning |
|---|---|---|---|
Reg0 |
$DC0000 |
RTC | sec ones (OKI) / wday ones (RICOH) |
Reg1 |
$DC0004 |
RTC | sec tens |
Reg2 |
$DC0008 |
RTC | min ones |
Reg3 |
$DC000C |
RTC | min tens |
Reg4 |
$DC0010 |
RTC | hour ones |
Reg5 |
$DC0014 |
RTC | hour tens |
Reg6 |
$DC0018 |
RTC | day ones |
Reg7 |
$DC001C |
RTC | day tens |
Reg8 |
$DC0020 |
RTC | month ones |
Reg9 |
$DC0024 |
RTC | month tens |
Rega |
$DC0028 |
RTC | year ones |
Regb |
$DC002C |
RTC | year tens |
Regc |
$DC0030 |
RTC | weekday |
Regd |
$DC0034 |
RTC | control / mode register |
Rege |
$DC0038 |
RTC | reserved / chip-specific |
Regf |
$DC003C |
RTC | reserved / chip-specific |
(Note: the absolute addresses assume the OKI MSM6242RS layout where every 4th byte is the register. The Ricoh RP5C01A uses the same register positions for time fields but maps the day/weekday differently.)
Control register init sequence¶
The driver writes the RTC Regd with the values #10, #11, #0B, #0A to safely stop and reset the chip's internal counters before writing the time registers. This is the OKI MSM6242RS "hold count + reset divider" sequence (per the chip datasheet), used to prevent race conditions on the rolling counters.
Limitations¶
The driver treats the RTC as a 16-byte register file and dispatches the actual byte layout to a per-chip routine (OKI_CLOCK vs RICOH_CLOCK selected at boot). The actual meaning of each RegN differs between vendors — the table above is the common envelope; the OKI-specific and Ricoh-specific mappings are well documented in their respective datasheets.
Cross-references¶
../../library-reference/battclock-library.md—battclock.resourcefunction reference (3 functions:ReadBattClock,ResetBattClock,WriteBattClock)../register-reference.md— master register index