Low-Current, SPI-Compatible
Real-Time Clock
10 Maxim Integrated
DS1347
Reading the Clock
Reading the Timekeeping Registers
The main timekeeping registers (Seconds, Minutes,
Hours, Date, Month, Day, Year) can be read with either
single reads or a burst read. In the device, a latch
buffers each clock counter’s data. Clock counter data
is latched by the SPI read command (on the falling
edge of SCLK, after the address/command byte has
been sent by the master to read a timekeeping regis-
ter). Collision-detection circuitry ensures that this does
not happen coincident with a Seconds counter incre-
ment to ensure accurate time data is read. The clock
counters continue to count and keep accurate time dur-
ing the read operation.
The simplest way to read the timekeeping registers is to
use a burst read. In a burst read, the main timekeeping
registers (Seconds, Minutes, Hours, Date, Month, Day,
Year), and the Control register are read sequentially, in
the order listed with the Seconds register first. They are
read out as a group of eight registers, with 8 bits each.
All timekeeping registers (except Century) are latched
upon the receipt of the burst read command. The
worst-case error between the “actual” time and the
“read” time is 1s for a normal data transfer.
The timekeeping registers can also be read using sin-
gle reads. If single reads are used, it is necessary to do
some error checking on the receiving end, because it is
possible that the clock counters could change during
the read operations, and report inaccurate time data.
The potential for error is when the Seconds register
increments before all the registers are read. For exam-
ple, suppose a carry of 13:59:59 to 14:00:00 occurs
during single read operations. The net data read could
be 14:59:59, which is erroneous. To prevent errors from
occurring with single read operations, read the
Seconds register first (initial-seconds) and store this
value for future comparison. After the remaining time-
keeping registers have been read, reread the Seconds
register (final-seconds). Check that the final-seconds
value equals the initial-seconds value. If not, repeat the
entire single read process. Using single reads at a
100kHz serial speed, it takes under 2.5ms to read all
seven of the timekeeping registers, including two reads
of the Seconds register.
Example: Reading the Clock
with a Burst Read
To read the time with a burst read, send BFh as the
Address/Command byte. Then clock out 8 bytes,
Seconds, Minutes, Hours, Date of the month, Month,
Day of the week, Year, and finally the Control byte. All
data is output MSB first. Decode the required informa-
tion based on the register definitions listed in Table 1.
Using the Alarm
A polled alarm function is available by reading the ALM
OUT bit. The ALM OUT bit is D7 of the Minutes time-
keeping register. A logic 1 in ALM OUT indicates the
Alarm function is triggered. There are eight registers
associated with the alarm function—seven programma-
ble alarm threshold registers and one programmable
Alarm Configuration register. The Alarm Configuration
register determines which alarm threshold registers are
compared to the timekeeping registers, and the ALM
OUT bit sets if the compared registers are equal. Table
1 shows the function of each bit of the Alarm
Configuration register. Placing a logic 1 in any given bit
of the Alarm Configuration register enables the respec-
tive alarm function. For example, if the Alarm
Configuration register is set to 0000 0011, ALM OUT is
set when both the minutes and seconds indicated in
the alarm threshold registers match the respective
timekeeping registers. Once set, ALM OUT stays high
until it is cleared by reading or writing to the Alarm
Configuration register, or by reading or writing to any of
the alarm threshold registers. The Alarm Configuration
register is located at address 15h, and is initialized to
00h on the first application of power.
Using the On-Board RAM
The static RAM is 31 x 8 bits addressed consecutively
in the RAM Address/Command space. Table 1 details
the specific hex address/commands for reads and
writes to each of the 31 locations of RAM. The contents
of the RAM are static and remain valid for V
CC
down to
2V. All RAM data is lost if power is cycled. The write-
protect bit (WP in the Control register), when high, dis-
allows any writes to RAM. The RAM’s power-on state is
undefined.
Low-Current, SPI-Compatible
Real-Time Clock
Maxim Integrated 11
DS1347
Control Register (0Fh)
Status Register (17h)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
WP 0 0 0 0 0 0 ID
0 0 0 0 0 0 0 0
BIT 7
WP: Write-Protect RAM. If the WP bit is logic one, writing to the 31 bytes of RAM is inhibited. This bit is cleared
(0) when power is first applied.
BIT 0
ID: Device Identification Bit. The content of this bit does not alter the component functionality. This bit is cleared
(0) when power is first applied.
Alarm Configuration Register (15h)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
0 YEAR DAY MONTH DATE HOUR MINUTE SECOND
0 0 0 0 0 0 0 0
Alarm Seconds Register (19h)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
0 10 SECONDS SECONDS
0 1 1 1 1 1 1 1
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
EOSC DOSF EGFIL 0 0 OSF 0 0
0 0 0 0 0 1 1 1
BIT 7
EOSC: Enable Oscillator. When the EOSC bit is logic 0, the oscillator is enabled. When this bit is logic 1, the
oscillator is disabled. This bit is cleared (0) when power is first applied.
BIT 6
DOSF: Disable Oscillator Stop Flag. When the DOSF bit is set to 1, sensing of the oscillator conditions that would
set the OSF bit is disabled. OSF remains at 0 regardless of what happens to the oscillator. This bit is cleared (0)
on the initial application of power.
BIT 5
EGFIL: Enable Glitch Filter. When the EGFIL bit is 1, the 5μs glitch filter at the output of crystal oscillator is
enabled. The glitch filter is disabled when this bit is 0. This bit is cleared (0) on the initial application of power.
BIT 2
OSF: Oscillator Stop Flag. If the OSF bit is 1, the oscillator either has stopped or was stopped for some period and
could be used to judge the validity of the clock and calendar data. This bit is edge triggered and is set to 1 when
the internal circuitry senses the oscillator has transitioned from a normal run state to a stop condition. This bit
remains at logic 1 until written to logic 0. Attempting to write OSF to 1 leaves the value unchanged. The following
are examples of conditions that can cause the OSF bit to be set:
1) The first time power is applied.
2) The voltage present on V
CC
is insufficient to support oscillation.
3) The EOSC bit is set to logic 1.
4) External influences on the crystal (i.e., noise, leakage, etc.).
Low-Current, SPI-Compatible
Real-Time Clock
12 Maxim Integrated
DS1347
SPI-Compatible Serial Interface
Interface the device with a microcontroller using a serial,
4-wire, SPI interface. SPI is a synchronous bus for
address and data transfer, and is used with Motorola or
other microcontrollers that have an SPI port. Four con-
nections are required for the interface: DOUT (serial-
data out); DIN (serial-data in); SCLK (serial clock); and
CS (chip select). In an SPI application, the device acts
as a slave device and the microcontroller acts as the
master. CS is asserted low by the microcontroller to initi-
ate a transfer, and deasserted high to terminate a trans-
fer. DIN transfers input data from the microcontroller to
the device. DOUT transfers output data from the device
to the microcontroller. A shift clock, SCLK, is used to
synchronize data movement between the microcon-
troller and the device. SCLK, which is generated by the
Alarm Minutes Register (1Bh)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
0 10 MINUTES MINUTES
0 1 1 1 1 1 1 1
Alarm Hours Register (1Dh)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
AM/PM
12/24 0
20 HR
10 HR HOURS
1 0 1 1 1 1 1 1
Alarm Date Register (1Fh)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
0 0 10 DATE DATE
0 0 1 1 1 1 1 1
Alarm Month Register (21h)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
0 0 0 10 MO MONTH
0 0 0 1 1 1 1 1
Alarm Day Register (23h)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
0 0 0 0 0 DAY
0 0 0 0 0 1 1 1
Alarm Year Register (25h)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
10 YEAR YEAR
1 1 1 1 1 1 1 1

DS1347T+

Mfr. #:
Manufacturer:
Maxim Integrated
Description:
Real Time Clock Low Power SPI RTC For 12.5Pf Crystal
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet