DS1338 I2C RTC with 56-Byte NV RAM
whenever the seconds register is written. Write transfers occur on the acknowledge from the DS1338. Once the
countdown chain is reset, to avoid rollover issues the remaining time and date registers must be written within
1 second. The 1Hz square-wave output, if enabled, transitions high 500ms after the seconds data transfer,
provided the oscillator is already running.
Note that the initial power-on state of all registers, unless otherwise specified, is not defined. Therefore, it
is important to enable the oscillator (CH = 0) during initial configuration.
The DS1338 runs in either 12-hour or 24-hour mode. Bit 6 of the hours register is defined as the 12-hour 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). If the 12/24-hour mode select is
changed, the hours register must be re-initialized to the new format.
On an I2C START, the current time is transferred to a second set of registers. The time information is read from
these secondary registers, while the clock continues to run. This eliminates the need to re-read the registers in
case of an update of the main registers during a read.
Table 3. RTC and RAM Address Map
ADDRESS
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
FUNCTION
RANGE
00H
01H
CH
0
10 Seconds
10 Minutes
Seconds
Seconds
Minutes
00–59
00–59
1–12
+AM/PM
00–23
1–7
Minutes
Hour
AM/PM
10
Hour
02H
0
12/24
Hours
10 Hour
0
03H
04H
0
0
0
0
0
0
0
Day
Day
Date
10 Date
Date
Month
Year
01–31
10
Month
05H
0
0
0
Month
01–12
00–99
06H
07H
10 Year
OSF
Year
OUT
0
SQWE
0
RS1
RS0
Control
08H–3FH
RAM 56 x 8
00H–FFH
Note: Bits listed as “0” always read as a 0.
10 of 16