DS1306
Serial Alarm Real-Time Clock
www.maxim-ic.com
FEATURES
§
Real-Time Clock (RTC) Counts Seconds,
Minutes, Hours, Date of the Month, Month,
Day of the Week, and Year with Leap-Year
Compensation Valid Up to 2100
96-Byte, Battery-Backed NV RAM for Data
Storage
Two Time-of-Day Alarms, Programmable on
Combination of Seconds, Minutes, Hours,
and Day of the Week
1Hz and 32.768kHz Clock Outputs
Supports Motorola SPI
™
(Serial Peripheral
Interface) Modes 1 and 3 or Standard 3-Wire
Interface
Burst Mode for Reading/Writing Successive
Addresses in Clock/RAM
Dual-Power Supply Pins for Primary and
Backup Power Supplies
Optional Trickle Charge Output to Backup
Supply
2.0V to 5.5V Operation
Optional Industrial Temperature Range:
-40°C to +85°C
Available in Space-Efficient, 20-Pin TSSOP
Package
Underwriters Laboratory (UL) Recognized
PIN CONFIGURATIONS
V
CC2
V
BAT
X1
N.C.
X2
N.C.
INT0
INT1
1Hz
GND
1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
V
CC1
N.C.
32kHz
V
CCIF
SDO
SDI
SCLK
N.C.
CE
SERMODE
§
§
§
§
§
§
§
§
§
§
§
TSSOP (4.4mm)
1
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9
V
CC2
V
BAT
X1
X2
INT0
INT1
1Hz
GND
V
CC1
32kHz
V
CCIF
SDO
SDI
SCLK
CE
SERMODE
DIP (300 mils)
Package Dimension Information can be found at:
www.maxim-ic.com/DallasPackInfo
TYPICAL OPERATING CIRCUIT
SPI is a trademark of Motorola, Inc.
1 of 21
REV: 071105
DS1306
ORDERING INFORMATION
PART
DS1306
DS1306+
DS1306N
DS1306N+
DS1306E+
DS1306EN+
DS1306EN+T&R
DS1306E+T&R
DS1306E
DS1306EN
DS1306EN/T&R
DS1306E/T&R
TEMP RANGE PIN-PACKAGE
0°C to +70°C
0°C to +70°C
-40°C to +85°C
0°C to +70°C
0°C to +70°C
-40°C to +85°C
-40°C to +85°C
0°C to +70°C
0°C to +70°C
-40°C to +85°C
-40°C to +85°C
0°C to +70°C
16 DIP (300 mils)
16 DIP (300 mils)
16 DIP (300 mils)
16 DIP (300 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
20 TSSOP (173 mils)
TOP MARK*
DS1306
DS1306 +
DS1306N
DS1306N +
DS1306 +
DS1306N +
DS1306N +
DS1306 +
DS1306
DS1306N
DS1306N
DS1306
+ Denotes a lead-free/RoHS-compliant device.
* An “N” on the top mark indicates an industrial device.
PIN DESCRIPTION
PIN
TSSOP
DIP
1
1
NAME
V
CC2
FUNCTION
Backup Power Supply.
This is the secondary power supply pin. In systems
using the trickle charger, the rechargeable energy source is connected to this
pin.
Battery Input for Any Standard +3V Lithium Cell or Other Energy
Source.
If not used, V
BAT
must be connected to ground. Diodes must not be
placed in series between V
BAT
and the battery, or improper operation will
result. UL recognized to ensure against reverse charging current when used
in conjunction with a lithium battery. See “Conditions of Acceptability” at
www.maxim-ic.com/TechSupport/QA/ntrl.htm.
Connections for Standard 32.768kHz Quartz Crystal.
The internal
oscillator is designed for operation with a crystal having a specified load
capacitance of 6pF. For more information on crystal selection and crystal
layout considerations, refer to
Application Note 58,
“Crystal Considerations
with Dallas Real-Time Clocks.” The DS1306 can also be driven by an
external 32.768kHz oscillator. In this configuration, the X1 pin is connected
to the external oscillator signal and the X2 pin is floated.
Active-Low Interrupt 0 Output.
The
INT0
pin is an active-low output of
the DS1306 that can be used as an interrupt input to a processor. The
INT0
pin can be programmed to be asserted by Alarm 0. The
INT0
pin remains
low as long as the status bit causing the interrupt is present and the
corresponding interrupt enable bit is set. The
INT0
pin operates when the
DS1306 is powered by V
CC1
, V
CC2
, or V
BAT
. The
INT0
pin is an open-drain
output and requires an external pullup resistor.
Interrupt 1 Output.
The INT1 pin is an active high output of the DS1306
that can be used as an interrupt input to a processor. The INT1 pin can be
programmed to be asserted by Alarm 1. When an alarm condition is present,
the INT1 pin generates a 62.5ms active-high pulse. The INT1 pin operates
only when the DS1306 is powered by V
CC2
or V
BAT
. When active, the INT1
pin is internally pulled up to V
CC2
or V
BAT
. When inactive, the INT1 pin is
internally pulled low.
2 of 21
2
2
V
BAT
3
3
X1
5
4
X2
7
5
INT0
8
6
INT1
DS1306
PIN DESCRIPTION (continued)
PIN
TSSOP
DIP
9
10
11
7
8
9
NAME
FUNCTION
1Hz Output.
The 1Hz pin provides a 1Hz square wave output. This output
is active when the 1 Hz bit in the control register is a logic 1. Both
INT0
and
1Hz
1Hz pins are open-drain outputs. The interrupt, 1Hz signal, and the internal
clock continue to run regardless of the level of V
CC
(as long as a power
source is present).
GND
Ground
Serial Interface Mode.
The SERMODE pin offers the flexibility to choose
between two serial interface modes. When connected to GND, standard
SERMODE
3-wire communication is selected. When connected to V
CC
, SPI
communication is selected.
Chip Enable.
The chip enable signal must be asserted high during a read or
CE
a write for both 3-wire and SPI communication. This pin has an internal 55k
pulldown resistor (typical).
Serial Clock.
SCLK is used to synchronize data movement on the serial
SCLK
interface for either the SPI or 3-wire interface.
Serial Data In.
When SPI communication is selected, the SDI pin is the
serial data input for the SPI bus. When 3-wire communication is selected,
SDI
this pin must be tied to the SDO pin (the SDI and SDO pins function as a
single I/O pin when tied together).
Serial Data Out.
When SPI communication is selected, the SDO pin is the
serial data output for the SPI bus. When 3-wire communication is selected,
SDO
this pin must be tied to the SDI pin (the SDI and SDO pins function as a
single I/O pin when tied together). V
CCIF
provides the logic high level.
Interface Logic Power-Supply Input.
The V
CCIF
pin allows the DS1306 to
drive SDO and 32kHz output pins to a level that is compatible with the
V
CCIF
interface logic, thus allowing an easy interface to 3V logic in mixed supply
systems. This pin is physically connected to the source connection of the p-
channel transistors in the output buffers of the SDO and 32kHz pins.
32.768kHz Output.
The 32kHz pin provides a 32.768kHz output. This
32kHz
signal is always present. V
CCIF
provides the logic high level.
Primary Power Supply.
DC power is provided to the device on this pin.
V
CC1
V
CC1
is the primary power supply.
N.C.
No Connection
12
14
15
10
11
12
16
13
17
14
18
20
4, 6, 13,
19
15
16
—
3 of 21
DS1306
DESCRIPTION
The DS1306 serial alarm real-time clock (RTC) provides a full binary coded decimal (BCD) clock
calendar that is accessed by a simple serial interface. The clock/calendar provides seconds, minutes,
hours, day, date, month, and year information. The end of the month date is automatically adjusted for
months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-
hour or 12-hour format with AM/PM indicator. In addition, 96 bytes of NV RAM are provided for data
storage.
An interface logic-power supply input pin (V
CCIF
) allows the DS1306 to drive SDO and 32kHz pins to a
level that is compatible with the interface logic. This allows an easy interface to 3V logic in mixed supply
systems. The DS1306 offers dual-power supplies as well as a battery-input pin. The dual-power supplies
support a programmable trickle charge circuit that allows a rechargeable energy source (such as a super
cap or rechargeable battery) to be used for a backup supply. The V
BAT
pin allows the device to be backed
up by a non-rechargeable battery. The DS1306 is fully operational from 2.0V to 5.5V.
Two programmable time-of-day alarms are provided by the DS1306. Each alarm can generate an
interrupt on a programmable combination of seconds, minutes, hours, and day. “Don’t care” states can be
inserted into one or more fields if it is desired for them to be ignored for the alarm condition. A 1Hz and a
32kHz clock output are also available.
The DS1306 supports a direct interface to SPI serial data ports or standard 3-wire interface. An easy-to-
use address and data format is implemented in which data transfers can occur 1 byte at a time or in
multiple-byte burst mode.
OPERATION
The block diagram in Figure 1 shows the main elements of the serial alarm RTC. The following
paragraphs describe the function of each pin.
Figure 1. BLOCK DIAGRAM
1Hz
4 of 21
DS1306
RECOMMENDED LAYOUT FOR CRYSTAL
Local ground plane (Layer 2)
X1
crystal
X2
GND
CLOCK ACCURACY
The accuracy of the clock is dependent upon the accuracy of the crystal and the accuracy of the match
between the capacitive load of the oscillator circuit and the capacitive load for which the crystal was
trimmed. Additional error is added by crystal frequency drift caused by temperature shifts. External
circuit noise coupled into the oscillator circuit can result in the clock running fast. Refer to
Application
Note 58: Crystal Considerations with Dallas Real-Time Clocks
for detailed information.
CLOCK, CALENDAR, AND ALARM
The time and calendar information is obtained by reading the appropriate register bytes. The RTC
registers are illustrated in Figure 2. The time, calendar, and alarm are set or initialized by writing the
appropriate register bytes. Note that some bits are set to 0. These bits always read 0 regardless of how
they are written. Also note that registers 12h to 1Fh (read) and registers 92h to 9Fh are reserved. These
registers always read 0 regardless of how they are written. The contents of the time, calendar, and alarm
registers are in the BCD format.. Values in the day register that correspond to the day of the week are
user-defined, but must be sequential (e.g. if 1 equals Sunday, 2 equals Monday and so on). The day
register increments at midnight. Illogical time and date entries result in undefined operation.
WRITING TO THE CLOCK REGISTERS
The internal time and date registers continue to increment during write operations. However, the
countdown chain is reset when the seconds register is written. Writing the time and date registers within
one second after writing the seconds register ensures consistent data.
Terminating a write before the last bit is sent aborts the write for that byte.
READING FROM THE CLOCK REGISTERS
Buffers are used to copy the time and date register at the beginning of a read. When reading in burst
mode, the user copy is static while the internal registers continue to increment.
5 of 21