hw-rtc-ds1x42 (librtc.la :: rtc_component_library)


The Dallas DS1642 and DS1742 are time-keeping NVRAM devices. The DS1742 is Y2K compliant as it maintains a century field in a section of NVRAM that was previously reserved by Dallas in the DS1642.



The DS1x42 components model real time using a single pin that can be driven at a simulated interval representing one second. For modelling time in the target domain, a target scheduler may be used. For modelling real "wall-clock" time, the host scheduler may be used.

The DS1x42 have a "frequency test" function that involves toggling the least significant bit of the "seconds" register at an idealized frequency of 512Hz. When managed by a sid scheduler component, the actual frequency is around 500Hz.


Whenever the clock input is driven, it is interpreted as a signal that one second has passed. An internal counter is incremented and all the time-related registers are recomputed. The counter is accessible by the epoch-time attribute.

frequency testing

When the clock-control and clock-event pin-pair is connected to an external scheduler, the DS1642 standard "test bit" is toggled at an approximate simulated frequency.

register access

The DS1642/DS1742 control registers and 2048-byte NVRAM are accessed across the read-write-port bus for byte-wide operations. The control registers are also exposed as attributes.

This family of parts includes 2KB of non-volatile RAM. This component does not explicitly model this memory. Instead, it interacts through the memory-bus accessor with an external memory like hw-memory-ram/rom-basic.

SID Conventions
functional supported -
save/restore supported -
triggerpoints supported

They support setting triggerpoints on the state of data with the following names:

"epoch-time" Canonical internal representation of time.
"oscillating" The oscillator is connected.
"write-mode" The device is in write mode, for updates.


Related components

Host system

Component Reference:

Component: hw-rtc-ds1x42 (Abstract)

clock-controloutpositive numberfrequency testing
clock-eventin-frequency testing

read-write-port0x0 - 0x7FFread/write byte-wideregister access

namecategorylegal valuesdefault valuebehaviors
epoch-time-uint 32-timekeeping
yearregister0..99-register access
monthregister1..12-register access
dateregister1..31-register access
day-of-weekregister1..7-register access
hourregister0..23-register access
minuteregister0..59-register access
secondregister0..59-register access
state-snapshot-opaque-state save/restore
tk xclock clone-"hw-visual-clock"-component gui

memory-busbyte-wideregister access

Variant: hw-rtc-ds1642

Same as hw-rtc-ds1x42

Variant: hw-rtc-ds1742

namecategorylegal valuesdefault valuebehaviors
centuryregister19..25-register access


Dallas Semiconductor DS1642 data sheet, revision 031698; DS1742 data sheet, revision 091498. Available online, or in our local archives.