DS2415
4 of 14
TIMEKEEPING
A 32.768kHz crystal oscillator is used as the time base for the real-time clock counter. The oscillator can
be turned on or off under software control. The oscillator must be on for the real-time clock to function.
The real-time clock counter is double-buffered. This allows the master to read time without the data
changing while it is being read. To accomplish this, a snapshot of the counter data is transferred to a
read/write buffer, which the user accesses.
DEVICE CONTROL BYTE
The on/off control of the 32.768kHz crystal oscillator is done through the device control byte. This byte
can be read and written through the Clock Function commands.
Device Control Byte
76543210
U4 U3 U2 U1
OSC
OSC 0 0
Bit 0 - 1 0 No function
Bits 0 and 1 are hard-wired to read all 0s.
Bit 2 - 3 OSC Oscillator Enable/Disable
These bits control/report whether the 32.768kHz crystal oscillator is running. If the oscillator is running,
both OSC bits will read 1. If the oscillator is turned off these bits will read 0. When writing the device
control byte both occurrences of the OSC bit should have identical data. Otherwise, the value in bit
address 3 (bold) takes precedence.
Bit 4 - 7 Un General-purpose user flags
These bits have no particular function within the chip. They can be read and written under the control of
the application software and remain non-volatile as long as there is sufficient voltage at the V
DD
pin. If
the DS2415 is located inside a battery pack, for example, these bits could convey data on the charging
status from the charging station to the equipment that uses the battery.
Real-Time Clock
The real-time clock is a 32-bit binary counter. It is incremented once per second. The real-time clock can
accumulate 136 years of seconds before rolling over. Time/date is represented by the number of seconds
since a reference point, which is determined by the user. For example, 12:00 a.m., January 1, 1970 could
be a reference point.
CLOCK FUNCTION COMMANDS
The “Clock Function Flow Chart” (Figure 5) describes the protocols necessary for accessing the real-time
clock. With only four bytes of real-time clock and one control byte the DS2415 does not provide random
access. Reading and writing always starts with the device control byte followed by the least significant
byte (LSB) of the time data.
DS2415
5 of 14
READ CLOCK [66h]
The Read Clock command is used to read the device control byte and the contents of the real-time clock
counter. After having received the most significant bit of the command code the device copies the actual
contents of the real-time clock counter to the read/write buffer. Now the bus master reads data beginning
with the device control byte followed by the least significant byte through the most significant byte of the
real-time clock. After this the bus master may continue reading from the DS2415. The data received will
be the same as in the first pass through the command flow. The Read Clock command can be ended at
any point by issuing a Reset Pulse.
WRITE CLOCK [99h]
The Write Clock command is used to set the real-time clock counter and to write the device control byte.
After issuing the command, the bus master writes first the device control byte, which becomes
immediately effective. After this the bus master sends the least significant byte through the most
significant byte to be written to the real time clock counter. The new time data is copied from the
read/write buffer to the real time clock counter and becomes effective as the bus master generates a Reset
Pulse. If the oscillator is intentionally stopped the real time clock counter behaves as a 4-byte nonvolatile
memory.
DS2415
6 of 14
CLOCK FUNCTION COMMAND FLOW CHART Figure 5

DS2415P+

Mfr. #:
Manufacturer:
Maxim Integrated
Description:
Real Time Clock
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet