This is the documentation about the '''realtime clock''' of the [[SYMBiFACE II]] expansion card.
SYMBiFACE II uses a Dallas DS12887A RTC chip. [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/real-time-clock-board/msg249380/#msg249380 Source]
This chip is a modernized version of the MC146818, the original RTC chip used in the IBM PC/AT. It includes a built-in battery and crystal. It is a [[PC compatible RTC chip]] and is programmed in the same way.
It has 14 bytes of registers and 114 bytes of battery-backed static RAM. Century register doesn't exist on this particular model. The chip also provides time-of-day alarm, three maskable interrupts with a common interrupt output, and a programmable square wave output.
It has hardcoded daylight saving adjustment, 24-hour and 12-hour format modes, binary and BCD format modes.
== Ports ==
<pre>
Number Content Values
#00 actual second 00-59 (bcd or binary)#01 alarm second 00-59 (bcd or binary)#02 actual minute 00-59 (bcd or binary)#03 alarm minute 00-59 (bcd or binary)#04 actual hour 00-23 (bcd or binary)#05 alarm hour 00-23 (bcd or binary)#06 day of the week ??01-07#07 day of the month 01-31 (bcd or binary)#08 month 01-12 (bcd or binary)#09 year 00-99 (bcd or binary)
#0A status A see below
#0B status B see below
#0C status C see below
#0D status D see below
#32 millenium 19 or 20 (bcd or binary)#?? memory all other registers from #0E to #7F can be freely used as persistent memory
</pre>
* Note: Register B, Bit 2 allows to select BCD or Binary mode for registers 0..9 (however, this does - of course - not affect RAM location 32h)
== Bugs == * Register 32h is meant to contain Note 1: In the Century (not Millenium)* Register 32h can be only '''either''' bcd '''or''' binary (not both)* Register 32h documentation does not specify whether it shall be BCD or Binary* Register 32h source code implies it shall be binary (not BCD)* Register 32h source code supports only two centuries (19 and 20) this discmag [[Future View IV]] a proposal is probably due given how to misunderstanding use the RTC chip datasheet (which sorts non volatile RAM of suggests the 8bit RAM location can contain only two different values, which is total nonsense)SYMBiFACE II and the CPC-Booster+.
== Status registers ==
bit7 0 = battery is nearly empty, please charge or replace
</pre>
== Software ==
The RTC of the SYMBiFACE II is supported by [[FutureOS]], [[SymbOS]], [[HDCPM]].
== See also ==
* [[Media:DS12887 RTC datasheet.pdf|Dallas DS12887A datasheet]]
* [[SYMBiFACE II:RTC routines|Routines for using the RTC]]
* [[Programming:SYMBiFACE_II|SYMBiFACE II documentations]]
[[Category:FutureOS]]
[[Category:Hardware]]
[[Category:Peripherals]]
[[Category:Programming]]