DS1285 RTC

This document defines the DS1285 real-time clock, its MC68EC000 bus adapter, battery and crystal connections, and interrupt wiring. Return to the main page.

Document status
Revision 1.0 pre-layout design
RTC
Dallas DS1285, 24-pin plastic DIP
Bus connection
I/O slot 8, $F00000-$F1FFFF, on D7..D0
Canonical register block
$F00001-$F0007F, odd byte addresses
Time base
32.768 kHz crystal
Backup supply
3 V CR2032 lithium primary cell
Interrupt connection
MC68901 GPIP3, falling edge, vector $43

1. Purpose and Scope

The DS1285 supplies the battery-backed clock, calendar, alarm, periodic interrupt, update-ended interrupt, and 50 bytes of CMOS RAM. This page fixes every motherboard connection to the device and the discrete adapter that converts the MC68EC000 bus into the DS1285's multiplexed address/data cycle.

The Memory Map owns the slot assignment. Bus and Address Decode owns IO8_n, the global completion tree, and timeout behavior. The MFP owns the GPIP vector, Clock and Reset owns PERIPH_RESET_n, and the DRAM clock buffer supplies INT_CLK.

Signal names ending in _n, and signal names written with a leading slash, are active low. The board uses +5 V logic and through-hole packages. Every IC family selected here existed before 1994.

2. Architecture

MC68EC000 bus                         DS1285 RTC

A6..A1 ----> U_RTC_ADDR ------------> AD5..AD0   address phase
GND -------> U_RTC_ADDR ------------> AD7..AD6
D7..D0 <--> U_RTC_DATA <-----------> AD7..AD0   data phase
R/W -------> U_RTC_INV -------------> transceiver direction
R/W --------------------------------> R/W
IO8_n ------------------------------> /CS
LDS_n -----> U_RTC_REQ ------------> RTC_CYCLE
INT_CLK ---> U_RTC_INV --> RTC_CLK
RTC_CYCLE -> U_RTC_SYNC --> U_RTC_SEQ
U_RTC_SEQ + FAST gates ------------> AS, DS, RTC_DTACK_n
PERIPH_RESET_n ---------------------> /RESET

32.768 kHz crystal -----------------> X1, X2
CR2032 + ---------------------------> VBAT
/IRQ ------- 4.7 kohm pull-up ------> MC68901 GPIP3

The DS1285 uses Motorola timing with MOT tied to +5 V. Its AS and DS inputs are active-high pulses; they are local signals and are not the processor's active-low strobes. The adapter presents the register address first, then turns the shared RTC pins around for data.

3. Bus Interface

RTC processor-bus connections
Motherboard signal Adapter or RTC connection Function
A6..A1 U_RTC_ADDR inputs 5..0 Selects one of 64 locations.
D7..D0 U_RTC_DATA A-side Transfers one byte between the CPU and RTC.
IO8_n DS1285 /CS and U_RTC_REQ Selects slot 8 during a normal cycle.
LDS_n U_RTC_REQ Restricts the interface to the lower byte lane.
R/W DS1285 R/W and U_RTC_INV High reads; low writes.
INT_CLK Two U_RTC_INV stages Supplies the local 10 MHz clock.
PERIPH_RESET_n DS1285 /RESET Clears interrupt and square-wave controls.
RTC_DTACK_n U_RTC_NAND output Returns completion to the motherboard tree.

Cycle Qualification

U_RTC_REQ is one SN74F02 gate. It asserts RTC_CYCLE only while slot 8 and the lower byte lane are both selected.

RTC_CYCLE = NOT (IO8_n OR LDS_n)

An upper-byte-only access leaves RTC_CYCLE low and reaches the motherboard bus timeout. A word access includes the lower lane and completes, but only D7..D0 contain valid RTC data. Software shall use byte accesses at odd addresses.

Address and Data Paths

U_RTC_ADDR is an SN74HCT244N. Six channels connect A1..A6 to AD0..AD5; its remaining inputs are grounded and drive AD6 and AD7 low during the address phase. Both enables share RTC_ADDR_OE_n.

U_RTC_DATA is an SN74HCT245N. Its A-side connects to CPU D7..D0 and its B-side connects to RTC AD7..AD0. RTC_DATA_OE_n keeps it disabled during the address phase. U_RTC_INV drives DIR high for a CPU-to-RTC write and low for an RTC-to-CPU read.

RTC_DATA_DIR = NOT R/W

R/W = 0: U_RTC_DATA A -> B, CPU writes DS1285
R/W = 1: U_RTC_DATA B -> A, CPU reads DS1285

4. Adapter Sequence

U_RTC_SYNC is an SN74HCT74N. Its first flip-flop samples a high level after RTC_CYCLE begins, and its second flip-flop produces RTC_REQ_SYNC. The raw cycle signal asynchronously clears both stages when the CPU releases the access. This keeps an asynchronous request from driving the timing chain directly.

U_RTC_SEQ is a CD74HCT164E shift register. Its serial inputs are tied to RTC_REQ_SYNC, its active-low clear connects to RTC_CYCLE, and it advances on rising edges of RTC_CLK. Outputs QA through QF define the transaction.

RTC transaction phases after synchronization
First high output Address driver RTC AS Data transceiver RTC DS RTC_DTACK_n
None Enabled Low Disabled Low High
QA Enabled High Disabled Low High
QB Enabled Low; address latched Disabled Low High
QC Disabled Low Disabled Low High
QD Disabled Low Enabled High High
QE Disabled Low Enabled High High
QF Disabled Low Enabled High Low

The QC-only dead interval gives break-before-make control between U_RTC_ADDR and U_RTC_DATA. QE supplies one full wait state after DS rises; QF acknowledges after two 100 ns read-data intervals.

Control Equations

RTC_AS            = QA AND NOT QB
RTC_ADDR_OE_n     = NOT (RTC_CYCLE AND NOT QC)
RTC_DATA_OE_n     = NOT (RTC_CYCLE AND QD)
RTC_DS            = RTC_CYCLE AND QD
RTC_DTACK_n       = NOT (RTC_CYCLE AND QF)

U_RTC_NAND and U_RTC_AND implement these equations. U_RTC_INV supplies the inverted QB and QC terms. The raw RTC_CYCLE term forces DS low, disables both bus drivers, clears the sequence, and releases RTC_DTACK_n as soon as either IO8_n or LDS_n rises.

5. Register Map

CPU A1..A6 become DS1285 address bits 0 through 5. The canonical address of RTC location n is $F00001 + 2n. Address lines A16..A7 do not enter the local decode, so the 128-byte block repeats throughout slot 8.

Canonical DS1285 locations
RTC location CPU address Name Access
$00 $F00001 Seconds Read/write
$01 $F00003 Seconds alarm Read/write
$02 $F00005 Minutes Read/write
$03 $F00007 Minutes alarm Read/write
$04 $F00009 Hours Read/write
$05 $F0000B Hours alarm Read/write
$06 $F0000D Day of week, 1 through 7 Read/write
$07 $F0000F Date of month Read/write
$08 $F00011 Month Read/write
$09 $F00013 Year, 00 through 99 Read/write
$0A $F00015 Register A Control and update status
$0B $F00017 Register B Mode and interrupt enables
$0C $F00019 Register C Read-only interrupt flags; read clears flags
$0D $F0001B Register D Read-only valid-RAM-and-time status
$0E-$3F $F0001D-$F0007F, odd addresses 50 bytes of battery-backed RAM Read/write

Control Registers

Register A, $0A:  UIP DV2 DV1 DV0 RS3 RS2 RS1 RS0
Register B, $0B:  SET PIE AIE UIE SQWE DM 24/12 DSE
Register C, $0C:  IRQF PF AF UF 0 0 0 0
Register D, $0D:  VRT 0 0 0 0 0 0 0

DV2..DV0 = 010 selects the 32.768 kHz time base and lets the divider run. DM selects binary or BCD time fields, and 24/12 selects the hour format. PIE, AIE, and UIE enable the periodic, alarm, and update-ended interrupt sources. Register C reports those sources and clears all asserted flag bits when read.

The DS1285 has no century register. System software must combine its two-digit year with a separately maintained century policy.

6. Clock and Battery

32.768 kHz Crystal

Y_RTC is a 32.768 kHz tuning-fork crystal connected directly between pins 2 and 3. The specified part is the IQD Frequency Products LFXTAL014219B. Any substitute must be a parallel-resonant crystal specified for 6 pF load capacitance and no more than 50 kohms series resistance. The RTC supplies its own bias and load network, so no external crystal capacitors or feedback resistor are fitted.

Register A must contain DV2..DV0 = 010 before the divider counts time. Firmware shall verify that seconds advance before accepting the stored time.

Backup Cell

BT_RTC is a replaceable CR2032 primary lithium cell in a through-hole holder. Its positive terminal connects directly to VBAT; its negative terminal connects to ground. No series diode, resistor, or charging circuit is permitted in the battery path.

The recommended holder is the MPD BA2032. It is a through-hole retainer for a 20 mm cell. Any through-hole holder is acceptable.

The DS1285 disconnects the host interface during power failure and runs the oscillator and CMOS RAM from VBAT. Register D bit VRT reports whether the retained time and RAM can be trusted. Firmware shall treat a cleared VRT as loss of clock state.

7. Reset Behavior

