The DS1202 Serial Timekeeping Chip contains a real
time clock/calendar and 24 bytes of static RAM. It communicates with a microprocessor via a simple serial interface. The real time clock/calendar provides seconds,
minutes, hours, day, date, month, and year information.
The end of the month date is automatically adjusted for
months with less than 31 days, including corrections for
leap year. The clock operates in either the 24–hour or
12–hour format with an AM/PM indicator. Interfacing the
PIN ASSIGNMENT
V
8
CC
7
SCLK
6
I/O
5
RST
8
V
CC
7
SCLK
6
I/O
5
RST
16
V
15
14
13
12
11
10
CC
NC
SCLK
NC
I/O
NC
NC
9
RST
NC
NC
NC
NC
NC
GND
NC
1
X1
2
X2
3
GND
4
8–PIN DIP
1
NC
2
X1
3
X2
4
GND
8–PIN SOIC
(208 mil)
1
2
3
X1
4
5
X2
6
7
8
16–PIN SOIC
PIN DESCRIPTION
NC– No Connection
X1, X2– 32.768 KHz Crystal Input
GND– Ground
RST
I/O– Data Input/Output
SCLK– Serial Clock
V
CC
DS1202 with a microprocessor is simplified by using
synchronous serial communication. Only three wires
are required to communicate with the clock/RAM: (1)
(Reset), (2) I/O (Data line), and (3) SCLK (Serial
RST
clock). Data can be transferred to and from the clock/
RAM one byte at a time or in a burst of up to 24 bytes.
The DS1202 is designed to operate on very low power
and retain data and clock information on less than 1 microwatt.
– Reset
– Power Supply Pin
Copyright 1997 by Dallas Semiconductor Corporation.
All Rights Reserved. For important information regarding
patents and other intellectual property rights, please refer to
Dallas Semiconductor data books.
032697 1/11
DS1202, DS1202S
OPERATION
The main elements of the Serial Timekeeper are shown
in Figure 1: shift register, control logic, oscillator, real
time clock, and RAM. To initiate any transfer of data,
is taken high and eight bits are loaded into the shift
RST
register providing both address and command information. Data is serially input on the rising edge of the SCLK.
The first eight bits specify which of 32 bytes will be accessed, whether a read or write cycle will take place,
and whether a byte or burst mode transfer is to occur.
After the first eight clock cycles have occurred which
load the command word into the shift register, additional
clocks will output data for a read or input data for a write.
DS1202 BLOCK DIAGRAM Figure 1
I/O
INPUT SHIFT
REGISTERS
REAL TIME
CLOCK
The number of clock pulses equals eight plus eight for
byte mode or eight plus up to 192 for burst mode.
COMMAND BYTE
The command byte is shown in Figure 2. Each data
transfer is initiated by a command byte. The MSB (Bit 7)
must be a logic 1. If it is zero, further action will be terminated. Bit 6 specifies clock/calendar data if logic 0 or
RAM data if logic 1. Bits one through five 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).
32.768 KHz
X2X1
OSCILLATOR
AND DIVIDER
DATA BUS
SCLK
RST
COMMAND AND
CONTROL LOGIC
ADDRESS/COMMAND BYTE Figure 2
RAM
6
CK
5
A4
7
1
032697 2/11
ADDRESS BUS
4
A3
3
A2
2
A1
1
A0
24 X 8 RAM
0
RD
W
DS1202, DS1202S
RESET AND CLOCK CONTROL
All data transfers are initiated by driving the RST input
high. The RST input serves two functions. First, RST
turns on the control logic which allows access to the shift
register for the address/command sequence. Second,
signal provides a method of terminating either
the RST
single byte or multiple byte data transfer. A clock cycle is
a sequence of a falling edge followed by a rising edge.
For data inputs, data must be valid during the rising
edge of the clock and data bits are output on t he falling
edge of clock. All data transfer terminates if the RST
put is low and the I/O pin goes to a high impedance
state. Data transfer is illustrated in Figure 3.
in-
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. Due to the inherent nature of the logic
state machine, writing times containing an absolute
value of “59” seconds should be avoided.
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 RST
tion permits continuous burst mode read capability.
Data is output starting with bit 0.
remains high. This opera-
Each byte that is written to will be transferred to RAM
regardless of whether all 24 bytes are written or not.
CLOCK/CALENDAR
The clock/calendar is contained in eight write/read registers as shown in Figure 4. Data contained in the clock/
calendar registers is in binary coded decimal format
(BCD).
CLOCK HALT FLAG
Bit 7 of the seconds register is defined as the clock halt
flag. When this bit is set to logic 1, the clock oscillator is
stopped and the DS1202 is placed into a low–power
standby mode with a current drain of not more than 100
nanoamps. When this bit is written to logic 0, the clock
will start.
AM–PM/12–24 MODE
Bit 7 of the hours register is defined as 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).
WRITE PROTECT BIT
Bit 7 of the control register is the write protect bit. The
first seven bits (bits 0–6) are forced to zero and will always read a zero when read. Before any write operation
to the clock or RAM, bit 7 must be zero. When high, the
write protect bit prevents a write operation to any other
register.
BURST MODE
Burst mode may be specified for either the clock/calendar or the RAM registers by addressing location 31 decimal (address/command bits one through five = logical
one). As before, bit six specified clock or RAM and bit 0
specifies read or write. There is no data storage capacity at locations 8 through 31 in the Clock/Calendar Registers or locations 24 through 31 in the RAM registers.
When writing to the clock registers in the burst mode,
the first eight registers 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 24 bytes for the data to transfer.
CLOCK/CALENDAR BURST MODE
The clock/calendar command byte specifies burst
mode operation. In this mode the eight clock/calendar
registers can be consecutively read or written (see Figure 4) starting with bit 0 of address 0.
RAM
The static RAM is 24 x 8 bytes addressed consecutively
in the RAM address space.
RAM BURST MODE
The RAM command byte specifies burst mode operation. In this mode, the 24 RAM registers can be consecutively read or written (see Figure 4) starting with bit 0 of
address 0.
032697 3/11
DS1202, DS1202S
REGISTER SUMMARY
A register data format summary is shown in Figure 4.
CRYSTAL SELECTION
A 32.768 KHz crystal, can be directly connected to the
DS1202 via pins 2 and 3 (X1, X2). The crystal selected
for use should have a specified load capacitance (CL) of
6 pF . The crystal is connected directly to the X1 and X2
DATA TRANSFER SUMMARY Figure 3
SINGLE BYTE TRANSFER
SCLK
RST
I/O
BURST MODE TRANSFER
SCLK
0123456701 23456 7
R/W
A0A1A2A3A41
ADDRESS COMMANDDATA INPUT/OUTPUT
R/C
pins. There is no need for external capacitors or resistors. Note: X1 and X2 are very high impedance nodes.
It is recommended that they and the crystal be guard–
ringed with ground and that high frequency signals be
kept away from the crystal area. For more information
on crystal selection and crystal layout considerations,
please consult Application Note 58, “Crystal Considerations with Dallas Real Time Clocks”.
RST
I/O
0123456701 2456 7
R/W
111111
ADDRESS COMMANDDATA I/O BYTE N
FUNCTIONBYTE NSCLK n
CLOCK872
RAM24200
032697 4/11
R/C
DATA I/O BYTE 1
REGISTER ADDRESS/DEFINITION Figure 4
REGISTER ADDRESSREGISTER DEFINITION
A. CLOCK
0
1
RD
W
00–59
CHSEC10 SEC
SEC
7
6
1
050403020
0
DS1202, DS1202S
MIN
HR
DATE
MONTH
DAY
YEAR
CONTROL
CLOCK
BURST
B. RAM
100001
0
100010
0
100011
0
100100
0
100101
0
100110
0
100111
0
111111
0
RD
RD
RD
RD
RD
RD
RD
RD
0
W
W
W
W
W
W
W
W
00–59
01–12
00–23 24
01–28/29
01–30
01–31
01–12
01–07
0–99
12/
010 DATE0
00
0
0000
10 YEAR
WP
10
HRHR0
A/P
10
M
FORCED TO ZERO
MIN10 MIN
DATE
MONTH
DAY0
YEAR
RAM 0
RAM 23
RAM
BURST
100000
1
110111
1
111111
1
RD
RD
RD
W
W
W
RAM DATA 0
RAM DATA 23
032697 5/11
DS1202, DS1202S
Logic 0 I
t
V
V
1
Logic 1 Output
V
V
2
Logic 0 Output
V
V
3
Acti
t
I
A
5
Timek
t
I
A
4
Leak
t
I
A
10
ABSOLUTE MAXIMUM RATINGS*
Voltage on Any Pin Relative to Ground–0.3V to +7.0V
Operating Temperature0°C to 70°C
Storage Temperature–55°C to +125°C
Soldering Temperature260°C for 10 seconds
* This is a stress rating only and functional operation of the device at these or any other conditions above those
indicated in the operation sections of this specification is not implied. Exposure to absolute maximum rating
conditions for extended periods of time may affect reliability.
RECOMMENDED DC OPERATING CONDITIONS (0°C to 70°C)
PARAMETERSYMBOLMINTYPMAXUNITSNOTES
Supply VoltageV
Logic 1 InputV
npu
CC
IH
VCC=2.0V–0.3+0.3
IL
VCC=5V–0.3+0.8
2.05.5V1
2.0VCC+0.3V1
DC ELECTRICAL CHARACTERISTICS (0°C to 70°C; VCC = 2.0 to 5.5V*)