Max6901, Wire serial rtc in a tdfn, Reading the clock – Rainbow Electronics MAX6901 User Manual

Page 8: Table 2. register address/definition (continued)

Advertising
background image

MAX6901

onds). Check to see that final-seconds is equal to ini-
tial-seconds. If not, repeat the write process.

Note: After writing to any time or date register, no read
or write operations are allowed for 45µs.

AM/PM and 12Hr/24Hr Mode

Bit 7 of the Hours register selects 12hr or 24hr mode.
When high, 12hr mode is selected. In 12hr mode, bit 5 is
the AM/PM bit, logic high for PM. In 24hr mode, bit 5 is
the second 10hr bit, logic high for hours 20 through 23.

Write-Protect Bit

Bit 7 of the Control register is the write-protect bit.
When high, the write-protect bit prevents write opera-
tions to all registers except itself. After initial settings
are written to the timekeeping registers, set the write-
protect bit to logic 1 to prevent erroneous data from
entering the registers during power glitches or inter-
rupted serial transfers. The lower 7 bits (bits 0–6) are
unusable, and always read zero. Any data written to
bits 0–6 are ignored. Bit 7 must be set to zero before a
single byte write to the clock, before a write to RAM, or
during a burst write to the clock.

Example: Setting the Clock

with a Burst Write

To set the clock with a Burst Write operation to
10:11:31PM, Thursday July 4th, 2002, write BEh as
Address/Command byte, followed by 8 bytes, B1h,

11h, B0h, 04h, 07h, 04h, 02h, and 00h (Table 2). BEh
accesses the Clock Burst Write register. The first byte,
B1h, sets the Seconds register to 31, and disables the
32.768kHz output. The second byte, 11h, sets the
Minutes register to 11. The third byte, B0h, sets the
Hours register to 12hr mode, and 10PM. The fourth
byte, 04h, sets the Date register (day of the month) to
the 4th. The fifth byte, 07h, sets the Month register to
July. The sixth byte, 04h, sets the Day register (day of
the week) to Thursday. The seventh byte, 02h, sets the
Year register to 02. The eighth byte, 00h, clears the
write-protect bit of the Control register to allow writing to
the MAX6901. The Century register is not accessed
with a Burst Write and therefore must be written to sep-
arately to set the century to 20. Note the Century regis-
ter corresponds to the thousand and hundred digits of
the current year and defaults to 19.

Reading the Clock

Reading the Timekeeping Registers

The main timekeeping registers (Seconds, Minutes,
Hours, Date, Month, Day, Year) can be read with either
Single Reads or a Burst Read. In the MAX6901, a latch
buffers each clock counter’s data. Clock counter data
are latched by the 3-wire serial Read command (on the
falling edge of SCLK, after the Address/Command byte
has been sent by the Master to read a timekeeping reg-
ister). Collision-detection circuitry ensures that this

3-Wire Serial RTC in a TDFN

8

_______________________________________________________________________________________

Table 2. Register Address/Definition (continued)

REGISTER ADDRESS

REGISTER DEFINITION

FUNCTION

A7 A6 A5 A4 A3 A2 A1 A0

VALUE

D7

D6 D5 D4

D3

D2 D1

D0

RAM

RAM 0

1

1

0

0

0

0

0

RD

/W

RAM DATA 0

x

x

x

x

x

x

x

x

RAM 30

1

1

1

1

1

1

0

RD

/W

RAM DATA 30

x

x

x

x

x

x

x

x

RAM BURST

1

1

1

1

1

1

1

RD

/W

Note: *POR STATE defines power-on reset state of register content.

Advertising