DS3231
Operation
The block diagram shows the main elements of the
DS3231. The eight blocks can be grouped into four
functional groups: TCXO, power control, pushbutton
function, and RTC. Their operations are described sep-
arately in the following sections.
32kHz TCXO
The temperature sensor, oscillator, and control logic
form the TCXO. The controller reads the output of the
on-chip temperature sensor and uses a lookup table to
determine the capacitance required, adds the aging
correction in AGE register, and then sets the capaci-
tance selection registers. New values, including
changes to the AGE register, are loaded only when a
change in the temperature value occurs, or when a
user-initiated temperature conversion is completed.
The temperature is read on initial application of VCC
and once every 64 seconds afterwards.
Power Control
This function is provided by a temperature-compensat-
ed voltage reference and a comparator circuit that
monitors the VCC level. When VCC is greater than VPF,
the part is powered by VCC. When VCC is less than VPF
but greater than VBAT, the DS3231 is powered by VCC.
If VCC is less than VPF and is less than VBAT, the
device is powered by VBAT. See Table 1.
To preserve the battery, the first time VBAT is applied to
the device, the oscillator will not start up until VCC is
applied, or until a valid I2C address is written to the
part. Typical oscillator startup time is less than one sec-
ond. Approximately 2 seconds after VCC is applied, or
a valid I2C address is written, the device makes a tem-
perature measurement and applies the calculated cor-
rection to the oscillator. Once the oscillator is running, it
continues to run as long as a valid power source is
available (VCC or VBAT), and the device continues to
measure the temperature and correct the oscillator fre-
quency every 64 seconds.
Pushbutton Reset Function
The DS3231 provides for a pushbutton switch to be con-
nected to the RST output pin. When the DS3231 is not in
a reset cycle, it continuously monitors the RST signal for a
low going edge. If an edge transition is detected, the
DS3231 debounces the switch by pulling the RST low.
After the internal timer has expired (PBDB), the DS3231
continues to monitor the RST line. If the line is still low, the
DS3231 continuously monitors the line looking for a rising
edge. Upon detecting release, the DS3231 forces the
RST pin low and holds it low for tRST.
The same pin, RST, is used to indicate a power-fail con-
dition. When VCC is lower than VPF, an internal power-fail
signal is generated, which forces the RST pin low. When
VCC returns to a level above VPF, the RST pin is held low
for approximately 250ms (tREC) to allow the power sup-
ply to stabilize. If the oscillator is not running (see the
Power Control section) when VCC is applied, tREC is
bypassed and RST immediately goes high.
Real-Time Clock
With the clock source from the TCXO, the RTC provides
seconds, minutes, hours, day, date, month, and year
information. The date at the end of the month is automati-
cally adjusted for months with fewer than 31 days, includ-
ing corrections for leap year. The clock operates in either
the 24-hour or 12-hour format with an AM/PM indicator.
The clock provides two programmable time-of-day
alarms and a programmable square-wave output. The
INT/SQW pin either generates an interrupt due to alarm
condition or outputs a square-wave signal and the
selection is controlled by the bit INTCN.
Address Map
Figure 1 shows the address map for the DS3231 time-
keeping registers. During a multibyte access, when the
address pointer reaches the end of the register space
(12h), it wraps around to location 00h. On an I2C
START or address pointer incrementing to location 00h,
the current time is transferred to a second set of regis-
ters. The time information is read from these secondary
registers, while the clock may continue to run. This
eliminates the need to reread the registers in case the
main registers update during a read.
I2C Interface
The I2C interface is accessible whenever either VCC or
VBAT is at a valid level. If a microcontroller connected to
the DS3231 resets because of a loss of VCC or other
event, it is possible that the microcontroller and DS3231
I2C communications could become unsynchronized,
e.g., the microcontroller resets while reading data from
the DS3231. When the microcontroller resets, the
Extremely Accurate I2C-Integrated
RTC/TCXO/Crystal
10 ____________________________________________________________________