DS12885/DS12887/DS12887A/DS12C887/DS12C887A
Real-Time Clocks
16 ____________________________________________________________________
Bit 7: SET. When the SET bit is 0, the update transfer
functions normally by advancing the counts once per
second. When the SET bit is written to 1, any update
transfer is inhibited, and the program can initialize the
time and calendar bytes without an update occurring in
the midst of initializing. Read cycles can be executed in
a similar manner. SET is a read/write bit and is not
affected by RESET or internal functions of the device.
Bit 6: Periodic Interrupt Enable (PIE). The PIE bit is a
read/write bit that allows the periodic interrupt flag (PF) bit
in Register C to drive the IRQ pin low. When the PIE bit is
set to 1, periodic interrupts are generated by driving the
IRQ pin low at a rate specified by the RS3–RS0 bits of
Register A. A 0 in the PIE bit blocks the IRQ output from
being driven by a periodic interrupt, but the PF bit is still
set at the periodic rate. PIE is not modified by any internal
device functions, but is cleared to 0 on RESET.
Bit 5: Alarm Interrupt Enable (AIE). This bit is a
read/write bit that, when set to 1, permits the alarm flag
(AF) bit in Register C to assert IRQ. An alarm interrupt
occurs for each second that the three time bytes equal
the three alarm bytes, including a don’t-care alarm
code of binary 11XXXXXX. The AF bit does not initiate
the IRQ signal when the AIE bit is set to 0. The internal
functions of the device do not affect the AIE bit, but is
cleared to 0 on RESET.
Bit 4: Update-Ended Interrupt Enable (UIE). This bit is
a read/write bit that enables the update-end flag (UF)
bit in Register C to assert IRQ. The RESET pin going
low or the SET bit going high clears the UIE bit.
The internal functions of the device do not affect the
UIE bit, but is cleared to 0 on RESET.
Bit 3: Square-Wave Enable (SQWE). When this bit is
set to 1, a square-wave signal at the frequency set by
the rate-selection bits RS3–RS0 is driven out on the SQW
pin. When the SQWE bit is set to 0, the SQW pin is held
low. SQWE is a read/write bit and is cleared by RESET.
SQWE is low if disabled, and is high impedance when
V
CC
is below V
PF
. SQWE is cleared to 0 on RESET.
Bit 2: Data Mode (DM). This bit indicates whether time
and calendar information is in binary or BCD format.
The DM bit is set by the program to the appropriate for-
mat and can be read as required. This bit is not modi-
fied by internal functions or RESET. A 1 in DM signifies
binary data, while a 0 in DM specifies BCD data.
Bit 1: 24/12. The 24/12 control bit establishes the for-
mat of the hours byte. A 1 indicates the 24-hour mode
and a 0 indicates the 12-hour mode. This bit is
read/write and is not affected by internal functions or
RESET.
Bit 0: Daylight Saving Enable (DSE). This bit is a
read/write bit that enables two daylight saving adjust-
ments when DSE is set to 1. On the first Sunday in
April, the time increments from 1:59:59 AM to 3:00:00
AM. On the last Sunday in October when the time first
reaches 1:59:59 AM, it changes to 1:00:00 AM. When
DSE is enabled, the internal logic test for the first/last
Sunday condition at midnight. If the DSE bit is not set
when the test occurs, the daylight saving function does
not operate correctly. These adjustments do not occur
when the DSE bit is 0. This bit is not affected by internal
functions or RESET.
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
SET PIE AIE UIE SQWE DM 24/12 DSE
Control Register B
MSB LSB
DS12885/DS12887/DS12887A/DS12C887/DS12C887A
Real-Time Clocks
____________________________________________________________________ 17
Bit 7: Interrupt Request Flag (IRQF). This bit is set to
1 when any of the following are true:
PF = PIE = 1
AF = AIE = 1
UF = UIE = 1
Any time the IRQF bit is 1, the IRQ pin is driven low.
This bit can be cleared by reading Register C or with a
RESET.
Bit 6: Periodic Interrupt Flag (PF). This bit is read-
only and is set to 1 when an edge is detected on the
selected tap of the divider chain. The RS3 through RS0
bits establish the periodic rate. PF is set to 1 indepen-
dent of the state of the PIE bit. When both PF and PIE
are 1s, the IRQ signal is active and sets the IRQF bit.
This bit can be cleared by reading Register C or with a
RESET.
Bit 5: Alarm Interrupt Flag (AF). A 1 in the AF bit indi-
cates that the current time has matched the alarm time.
If the AIE bit is also 1, the IRQ pin goes low and a 1
appears in the IRQF bit. This bit can be cleared by
reading Register C or with a RESET.
Bit 5: Update-Ended Interrupt Flag (UF). This bit is
set after each update cycle. When the UIE bit is set to
1, the 1 in UF causes the IRQF bit to be a 1, which
asserts the IRQ pin. This bit can be cleared by reading
Register C or with a RESET.
Bits 3 to 0: Unused. These bits are unused in Register
C. These bits always read 0 and cannot be written.
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
IRQF PF AF UF 0 0 0 0
Control Register C
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
VRT0000000
Control Register D
Bit 7: Valid RAM and Time (VRT). This bit indicates
the condition of the battery connected to the V
BAT
pin.
This bit is not writeable and should always be 1 when
read. If a 0 is ever present, an exhausted internal lithi-
um energy source is indicated and both the contents of
the RTC data and RAM data are questionable. This bit
is unaffected by RESET.
Bits 6 to 0: Unused. The remaining bits of Register D
are not usable. They cannot be written and they always
read 0.
MSB LSB
MSB LSB
DS12885/DS12887/DS12887A/DS12C887/DS12C887A
Real-Time Clocks
18 ____________________________________________________________________
Century Register
(DS12C887/DS12C887A Only)
The century register at location 32h is a BCD register
designed to automatically load the BCD value 20 as the
year register changes from 99 to 00. The MSB of this
register is not affected when the load of 20 occurs, and
remains at the value written by the user.
Nonvolatile RAM (NV RAM)
The general-purpose NV RAM bytes are not dedicated
to any special function within the device. They can be
used by the processor program as battery-backed
memory and are fully available during the update cycle.
Interrupts
The RTC family includes three separate, fully automatic
sources of interrupt for a processor. The alarm interrupt
can be programmed to occur at rates from once per
second to once per day. The periodic interrupt can be
selected for rates from 500ms to 122µs. The update-
ended interrupt can be used to indicate to the program
that an update cycle is complete. Each of these inde-
pendent interrupt conditions is described in greater
detail in other sections of this text.
The processor program can select which interrupts, if
any, are to be used. Three bits in Register B enable the
interrupts. Writing a logic 1 to an interrupt-enable bit
permits that interrupt to be initiated when the event
occurs. A 0 in an interrupt-enable bit prohibits the IRQ
pin from being asserted from that interrupt condition. If
an interrupt flag is already set when an interrupt is
enabled, IRQ is immediately set at an active level,
although the interrupt initiating the event may have
occurred earlier. As a result, there are cases where the
program should clear such earlier initiated interrupts
before first enabling new interrupts.
When an interrupt event occurs, the relating flag bit is
set to logic 1 in Register C. These flag bits are set inde-
pendent of the state of the corresponding enable bit in
Register B. The flag bit can be used in a polling mode
without enabling the corresponding enable bits. The
interrupt flag bit is a status bit that software can interro-
gate as necessary. When a flag is set, an indication is
given to software that an interrupt event has occurred
since the flag bit was last read; however, care should
be taken when using the flag bits as they are cleared
each time Register C is read. Double latching is includ-
ed with Register C so that bits that are set remain sta-
ble throughout the read cycle. All bits that are set (high)
are cleared when read, and new interrupts that are
pending during the read cycle are held until after the
cycle is completed. One, two, or three bits can be set
when reading Register C. Each used flag bit should be
examined when Register C is read to ensure that no
interrupts are lost.
The second flag bit method is used with fully enabled
interrupts. When an interrupt flag bit is set and the cor-
responding interrupt-enable bit is also set, the IRQ pin is
asserted low. IRQ is asserted as long as at least one of
the three interrupt sources has its flag and enable bits
set. The IRQF bit in Register C is a 1 whenever the IRQ
pin is driven low. Determination that the RTC initiated an
interrupt is accomplished by reading Register C. A logic
1 in bit 7 (IRQF bit) indicates that one or more interrupts
have been initiated by the device. The act of reading
Register C clears all active flag bits and the IRQF bit.
Oscillator Control Bits
When the DS12887, DS12887A, DS12C887, and
DS12C887A are shipped from the factory, the internal
oscillator is turned off. This prevents the lithium energy
cell from being used until the device is installed in a
system.
A pattern of 010 in bits 4 to 6 of Register A turns the
oscillator on and enables the countdown chain. A pat-
tern of 11x (DV2 = 1, DV1 = 1, DV0 = X) turns the oscil-
lator on, but holds the countdown chain of the oscillator
in reset. All other combinations of bits 4 to 6 keep the
oscillator off.
Square-Wave Output Selection
Thirteen of the 15 divider taps are made available to a 1-
of-16 multiplexer, as shown in the functional diagram.
The square-wave and periodic-interrupt generators
share the output of the multiplexer. The RS0–RS3 bits in
Register A establish the output frequency of the multi-
plexer (see Table 1). Once the frequency is selected, the
output of the SQW pin can be turned on and off under
program control with the square-wave enable bit, SQWE.
Periodic Interrupt Selection
The periodic interrupt causes the IRQ pin to go to an
active state from once every 500ms to once every 122µs.
This function is separate from the alarm interrupt, which
can be output from once per second to once per day.
The periodic interrupt rate is selected using the same
Register A bits that select the square-wave frequency
(Table 1). Changing the Register A bits affects the
square-wave frequency and the periodic-interrupt out-
put. However, each function has a separate enable bit in
Register B. The SQWE bit controls the square-wave out-
put. Similarly, the PIE bit in Register B enables the peri-
odic interrupt. The periodic interrupt can be used with
software counters to measure inputs, create output inter-
vals, or await the next needed software function.

DS12887A+

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