Real Time Clock (RTC) == PC compatible RTC chip ===== Usage in CPCs ===
Usage in [[SYMBiFACE II:Realtime clock]]:
Uses a Dallas DS1287A DS12887A RTC chip, mapped to ports: FD14h SYMBiFACE II Real Time Clock - DS1287A DS12887A RTC Data (R/W) FD15h SYMBiFACE II Real Time Clock - DS1287A DS12887A RTC Index (W) RAM at [32h] is "attempted" to be used as century.
----
Usage in [[Dk'tronics Real Time Clock]]:
Uses a Z80 PIO chip to control the HD146818 RTC chipvia port A. Do not use Port A as this will affect the RTC operation. Details on FBE0h Dk'tronics Real Time Clock - Z80 PIO Port A Data (HD146818P RTC Data bus) FBE1h Dk'tronics Real Time Clock - Z80 PIO Port B Data, used for external control (General Purpose 8bit I/O addresses are Port) FBE2h Dk'tronics Real Time Clock - Z80 PIO Port A Control FBE3h Dk'tronics Real Time Clock - Z80 PIO Port B Control FBE8h Dk'tronics Real Time Clock - Control port for RTC chip (4bit latch) '''(details unknown.)''' Unknown if century Port B is supportedconnected directly to a standard 9-way connector on the left of the interface.
----
Usage in [[Aleste 520EX - I/O Ports]]:
Uses a russian KR512WI1 chip (which is, according to the Aleste's Manual) compatible to western MC146818 chips.
Connects to a 32.768kHz crystal.
Connects to the PPI:
PPI Port C.Bit1 = Index Access (0=No, 1=Access)
PPI Port C.Bit2 = Data Access (0=No, 1=Access)
In the Aleste's Ext Port, the RTC must be enabled, and PSG and 8253 must be disabled. Unknown if century is supported.
=== RTC Registers ===
00h Second (00..59) Registers 00H-09H in BCD mode: {| class="wikitable" style="text-align:center;\" 01h |-! rowspan="2" | Register !! colspan="8" | Bit Position !! rowspan="2" | Function !! rowspan="2" | Range|-! 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0|-| 00H || 0 || colspan="3" | 10 Seconds || colspan="4" | Seconds || Seconds || 00–59|-| 01H || 0 || colspan="3" | 10 Seconds || colspan="4" | Seconds || Seconds Alarm second (00..59) ; these ten registers can be BCD or Binary|| 00–59 02h Minute (00..59) ; (see Control B, Bit2|-| 02H || 0 || colspan=DM)"3" | 10 Minutes || colspan="4" | Minutes || Minutes || 00–59 03h |-| 03H || 0 || colspan="3" | 10 Minutes || colspan="4" | Minutes || Minutes Alarm minute (00..59) ;|| 00–59 04h Hour (00..23) ; ;\|-| rowspan="2" | 04H || AM/PM || rowspan="2" | 0 || 0 || 10 Hours || colspan="4" | Hours || rowspan="2" | Hours || 1–12 +AM/PM|-| 0 || colspan="2" | 10 Hours || colspan="4" | Hours || 00–23|-| rowspan="2" | 05H || AM/PM || rowspan="2" | 0 || 0 || 10 Hours || colspan="4" | Hours || rowspan="2" | Hours Alarm || 1–12 +AM/PM|-| 0 || colspan="2" | 10 Hours || colspan="4" | Hours || 00–23|-| 06H || 0 || 0 || 0 || 0 || 0 || colspan="3" | Day || Day || 01–07|-| 07H || 0 || 0 || colspan="2" | 10 Date || colspan="4" | Date || Date || 01–31|-| 08H || 0 || 0 || 0 || 10 Months || colspan="4" | Month || Month || 01–12|-| 09H || colspan="4" | 10 Years || colspan="4" | Year || Year || 00–99|} Registers 00H-09H in 24hour binary mode: 05h Alarm hour (00..23) ; {| class="wikitable" style="text-align:center;"|-! rowspan="2" | Register !! colspan="8" | Bit Position !! rowspan="2" | Function !! rowspan="2" | Range|-! 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0|-| 00H || 0 || 0 || colspan="6" | Seconds || Seconds || 00–3B|-| 01H || 0 || 0 || colspan="6" | Seconds || Seconds Alarm || 00–3B|-| 02H || 0 || 0 || colspan="6" | Minutes || Minutes || 00–3B|-| 03H || 0 || 0 || colspan="6" | Minutes || Minutes Alarm || 00–3B|-| rowspan="2" | 04H || AM/bit7PM || rowspan="2" | 0 || rowspan="2" | 0 || 0 || colspan="4" | Hours || rowspan="2" | Hours || 01–0C +AM/PM 06h Day of week (01..07) ;|- 07h | 0 || colspan="5" | Hours || 00–17|-| rowspan="2" | 05H || AM/PM || rowspan="2" | 0 || rowspan="2" | 0 || 0 || colspan="4" | Hours || rowspan="2" | Hours Alarm || 01–0C +AM/PM|-| 0 || colspan="5" | Hours || 00–17|-| 06H || 0 || 0 || 0 || 0 || 0 || colspan="3" | Day (01..31) ;|| Day || 01–07 08h |-| 07H || 0 || 0 || 0 || colspan="5" | Date || Date || 01–1F|-| 08H || 0 || 0 || 0 || 0 || colspan="4" | Month (01..12) ;|| Month || 01–0C 09h |-| 09H || 0 || colspan="7" | Year (00..99) ;/|| Year || 00–63|} Control registers:
0Ah Control A
7 UIP Update in Progress (0=Stable in next 244us, 1=Time changes) (R)
7 VRT Valid RAM and Time (1=Okay, 0=Battery Low) (R)
6-0 0 Reserved (zero)
0Eh..3Fh battery backed RAM (DS1287A, and other/newer chips)
40h..7Fh battery backed RAM (DS12887A, newer chip variants only)
80h..FFh reserved
32h battery backed RAM (commonly used as Century) (19..99) (see notes)
== Century Notes ==
First of, whether or not the Century is stored at [32h] depends on software. PCs are conventionally using it like so. SYMBiFACE II seems to (try to) do the same. Whether the Aleste and Dk'tronics do store the century is unknown - and, if they should do, it might be anywhere at [32h] or elsewhere, in BCD or in binary... or even octal or ascii.
The "century" byte at [32h] is Non-Volatile RAM: 0Eh..3Fh battery backed RAM in most chips (HD146818, DS1287A, DS12887, DS12885, DS12887A), so software must manually adjust it when needed, and software can store BCD or binary or other values. However, during the year 2000 panic, two chips have been hastily produced (DS12C887, DS12C887A) which do automatically "destroy" this 40h..7Fh battery backed RAM location when the year wraps from 00 to 99, according to the datasheet, the destroyed value is then set to 20h (BCD twenty), and can be accessed only in BCD mode, on DS12887A and RAM at [32h] returns "N/A" in binary mode.newer chip variants)
The DSE feature is crap, and should be disabled == Other chips ==* [[ACU Real Time Clock (it's using a hardcoded timezone, and thus works only in a few countries, and, it lacks a flag that indicates if daylight saving time is active or notDIY)]]* [[Dobbertin Smart Watch]]* [[URTC-8 Universal RTC for Z80 computers]]* [[Nova]] (M48T35Y-70MH1F chip).
SYMBiFACE II Cautions[[Category: Incorrectly claims to have 128 bytes battery backed RAM (but actually uses a DSDS1287A chip with 50 bytes battery backed RAM) (128 byte chips don't exist anyways, the maximum would be 114 bytes). ThePeripherals]]century is accidently referred to as millenium, it seems to be stored as BINARY value 19 or 20 (which may conflict with the Y2K-panic chips which are only "optimized" for destroying BCD values).[[Category:Datasheet]]