DS1285 /RESET connects directly to PERIPH_RESET_n. The 250 ms minimum motherboard power-on reset exceeds the RTC's 200 ms power-up requirement. A processor RESET instruction holds PERIPH_RESET_n low for about 12.4 us, above the RTC's 5 us minimum reset pulse width.

Reset clears the three interrupt-enable bits, the interrupt flags, IRQF, and SQWE. It releases /IRQ and blocks host accesses while asserted. Reset does not change the clock, calendar, alarms, general-purpose RAM, SET, DM, 24/12, or DSE.

U_RTC_SYNC and U_RTC_SEQ clear whenever no qualified RTC cycle is active. They need no motherboard reset connection and cannot hold RTC_DTACK_n low across reset.

8. Interrupts

The DS1285 open-drain /IRQ output connects to MC68901 GPIP3. R_RTC_IRQ is a 4.7 kohm pull-up from that net to +5 V. The MFP detects the falling edge and supplies vector $43 during the processor's level-6 interrupt acknowledge. See Interrupts and MFP GPIP Assignment.

DS1285 interrupt sources
Source Flag Enable Use
Periodic divider tap PF PIE Periodic service from 2 Hz through 8192 Hz.
Alarm match AF AIE Alarm from once per second through once per day.
Clock update ended UF UIE Completion of the one-second calendar update.

Any enabled flag asserts /IRQ and sets IRQF. The output remains low until software reads Register C or reset clears the condition. The interrupt handler shall read Register C once, retain the returned byte, and service every set flag; that read clears all flags present at the start of the access.

9. Firmware Access Rules

  1. Use byte instructions at odd canonical addresses.
  2. On startup, read Register D and reject retained state if VRT is zero.
  3. Program Register A with DV2..DV0 = 010.
  4. Set SET before changing time, calendar, alarm, data mode, or hour format; clear it after writing all related fields.
  5. Leave DSE clear. Its April and October rule does not match current daylight-saving rules.
  6. For a coherent read, poll UIP until zero, then read the time and calendar fields within the guaranteed 244 us window.
  7. Configure GPIP3 for a falling edge before enabling an RTC source. Read Register C to discard stale flags first.
  8. After power-up or battery replacement, confirm that the seconds register advances before marking the clock valid.

10. Package and Pin Map

DS1285

U_RTC 24-pin plastic DIP connections
Pin Signal Connection
1 MOT +5 V.
2 X1 Y_RTC terminal 1.
3 X2 Y_RTC terminal 2.
4 AD0 Address bit 0 and data bit 0.
5 AD1 Address bit 1 and data bit 1.
6 AD2 Address bit 2 and data bit 2.
7 AD3 Address bit 3 and data bit 3.
8 AD4 Address bit 4 and data bit 4.
9 AD5 Address bit 5 and data bit 5.
10 AD6 Address bit 6, driven low during the address phase; data bit 6.
11 AD7 Address bit 7, driven low during the address phase; data bit 7.
12 GND Ground.
13 /CS IO8_n.
14 AS RTC_AS.
15 R/W CPU R/W.
16 GND Ground.
17 DS RTC_DS.
18 /RESET PERIPH_RESET_n.
19 /IRQ MC68901 GPIP3 and R_RTC_IRQ.
20 VBAT BT_RTC positive terminal.
21 /RCLR Unconnected.
22 NC Unconnected.
23 SQW TP_RTC_SQW test point.
24 VCC +5 V.

Adapter Packages

RTC adapter package assignments
Reference Part Connections
U_RTC_ADDR SN74HCT244N Inputs 0..5: CPU A1..A6; inputs 6..7: ground; outputs: RTC AD0..AD7; both /OE: RTC_ADDR_OE_n.
U_RTC_DATA SN74HCT245N A0..A7: CPU D0..D7; B0..B7: RTC AD0..AD7; DIR: RTC_DATA_DIR; /OE: RTC_DATA_OE_n.
U_RTC_SYNC SN74HCT74N Both clocks: RTC_CLK; first D: +5 V; first Q to second D; both /CLR: RTC_CYCLE; both /PRE: +5 V; second Q: RTC_REQ_SYNC.
U_RTC_SEQ CD74HCT164E A and B: RTC_REQ_SYNC; CLK: RTC_CLK; /CLR: RTC_CYCLE; QA..QF: timing phases; QG and QH: unconnected.
U_RTC_REQ SN74F02N Gate 1 makes RTC_CYCLE; unused inputs are grounded.
U_RTC_INV SN74F04N Three gates invert QB, QC, and CPU R/W; two gates buffer INT_CLK into RTC_CLK; the unused input is grounded.
U_RTC_NAND SN74F00N Three gates make the two driver enables and RTC_DTACK_n; unused inputs are grounded.
U_RTC_AND SN74F08N Two gates make RTC_AS and RTC_DS; unused inputs are grounded.

Each adapter package connects to +5 V and ground. No logic input is left open.

