M41T66 Clock operation
Doc ID 15108 Rev 2 13/34
3 Clock operation
The M41T66 is driven by a quartz-controlled oscillator with a nominal frequency of
32.768 kHz. The accuracy of the real-time clock depends on the frequency of the quartz
crystal that is used as the time-base for the RTC.
The eight byte clock register (see Table 2: M41T66 register map) is used to both set the
clock and to read the date and time from the clock, in a binary coded decimal format.
tenths/hundredths of seconds, seconds, minutes, and hours are contained within the first
four registers.
A WRITE to any clock register will result in the tenths/hundredths of seconds being reset to
“00,” and tenths/hundredths of seconds cannot be written to any value other than “00.
Bits D0 through D2 of register 04h contain the day (day of week). Registers 05h, 06h, and
07h contain the date (day of month), month, and years. The ninth clock register is the
calibration register (this is described in the clock calibration section). Bit D7 of register 01h
contains the STOP bit (ST). Setting this bit to a '1' will cause the oscillator to stop. When
reset to a '0' the oscillator restarts within one second (typical).
Bit D7 of register 02h (minute register) contains the oscillator fail interrupt enable bit (OFIE).
When the user sets this bit to '1,' any condition which sets the oscillator fail bit (OF) (see
Oscillator stop detection on page 21) will also generate an interrupt output.
Bits D6 and D7 of clock register 06h (century/month register) contain the CENTURY bit 0
(CB0) and CENTURY bit 1 (CB1).
A WRITE to ANY location within the first eight bytes of the clock register (00h-07h),
including the OFIE bit, RS0-RS3 bit, and CB0-CB1 bits will result in an update of the system
clock and a reset of the divider chain. This could result in an inadvertent change of the
current time. These non-clock related bits should be written prior to setting the clock, and
remain unchanged until such time as a new clock time is also written.
The eight clock registers may be read one byte at a time, or in a sequential block. Provision
has been made to assure that a clock update does not occur while any of the eight clock
addresses are being read. If a clock address is being read, an update of the clock registers
will be halted. This will prevent a transition of data during the READ.
Clock operation M41T66
14/34 Doc ID 15108 Rev 2
3.1 Clock registers
The M41T66 offers 16 internal registers which contain clock, calibration, alarm, watchdog,
flags, and square wave. The clock registers are memory locations which contain external
(user accessible) and internal copies of the data. The external copies are independent of
internal functions except that they are updated periodically by the simultaneous transfer of
the incremented internal copy. The internal divider (or clock) chain will be reset upon the
completion of a WRITE to any clock address (00h to 07h).
The system-to-user transfer of clock data will be halted whenever the address being read is
a clock address (00h to 07h). The update will resume either due to a stop condition or when
the pointer increments to a non-clock address.
Clock and alarm registers store data in BCD format. calibration, watchdog, and square wave
bits are written in a binary format.
M41T66 Clock operation
Doc ID 15108 Rev 2 15/34
Table 2. M41T66 register map
(1)
1. Keys:
0 = must be set to '0'
AF = alarm flag (read only)
AFE = alarm flag enable flag
BMB0 - BMB4 = watchdog multiplier bits
CB0-CB1 = century bits
OF = oscillator fail bit
OFIE = oscillator fail interrupt enable bit
OUT = output level
RB0 - RB2 = watchdog resolution bits
RPT1-RPT5 = alarm repeat mode bits
RS0-RS3 = SQW frequency bits
S = sign bit
SQWE = square wave enable bit
ST = stop bit
WDF = watchdog flag bit (read only)
Addr
Function/range BCD
format
D7 D6 D5 D4 D3 D2 D1 D0
00h 0.1 seconds 0.01 seconds
10ths/100ths
of seconds
00-99
01h ST 10 seconds Seconds Seconds 00-59
02h OFIE 10 minutes Minutes Minutes 00-59
03h 0 0 10 hours Hours (24 hour format) Hours 00-23
04h RS3 RS2 RS1 RS0 0 Day of week Day 01-7
05h 0 0 10 date Date: day of month Date 01-31
06h CB1 CB0 0 10M Month
Century/
month
0-3/01-12
07h 10 years Year Year 00-99
08h OUT 0 S Calibration Calibration
09h RB2 BMB4 BMB3 BMB2 BMB1 BMB0 RB1 RB0 Watchdog
0Ah AFE SQWE 0 Al 10M Alarm month Al month 01-12
0Bh RPT4 RPT5 AI 10 date Alarm date Al date 01-31
0Ch RPT3 0 AI 10 hour Alarm hour Al hour 00-23
0Dh RPT2 Alarm 10 minutes Alarm minutes Al min 00-59
0Eh RPT1 Alarm 10 seconds Alarm seconds Al sec 00-59
0Fh WDF AF 0 0 0 OF 0 0 Flags

M41T66Q6F

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
Real Time Clock real-time clock with alarms
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet