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 separately 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 capacitance 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 V
CC
and once every 64 seconds afterwards.
Power Control
This function is provided by a temperature-compensated voltage reference and a comparator circuit that
monitors the VCClevel. When VCCis greater than VPF,
the part is powered by VCC. When VCCis less than V
PF
but greater than V
BAT
, the DS3231 is powered by VCC.
If V
CC
is less than VPFand is less than V
BAT
, the
device is powered by V
BAT
. See Table 1.
To preserve the battery, the first time V
BAT
is applied to
the device, the oscillator will not start up until VCCis
applied, or until a valid I
2
C address is written to the
part. Typical oscillator startup time is less than one second. Approximately 2 seconds after V
CC
is applied, or
a valid I2C address is written, the device makes a temperature measurement and applies the calculated correction to the oscillator. Once the oscillator is running, it
continues to run as long as a valid power source is
available (VCCor V
BAT
), and the device continues to
measure the temperature and correct the oscillator frequency every 64 seconds.
Pushbutton Reset Function
The DS3231 provides for a pushbutton switch to be connected 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 t
RST
.
The same pin, RST, is used to indicate a power-fail condition. When VCCis lower than VPF, an internal power-fail
signal is generated, which forces the RST pin low. When
VCCreturns to a level above VPF, the RST pin is held low
for approximately 250ms (t
REC
) to allow the power supply to stabilize. If the oscillator is not running (see the
Power Control section) when VCCis applied, t
REC
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 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 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 timekeeping 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 registers. 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 VCCor
V
BAT
is at a valid level. If a microcontroller connected to
the DS3231 resets because of a loss of VCCor 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 ____________________________________________________________________