11. Timing and Electrical Checks

RTC Access Timing

The two synchronizer stages add one to two 100 ns periods before RTC_REQ_SYNC rises. Synchronizer latency changes total bus-cycle length, but not the timing between RTC strobes.

DS1285 timing margins at 10 MHz
Requirement DS1285 limit Adapter interval Margin before gate delay and skew
AS high width 60 ns minimum 100 ns 40 ns
Address hold after AS falls 10 ns minimum 100 ns to QC 90 ns
AS falling edge to DS rising edge 40 ns minimum 200 ns to QD 160 ns
Read data access from DS 120 ns maximum 200 ns to QF acknowledgement 80 ns
DS high width 150 ns minimum At least 200 ns before acknowledgement At least 50 ns

A request completes about 700 to 800 ns after qualification, depending on its clock phase. This is inside the motherboard's 51.1 us timeout.

Acknowledgement Release

When LDS_n or IO8_n rises, U_RTC_REQ clears RTC_CYCLE. U_RTC_NAND then releases RTC_DTACK_n without waiting for a clock edge.

U_RTC_REQ SN74F02, tPHL     5.3 ns maximum
U_RTC_NAND SN74F00, tPLH    6.0 ns maximum
group SN74F21, tPLH         5.3 ns maximum
final SN74F21, tPLH         5.3 ns maximum
SN74F32 timeout mask, tPLH  6.6 ns maximum
------------------------------------------------
component total            28.5 ns
MC68EC000 limit           110.0 ns
board allowance            81.5 ns

The strobe rise drives RTC_CYCLE low through the F02 NOR (tPHL) and then drives RTC_DTACK_n high through the F00 NAND (tPLH). Every later stage is also a rising edge.

Logic Levels and Loading

RTC interface loading
Net Added load Result
A6..A1 One HCT244 input per line High-impedance CMOS load.
D7..D0 One HCT245 pin per line High-impedance CMOS load while disabled.
INT_CLK One SN74F04 input The local buffer drives both sequencing clocks.
PERIPH_RESET_n One DS1285 input Polarity and TTL thresholds match.
RTC_IRQ_n 4.7 kohm pull-up and one MFP input 1.12 mA maximum pull-up current at 5.25 V.

The HCT bus parts accept the MC68EC000's TTL levels and keep static loading low. FAST control outputs meet the DS1285's TTL thresholds. Every adapter IC has a 100 nF ceramic bypass capacitor; U_RTC also has a 1 uF local bulk capacitor.

12. Parts Added

RTC subsystem parts
Reference Part Function
U_RTC DS1285 RTC and 50-byte CMOS RAM, 24-pin DIP.
U_RTC_ADDR SN74HCT244N Address-phase driver.
U_RTC_DATA SN74HCT245N Data transceiver.
U_RTC_SYNC SN74HCT74N Two-stage request synchronizer.
U_RTC_SEQ CD74HCT164E Bus-cycle sequencer.
U_RTC_REQ SN74F02N Lower-byte qualification.
U_RTC_INV SN74F04N Inversion and local clock buffer.
U_RTC_NAND SN74F00N Driver enables and acknowledgement.
U_RTC_AND SN74F08N Address and data strobes.
Y_RTC 32.768 kHz, 6 pF crystal; IQD LFXTAL014219B Time base, 50 kohms maximum ESR.
BT_RTC CR2032 and through-hole holder; recommended holder MPD BA2032 Replaceable 3 V backup supply.
R_RTC_IRQ 4.7 kohm, 0.125 W Interrupt pull-up.
TP_RTC_SQW Test point Programmable square-wave output.

The DS1285, CD74HCT164, SN74HCT244, SN74HCT245, SN74HCT74, and 74F gate families were documented before 1994. The adapter adds eight 100 nF ceramic bypass capacitors and one 1 uF capacitor beside U_RTC.

13. Board Layout

14. Internal Signal Reference

RTC subsystem signals
Signal Source Destination
RTC_CYCLE U_RTC_REQ Synchronizer, sequencer, and gates.
RTC_CLK U_RTC_INV U_RTC_SYNC and U_RTC_SEQ.
RTC_REQ_SYNC U_RTC_SYNC U_RTC_SEQ serial inputs.
RTC_AS U_RTC_AND DS1285 address strobe.
RTC_DS U_RTC_AND DS1285 data strobe.
RTC_ADDR_OE_n U_RTC_NAND U_RTC_ADDR enables.
RTC_DATA_OE_n U_RTC_NAND U_RTC_DATA enable.
RTC_DATA_DIR U_RTC_INV U_RTC_DATA direction.
RTC_DTACK_n U_RTC_NAND Motherboard completion tree.
RTC_IRQ_n DS1285 pin 19 MC68901 GPIP3 and R_RTC_IRQ.

15. Sources