ds1286.pdf

(118 KB) Pobierz
199624863 UNPDF
DS1286
DS1286
Watchdog Timekeeper
FEATURES
•
PIN ASSIGNMENT
Keeps track of hundredths of seconds, seconds, min-
utes, hours, days, date of the month, months, and
years; valid leap year compensation up to 2100
INTA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
28
27
26
25
24
23
22
21
20
19
18
17
16
15
V CC
NC
NC
NC
A5
A4
A3
A2
A1
A0
DQ0
DQ1
DQ2
GND
WE
•
Watchdog timer restarts an out–of–control processor
INTB(INTB)
•
Alarm function schedules real time–related activities
NC
NC
SQ W
•
Embedded lithium energy cell maintains time, watch-
dog, user RAM, and alarm information
OE
•
Programmable interrupts and square wave outputs
maintain 28–pin JEDEC footprint
NC
CE
•
All registers are individually addressable via the ad-
dress and data bus
DQ7
DQ6
DQ5
DQ4
DQ3
•
Accuracy is better than
±
1 minute/month at 25
°
C
•
Greater than 10 years of timekeeping in the absence
of V CC
•
50 bytes of user NV RAM
28–PIN ENCAPSULATED PACKAGE
(720 MIL FLUSH)
PIN DESCRIPTION
INTA
– Interrupt Output A (open drain)
INTB(INTB)
– Interrupt Output B (open drain)
A0–A5
– Address Inputs
DQ 0-DQ7
– Data Input/Output
CE
– Chip Enable
OE
– Output Enable
WE
– Write Enable
V CC
– +5 Volts
GND
– Ground
NC
– No Connection
SQW
– Square Wave Output
DESCRIPTION
The DS1286 Watchdog Timekeeper is a self–contained
real time clock, alarm, watchdog timer, and interval tim-
er in a 28–pin JEDEC DIP package. The DS1286 con-
tains an embedded lithium energy source and a quartz
crystal which eliminates the need for any external cir-
cuitry. Data contained within 64 eight–bit registers can
be read or written in the same manner as bytewide static
RAM. Data is maintained in the Watchdog Timekeeper
by intelligent control circuitry which detects the status of
V CC and write protects memory when V CC is out of tol-
erance. The lithium energy source can maintain data
and real time for over ten years in the absence of V CC .
Watchdog Timekeeper information includes hun-
dredths of seconds, seconds, minutes, hours, day, date,
022798 1/12
199624863.035.png 199624863.036.png
DS1286
month, and year. The date at the end of the month is au-
tomatically adjusted for months with less than 31 days,
including correction for leap year. The Watchdog Time-
keeper operates in either 24 hour or 12 hour format with
an AM/PM indicator. The watchdog timer provides
alarm windows and interval timing between 0.01 sec-
onds and 99.99 seconds. The real time alarm provides
for preset times of up to one week.
support circuitry. The DS1286 constantly monitors V CC .
Should the supply voltage decay, the Watchdog Time-
keeper will automatically write protect itself and all in-
puts to th e registers become “Don’t Care”. Both INTA
and INTB(INTB) are open drain outputs. The two inter-
rupts and the internal clock continue to run regardless of
the level of V CC . However, it is important to insure that
the pull–up resistors used with the interrupt pins are
never pulled up to a value which is greater than V CC +
0.3V. As V CC falls below approximately 3.0 volts, a
power switching circuit turns the lithium energy source
on to maintain the clock, and timer data functionality. It
is also required to insure that during this tim e (ba ttery
backu p mode), the voltage present at INTA and
INTB(INTB) does never exceed 3.0V. At all times the
current on each should not exceed +2.1 mA or –1.0 mA.
Howe ver, if the active high mode is selected for
INTB(INTB), this pin will only go high in the presence of
V CC . During power–up, when V CC rises above approxi-
mately 3.0 volts, the power switching circuit connects
external V CC and disconnects the internal lithium ener-
gy source. Normal operation can resume after V CC ex-
ceeds 4.5 volts for a period of 150 ms.
OPERATION – READ REGISTERS
The DS1286 executes a read cyc le whenever WE
(Writ e E nable) is inactive (High) and CE (Chip Enable)
and OE (Output Enable) are active (Low). The unique
address specified by the six address inputs (A0–A5) de-
fines which of the 64 registers is to be accessed. Valid
data will be available to the eight data output drivers
within t ACC (Access Time) aft er the l ast a ddress input
signal is stable, provi ding that CE and OE access times
are also satisfied. If OE and CE access times are not
satisfied, then data acc ess mu st b e measured from the
latter occurring signal ( CE or OE) a nd t he limiting pa-
rameter is either t CO for CE or t OE for OE rather than ad-
dress access.
OPERATION – WRITE REGISTERS
The DS1286 is in the write mode whenever the WE
(Write Enable) and CE (Chip Enable) signals are in the
active (Low) state after the addre ss in p uts a re stable.
The latter occurring falling edge of CE or WE will deter-
mine the start of the write cycle. T he wri te c ycle is termi-
nated by the earlier rising edge of CE or WE. All addr ess
inputs must be kept valid throughout the write cycle. WE
must return to the high state for a minimum recovery
state (t WR ) before another cycle can be initiated. Data
must be valid on the data bus with sufficient Data Set Up
(t DS ) and Data Ho ld Time (t DH ) with respect to the earlier
rising edge of CE or WE. The OE control signal should
be kept inactive (High) during write cycles to avoid bus
conten tion . H owe ver, if the o utpu t bus has been en-
abled (CE and OE active), then WE will disable the out-
puts in t ODW from its falling edge.
WATCHDOG TIMEKEEPER REGISTERS
The Watchdog Timekeeper has 64 registers which are
eight bits wide that contain all of the Timekeeping,
Alarm, Watchdog, Control, and Data information. The
Clock, Calendar, Alarm, and Watchdog registers are
memory locations which contain external (user–acces-
sible) and internal copies of the data. The external co-
pies are independent of internal functions except that
they are updated periodically by the simultaneous trans-
fer of the incremented internal copy (see Figure 1). The
Command Register bits are affected by both internal
and external functions. This register will be discussed
later. The 50 bytes of RAM registers can only be ac-
cessed from the external address and data bus. Regis-
ters 0, 1, 2, 4, 6, 8, 9, and A contain time of day and date
information (see Figure 2). Time of Day information is
stored in BCD. Registers 3, 5, and 7 contain the Time of
Day Alarm information. Time of Day Alarm information
is stored in BCD. Register B is the Command Register
and information in this register is binary. Registers C
and D are the Watchdog Alarm registers and informa-
tion which is stored in these two registers is in BCD.
Registers E through 3F are user bytes and can be used
to contain data at the user’s discretion.
DATA RETENTION
The Watchdog Timekeeper provides full functional ca-
pability when V CC is greater than 4.5 volts and write pro-
tects the register contents at 4.25 volts typical. Data is
maintained in the absence of V CC without any additional
022798 2/12
199624863.037.png 199624863.038.png
OSCILLATOR &
PRESCALER
JITTER
GENERATOR
JITTER
GENERATOR
V CC
(VBAT)
(X 1)
QUARTZ
CRYSTAL
OSCILLATOR
DIVIDE
BY 8
DIVIDE
BY 40.96
DIVIDE
BY 40.96
PF DELAY
DIVIDE BY 10
POWER
SWITCH
(X2)
32.768 LKz
4096HZ
DIVIDE
BY 4
1024H Z
SQW
INTERNAL REGISTERS
EXTERNAL REGISTERS,
CLOCK, CALENDAR,
TIME OF DAY ALARM
UPDATE SECONDS THRU
YEARS AND CHECK
TIME OF DAY ALARM
TD INT
INTA
SWAP
PINS
COMMAND REGISTER
WD INT
INTB(INTB)
A0-A5
100HZ
“AVG”
100HZ
USER RAM
50 BYTES
“AVG”
CE
INTERNAL COUNTERS
INTERNAL REGISTERS
OE
WE
EXTERNAL REGISTERS
WATCHDOG ALARM
INTERNAL COUNTERS
EXTERNAL REGISTERS
HUNDREDTHS
OF SECONDS
PSUR
DATA I/0 BUFFERS
DQ0-DQ7
199624863.001.png 199624863.002.png 199624863.003.png 199624863.004.png 199624863.005.png 199624863.006.png 199624863.007.png 199624863.008.png 199624863.009.png 199624863.010.png 199624863.011.png 199624863.012.png 199624863.013.png 199624863.014.png 199624863.015.png 199624863.016.png 199624863.017.png 199624863.018.png 199624863.019.png 199624863.020.png 199624863.021.png 199624863.022.png 199624863.023.png 199624863.024.png 199624863.025.png 199624863.026.png 199624863.027.png 199624863.028.png 199624863.029.png
DS1286
DS1286 WATCHDOG TIMEKEEPER REGISTERS Figure 2
ADDRESS
BIT 7
BIT 0
RANGE
0
0.1 SECONDS
0.01 SECONDS
00–99
1
0
10 SECONDS
SECONDS
00–59
2
0
10 MINUTES
MINUTES
00–59
3
M
10
MIN ALARM
MIN ALARM
00–59
4
12/24
10
10
HR
HOURS
01–12+A/P
00–23
0
A/P
CLOCK, CALENDAR,
TIME OF DAY ALARM
REGISTERS
5
M
12/24
10
10
HR
HR ALARM
01–12+A/P
00–23
A/P
6
0
0
0
0
0
DAYS
01–07
7
M
0
0
0
0
DAY ALARM
01–07
8
0
0
10 DATE
DATE
01–31
9
EOSC ESQW
0
10MO
MONTHS
01–12
A
10 YEARS
YEARS
00–99
COMMAND
REGISTERS
B
TE IPSW
IBH
PU
WAM
TDM
WAF
TDF
LO
LVL
C
0.1 SECONDS
0.01 SECONDS
00–99
WATCHDOG
ALARM
REGISTERS
D
10 SECONDS
SECONDS
00–99
(RETRIGGERABLE/
REPETITIVE COUNTDOWN
ALARM)
USER
REGISTERS
E
3F
022798 4/12
199624863.030.png 199624863.031.png 199624863.032.png 199624863.033.png
DS1286
TIME OF DAY REGISTERS
Registers 0, 1, 2, 4, 6, 8, 9, and A contain Time of Day
data in BCD. Ten bits within these eight registers are not
used and will always read zero regardless of how they
are written. Bits 6 and 7 in the M onths R egister (9) are
binary bits. When set to logic zero, EOSC (bit 7) enables
the Real Time Clock oscillator. This bit is set to logic one
as shipped from Dallas Semiconductor to prevent lithium
energy consumption during storage and shipment. This
bit will normally be turned on by the user during device
initialization. However, the oscillator can be turned on
and off as necessary by setting this bit to the appropriate
level. Bit 6 of this same byte controls the Square Wave
Output (Pin 23). When set to logic zero, the Square Wave
Output pin will output a 1024 Hz Square Wave Signal.
When set to logic one the Square Wave Output pin is in a
high impedance state. Bit 6 of the Hours Register is de-
fined as the 12– or 24– hour Select Bit. When set to logic
one, the 12–hour format is selected. In the 12–hour for-
mat, bit 5 is the AM/PM bit with logic one being PM. In the
24–hour mode, bit 5 is the second 10–hour bit (20–23
hours). The Time of Day registers are updated every .01
seconds from the real time clock, except when the TE bit
(bit 7 of Register B) is set low or the clock oscillator is not
running. The preferred method of synchronizing data ac-
cess to and from the Watchdog Timekeeper is to access
the Command Register by doing a write cycle to address
location 0B and setting the TE bit (Transfer Enable ) to a
logic zero. This will freeze the External Time of Day regis-
ters at the present recorded time, allowing access to oc-
cur without danger of simultaneous update. When the
watch registers have been read or written, a second write
cycle to location 0B, setting the TE bit to a logic one, will
put the Time of Day registers back to being updated every
0.01 second. No time is lost in the real time clock be-
cause the internal copy of the Time of Day register buffers
is continually incremented while the external memory
registers are frozen.
of making sure that the write cycle has caused proper
update is to do read verifies and re–execute the write
cycle if data is not correct. While the possibility of erro-
neous results from reads and write cycles has been
stated, it is worth noting that the probability of an incor-
rect result is kept to a minimum due to the redundant
structure of the Watchdog Timekeeper.
TIME OF DAY ALARM REGISTERS
Registers 3, 5, and 7 contain the Time of Day Alarm regis-
ters. Bits 3, 4, 5, and 6 of Register 7 will always read zero
regardless of how they are written. Bit 7 of Registers 3, 5,
and 7 are mask bits (Figure 3). When all of the mask bits
are logic zero, a Time of Day Alarm will only occur when
Registers 2, 4, and 6 match the values stored in Regis-
ters 3, 5, and 7. An alarm will be generated every day
when bit 7 of Register 7 is set to a logic one. Similarly, an
alarm is generated every hour when bit 7 of Registers 7
and 5 is set to a logic 1. When bit 7 of Registers 7, 5, and
3 is set to a logic 1, an alarm will occur every minute when
Register 1 (seconds) rolls from 59 to 00.
Time of Day Alarm registers are written and read in the
same format as the Time of Day registers. The Time of
Day Alarm Flag and Interrupt is always cleared when
Alarm registers are read or written.
WATCHDOG ALARM REGISTERS
Registers C and D contain the time for the Watchdog
Alarm. The two registers contain a time count from
00.01 to 99.99 seconds in BCD. The value written into
the Watchdog Alarm Registers can be written or read in
any order. Any access to Registers C or D will cause the
Watchdog Alarm to reinitialize and clears the Watchdog
Flag bit and the Watchdog Interrupt Output. When a
new value is entered or the Watchdog Registers are
read, the Watchdog Timer will start counting down from
the entered value to zero. When zero is reached, the
Watchdog Interrupt Output will go to the active state.
The Watchdog Timer countdown is interrupted and rein-
itialized back to the entered value every time either of
the registers is accessed. In this manner, controlled pe-
riodic accesses to the Watchdog Timer can prevent the
Watchdog Alarm from ever going to an active level. If
access does not occur, countdown alarm will be repeti-
tive. The Watchdog Alarm registers always read the en-
tered value. The actual countdown register is internal
and is not readable. Writing Registers C and D to zero
will disable the Watchdog Alarm feature.
An alternate method of reading and writing the Time of
Day registers is to ignore synchronization. However,
any single read may give erroneous data as the real
time clock may be in the process of updating the exter-
nal memory registers as data is being read. The internal
copies of seconds through years are incremented and
Time of Day Alarm is checked during the period that
hundreds of seconds read 99 and are transferred to the
external register when hundredths of seconds roll from
99 to 00. A way of making sure data is valid is to do mul-
tiple reads and compare. Writing the registers can also
produce erroneous results for the same reasons. A way
022798 5/12
199624863.034.png
 
Zgłoś jeśli naruszono regulamin