Oscillator Circuit
The DS1340 uses an external 32.768kHz crystal. The
oscillator circuit does not require any external resistors
or capacitors to operate. Table 2 specifies several crys-
tal parameters for the external crystal. Figure 3 shows a
functional schematic of the oscillator circuit. If using a
crystal with the specified characteristics, the startup
time is usually less than one second.
Clock Accuracy
The initial clock accuracy depends on the accuracy of
the crystal and the accuracy of the match between the
capacitive load of the oscillator circuit and the capaci-
tive load for which the crystal was trimmed. Additional
error is added by crystal frequency drift caused by
temperature shifts. External circuit noise coupled into
the oscillator circuit can result in the clock running fast.
Figure 4 shows a typical PC board layout for isolating
the crystal and oscillator from noise. Refer to
Application Note 58: Crystal Considerations with Dallas
Real-Time Clocks (www.maxim-ic.com/RTCapps) for
detailed information.
DS1340C Only
The DS1340C integrates a standard 32,768Hz crystal
into the package. Typical accuracy with nominal V
CC
and +25°C is approximately +15ppm. Refer to
Application Note 58 for information about crystal accu-
racy vs. temperature.
Operation
The DS1340 operates as a slave device on the serial
bus. Access is obtained by implementing a START
condition and providing a device identification code fol-
lowed by data. Subsequent registers can be accessed
sequentially until a STOP condition is executed. The
device is fully accessible and data can be written and
read when V
CC
is greater than V
PF
. However, when
V
CC
falls below V
PF
, the internal clock registers are
blocked from any access. If V
PF
is less than V
BACKUP
,
the device power is switched from V
CC
to V
BACKUP
when V
CC
drops below V
PF
. If V
PF
is greater than
V
BACKUP
, the device power is switched from V
CC
to
V
BACKUP
when V
CC
drops below V
BACKUP
. The regis-
ters are maintained from the V
BACKUP
source until V
CC
is returned to nominal levels. The functional diagram
(Figure 5) shows the main elements of the serial RTC.
DS1340
I
2
C RTC with Trickle Charger
_____________________________________________________________________ 7
PARAMETER
SYMBOL MIN TYP MAX
UNITS
Nominal
Frequency
f
O
32.768
kHz
Series Resistance
ESR
45,60**
k
Load Capacitance
C
L
12.5
pF
Table 2. Crystal Specifications*
*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 addi-
tional specifications.
**A crystal with up to 60k ESR can be used if the minimum
operating voltages on both V
CC
and V
BACKUP
are at least 2.0V.
COUNTDOWN
CHAIN
RTC
X1
X2
C
L
1
C
L
2
CRYSTAL
RTC
REGISTERS
Figure 3. Oscillator Circuit Showing Internal Bias Network
CRYSTAL
X1
X2
GND
LOCAL GROUND PLANE (LAYER 2)
Figure 4. Layout Example
SERIAL BUS
INTERFACE
AND ADDRESS
REGISTER
OSCILLATOR
CONTROL
LOGIC
X2
"C" VERSION ONLY
SCL
SDA
512Hz
MUX/BUFFER
FT/OUT
USER BUFFER
(7 BYTES)
CLOCK AND
CALENDAR
REGISTERS
32,768Hz
1Hz
X1
POWER
CONTROL
V
CC
V
BACKUP
DIVIDER AND
CALIBRATION
CIRCUIT
DS1340
Figure 5. Functional Diagram
DS1340
Address Map
Table 3 shows the DS1340 address map. The RTC reg-
isters are located in address locations 00h to 06h, and
the control register is located at 07h. The trickle-charge
and flag registers are located in address locations 08h
to 09h. During a multibyte access of the timekeeping
registers, when the address pointer reaches 07h—the
end of the clock and control register space—it wraps
around to location 00h. Writing the address pointer to
the corresponding location accesses address locations
08h and 09h. After accessing location 09h, the address
pointer wraps around to location 00h. On a I
2
C START,
STOP, 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.
Clock and Calendar
The time and calendar information is obtained by read-
ing the appropriate register bytes. Table 3 shows the
RTC registers. The time and calendar data 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 week 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. Bit 7 of register 0 is the
enable oscillator (EOSC) bit. When this bit is set to 1, the
oscillator is disabled. When cleared to 0, the oscillator is
enabled. The initial power-up value of EOSC is 0.
Location 02h is the century/hours register. Bit 7 and bit
6 of the century/hours register are the century-enable
bit (CEB) and the century bit (CB). Setting CEB to logic
1 causes the CB bit to toggle, either from a logic 0 to a
logic 1, or from a logic 1 to a logic 0, when the years
register rolls over from 99 to 00. If CEB is set to logic 0,
CB does not toggle.
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 synchro-
nized to the internal registers on any START or STOP
and when the register pointer rolls over to zero. The
time information is read from these secondary registers
while the clock continues to run. This eliminates the
need to reread the registers in case the internal regis-
ters update during a read.
The divider chain is reset whenever the seconds regis-
ter is written. Write transfers occur on the acknowledge
from the DS1340. Once the divider chain is reset, to
avoid rollover issues, the remaining time and date reg-
isters must be written within one second.
Special-Purpose Registers
The DS1340 has three additional registers (control,
trickle charger, and flag) that control the RTC, trickle
charger, and oscillator flag output.
I
2
C RTC with Trickle Charger
8 _____________________________________________________________________
ADDRESS
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2 BIT 1
BIT 0
FUNCTION RANGE
00H
EOSC
10 Seconds Seconds Seconds 00–59
01H X 10 Minutes Minutes Minutes 00–59
02H CEB CB 10 Hours Hours
Century/Hours
0–1; 00–23
03H X X X X X Day Day 01–07
04H X X 10 Date Date Date 01–31
05H X X X
10 Month
Month Month 01–12
06H 10 Year Year Year 00–99
07H OUT FT S CAL4
CAL3
CAL2 CAL1
CAL0
Control
08H
TCS3 TCS2 TCS1
TCS0
DS1
DS0
ROUT1 ROUT0 Trickle Charger
09H OSF 0 0 0 0 0 0 0 Flag
Table 3. Address Map
X = Read/Write bit
Note: Unless otherwise specified, the state of the registers is not defined when power is first applied.
Control Register (07h)
Bit 7: Output Control (OUT). This bit controls the out-
put level of the FT/OUT pin when the FT bit is set to 0. If
FT = 0, the logic level on the FT/OUT pin is 1 if OUT = 1
and 0 if OUT = 0. The initial power-up OUT value is 1.
Bit 6: Frequency Test (FT). When this bit is 1, the
FT/OUT pin toggles at a 512Hz rate. When FT is written
to 0, the OUT bit controls the state of the FT/OUT pin.
The initial power-up value of FT is 0.
Bit 5: Calibration Sign Bit (S). A logic 1 in this bit indi-
cates positive calibration for the RTC. A 0 indicates
negative calibration for the clock. See the Clock
Calibration section for a detailed description of the bit
operation. The initial power-up value of S is 0.
Bits 4 to 0: Calibration Bits (CAL4 to CAL0). These
bits can be set to any value between 0 and 31 in binary
form. See the Clock Calibration section for a detailed
description of the bit operation. The initial power-up
value of CAL0–CAL4 is 0.
Trickle-Charger Register (08h)
The simplified schematic in Figure 6 shows the basic
components of the trickle charger. The trickle-charge
select (TCS) bits (bits 4–7) control the selection of the
trickle charger. To prevent accidental enabling, only a
pattern on 1010 enables the trickle charger. All other
patterns disable the trickle charger. The trickle charger
is disabled when power is first applied. The diode-
select (DS) bits (bits 2, 3) select whether or not a diode
is connected between V
CC
and V
BACKUP
. If DS is 01,
no diode is selected; if DS is 10, a diode is selected.
The ROUT bits (bits 0, 1) select the value of the resistor
connected between V
CC
and V
BACKUP
. Table 3 shows
the resistor selected by the resistor select (ROUT) bits
and the diode selected by the diode select (DS) bits.
Warning: The ROUT value of 250 must not be select-
ed whenever V
CC
is greater than 3.63V.
The user determines diode and resistor selection
according to the maximum current desired for battery
or super cap charging (Table 4). The maximum charg-
ing current can be calculated as illustrated in the fol-
lowing example.
Assume that a 3.3V system power supply is applied to
V
CC
and a super cap is connected to V
BACKUP
. Also
assume that the trickle charger has been enabled with
a diode and resistor R2 between V
CC
and V
BACKUP
.
The maximum current I
MAX
would therefore be calculat-
ed as follows:
I
MAX
= (3.3V - diode drop) / R2 (3.3V - 0.7V) /
2kΩ≈1.3mA
As the super cap charges, the voltage drop between
V
CC
and V
BACKUP
decreases and therefore the charge
current decreases.
DS1340
I
2
C RTC with Trickle Charger
_____________________________________________________________________ 9
BIT 7
TCS3
1 OF 16 SELECT
NOTE: ONLY 1010b
ENABLES CHARGER
1 OF 2
SELECT
V
CC
V
BACKUP
R1
250
TCS
0-3
= TRICKLE-CHARGER SELECT
DS
0-1
= DIODE SELECT
TOUT
0-1
= RESISTOR SELECT
R2
2k
R3
4k
1 OF 3
SELECT
BIT 6
TCS2
BIT 5
TCS1
BIT 4
TCS0
BIT 3
DS1
BIT 2
DS0
BIT 1
ROUT1
BIT 0
ROUT0
Figure 6. Trickle Charger Functional Diagram

DS1340Z-3

Mfr. #:
Manufacturer:
Maxim Integrated
Description:
Real Time Clock I2C RTC w/Trickle Charger
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet