DS1302 Trickle-Charge Timekeeping Chip
4 of 13
PIN DESCRIPTION
PIN NAME FUNCTION
1 V
CC2
Primary Power-Supply Pin in Dual Supply Configuration. V
CC1
is connected to a
backup source to maintain the time and date in the absence of primary power. The
DS1302 operates from the larger of V
CC1
or V
CC2
. When V
CC2
is greater than V
CC1
+
0.2V, V
CC2
powers the DS1302. When V
CC2
is less than V
CC1
, V
CC1
powers the
DS1302.
2 X1
3 X2
Connections for Standard 32.768kHz Quartz Crystal. The internal oscillator is
designe
d 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 for Dallas Real-Time Clocks. The
DS1302 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.
4 GND Ground
5 CE
Input. CE signal must be asserted high during a read or a write. This pin has an
internal 40kΩ (typ) pulldown resi
stor to ground. Note: Previous data sheet revisions
referred to CE as RST. The functionality of the pin has not changed.
6 I/O
Input/Push-Pull Output. The I/O pin is the bidirectional data pin for the 3-wire
interface. Thi
s pin has an internal 40kΩ (typ) pulldown resistor to ground.
7 SCLK
Input. SCLK is used to synchronize data movement on the serial interface. Thi
s pin
has an internal 40kΩ (typ) pulldown resistor to ground.
8 V
CC1
Low-Power Operation in Single Supply and Battery-Operated Systems an
d Low-
Power Battery Backup. In systems using the trickle charger, the rechargeable
energy source is connected to this pin. UL recognized to ensure against reverse
charging current when used with a lithium battery. Go to
www.maxim-
ic.com/TechSupport/QA/ntrl.htm.
DS1302 Trickle-Charge Timekeeping Chip
5 of 13
OSCILLATOR CIRCUIT
The DS1302 uses an external 32.768kHz crystal. The oscillator circuit does not require any external resistors or
capacitors to operate. Table 1 specifies several crystal parameters for the external crystal. Figure 1 shows a
functional schematic of the oscillator circuit. If using a crystal wit
h the specified characteristics, the startup time is
usually less than one second.
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 will be added by crystal frequency drift caused by temperature shifts. External circuit noise coupled into the
oscillator circuit may result in the clock running fast.
Figure 2 shows a typical PC board layout for isolating the
crystal and oscillator from
noise. Refer to Application Note 58: Crystal Considerations for Dallas Real-Time Clocks
for detailed information.
Table 1. Crystal Specifications*
PARAMETER SYMBOL MIN TYP MAX UNITS
Nominal Frequency f
O
32.768 kHz
Series Resistance ESR 45
kΩ
Load Capacitance C
L
6 pF
*The crystal, traces, and crystal input pins should be isolated from RF generating signals. Refer to
Application Note 58: Crystal Considerations for Dallas Real-Time Clocks for additional specifications.
Figure 2. Typical PC Board Layout for Crystal
LOCAL GROUND PLANE (LAYER 2)
CRYSTAL
X1
X2
GND
NOTE:
A
VOID ROUTING SIGNALS IN THE
CROSSHATCHED AREA (UPPER LEFT-
HAND QUADRANT) OF THE PACKAGE
UNLESS THERE IS A GROUND PLANE
BETWEEN THE SIGNAL LINE AND THE
PACKAGE.
COMMAND BYTE
Figure 3 shows the command byte. A command byte initiates each data transfer. The MSB (bit 7) must be a logic
1. If it is 0, writes to the DS1302 will be disabled. Bit 6 specifies clock/calendar data if logic 0 or RAM data if logic 1.
Bits 1 to 5 specify the designated registers to be input or output, and the LSB (bit 0) specifies a write operation
(input) if logic 0 or read operation (output) if logic 1. The command byte is always input starting with the LSB (bit 0).
Figure 3. Address/Command Byte
1
RAM
CK
A4 A3 A2 A1 A0
RD
WR
76543210
DS1302 Trickle-Charge Timekeeping Chip
6 of 13
CE AND CLOCK CONTROL
Driving the CE input high initiates all data transfers. The CE input serves two functions. First, CE turns on the
control logic that allows access to the shift register for the address/command sequence. Second, the CE signal
provides a method of terminating either single-byte or multiple-byte CE data transfer.
A clock cycle is a sequence of a rising edge followed by a falling edge. For data inputs, data must be valid durin
g
the rising edge of the clock and data bits are output on the falling edge of clock. If the CE input is low, all data
transfer terminates and the I/O pin goes to a high-impedance state.
Figure 4 shows data transfer. At power-up, CE
must be a logic 0 until V
CC
> 2.0V. Also, SCLK must be at a logic 0 when CE is driven to a logic 1 state.
DATA INPUT
Following the eight SCLK cycles that input a write command byte, a data byte is input on the rising edge of the next
eight SCLK cycles. Additional SCLK cycles are ignored should they inadvertently occur. Data is input starting with
bit 0.
DATA OUTPUT
Following the eight SCLK cycles that input a read command byte, a data byte is output on the falling edge of the
next eight SCLK cycles. Note that the first data bit to be transmitted occurs on the first falling edge after the last bit
of the command byte is written. Additional SCLK cycles retransmit the data bytes should they inadvertently occur
so long as CE remains high. This operation permits continuous burst mode read capability. Also, the I/O pin is tri-
stated upon each rising edge of SCLK. Data is output starting with bit 0.
BURST MODE
Burst mode can be specified for either the clock/calendar or the RAM registers by addressing location 31 decimal
(address/command bits 1 through 5 = logic 1). As before, bit 6 specifies clock or RAM and bit 0 specifies read or
write. There is no data storage capacity at locations 9 through 31 in the Clock/Calendar Registers or location 31 in
the RAM registers. Reads or writes in burst mode start with bit 0 of address 0.
When writing to the clock registers in the burst mode, the first eig
h
t regi
ste
r
s must be written in order for the data to
be transferred. However, when writing to RAM in burst mode it is not necessary to write all 31 bytes for the data to
transfer. Each byte that is written to will be transferred to RAM regardless of whether all 31 bytes are written or not.
CLOCK/CALENDAR
The time and calendar information is obtained by reading the appropriate register bytes. Table 3 illustrates the RTC
registers. The time and calendar are set or initialized by writing the appropriate register bytes. The contents of the
time and calendar registers are in the binary-coded decimal (BCD) format.
The day-of-week register increments at midnight. Values that correspond to the day of we
ek are user-defined but
must be sequential (i.e., if 1 equals Sunday, then 2 equals Monday, and so on.). Illogical time and date entries
result in undefined operation.
When reading or writing the time and date registers, secondary (user) buffers are used to
prevent errors when the
internal registers update. When reading the time and date registers, the user buffers are synchronized to the
internal registers the rising edge of CE.
The countdown chain is reset whenever the seconds register is written. Write transfers occur on the falling edg
e of
CE. To avoid rollover issues, once the countdown chain is reset, the remaining time and date registers must be
written within 1 second.
The DS1302 can be run in either 12-hour or 24-hour mode. Bit 7 of the hours register is defined a
s the 12- or 24-
hour mode-select bit. When high, the 12-hour mode is selected. In the 12-hour mode, bit 5 is the
AM/PM bit with
logic high being PM. In the 24-hour mode, bit 5 is the second 10-hour bit (20–23 hours). The hours data must be
re-initialized whenever the 12/
24 bit is changed.

DS1302N

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