M41T80 Clock operation
Doc ID 9074 Rev 5 13/27
3 Clock operation
The M41T80 is driven by a quartz-controlled oscillator with a nominal frequency of
32,768 Hz. 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 20-byte register map (see Table 3: Clock register map on page 14) 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, minutes, and hours are contained within the first four
registers.
Note: 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 D6 and D7 of clock register 03h (century/hours register) contain the CENTURY
ENABLE bit (CEB) and the CENTURY bit (CB). Setting CEB to a '1' will cause CB to toggle,
either from '0' to '1' or from '1' to '0' at the turn of the century (depending upon its initial
state). If CEB is set to a '0,' CB will not toggle. 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 control register. Bit D7 of register 01h contains the
STOP bit (ST). Setting this bit to a '1' will cause the oscillator to stop. If the device is
expected to spend a significant amount of time on the shelf, the oscillator may be stopped to
reduce current drain. When reset to a '0' the oscillator restarts within four seconds (typically
one second).
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.
3.1 Clock
registers
The M41T80 offers 20 internal registers which contain clock, alarm, 32 KHz, flag, square
wave, and control data. These registers are memory locations which contain external (user
accessible) and internal copies of the data (usually referred to as BiPORT
cells). 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.
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 any non-clock address (08h-13h).
Clock and alarm registers store data in BCD. Control, 32 KHz, and square wave registers
store data in binary format.
Clock operation M41T80
14/27 Doc ID 9074 Rev 5
Table 3. Clock register map
(1)
1. Keys:
ST = Stop bit
0 = Must be set to '0'
32KE = Enable bit for 32 KHz output
CEB = Enable for century bit
CB = Century bit
OUT = Data bit for OUT pin
AFE = Alarm flag enable bit
RPT1-RPT5 = Alarm repeat mode bits
AF = Alarm flag (read only)
SQWE = Square wave enable
RS0-RS3 = SQW frequency select
Addr
Function/range BCD
format
D7 D6 D5 D4 D3 D2 D1 D0
00h 0.1 seconds 0.01 seconds
10s/100s
of seconds
00-99
01h ST 10 seconds Seconds Seconds 00-59
02h 0 10 minutes Minutes Minutes 00-59
03h CEB CB 10 hours Hours (24-hour format)
Century/
hours
0-1/00-23
04h 0 0 0 0 0 Day of week Day 01-7
05h 0 0 10 date Date: day of month Date 01-31
06h 0 0 0 10M Month Month 01-12
07h 10 years Year Year 00-99
08h OUT 0 0 0 0 0 0 0 Control
09h 32KE 0 0 0 0 0 0 0 32 KHz
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
0Fh0AF0 0 0000 Flags
10h00000000Reserved
11h00000000Reserved
12h00000000Reserved
13h RS3 RS2 RS1 RS0 0 0 0 0 SQW
M41T80 Clock operation
Doc ID 9074 Rev 5 15/27
3.2 Setting alarm clock registers
Address locations 0Ah-0Eh contain the alarm settings. The alarm can be configured to go
off at a prescribed time on a specific month, date, hour, minute, or second or repeat every
year, month, day, hour, minute, or second.
Bits RPT5-RPT1 put the alarm in the repeat mode of operation. Table 4: Alarm repeat
modes shows the possible configurations. Codes not listed in the table default to the once
per second mode to quickly alert the user of an incorrect alarm setting.
When the clock information matches the alarm clock settings based on the match criteria
defined by RPT5-RPT1, the AF (alarm flag) is set. If AFE (alarm flag enable) is also set (and
SQWE is '0.'), the alarm condition activates the IRQ
/OUT/SQW pin.
Note: If the address pointer is allowed to increment to the flag register address, an alarm condition
will not cause the interrupt/flag to occur until the address pointer is moved to a different
address. It should also be noted that if the last address written is the “Alarm Seconds,” the
address pointer will increment to the flag address, causing this situation to occur.
The IRQ
/OUT/SQW output is cleared by a READ to the flags register as shown in Figure 11.
A subsequent READ of the flags register is necessary to see that the value of the alarm flag
has been reset to '0.'
Figure 11. Alarm interrupt reset waveform
Table 4. Alarm repeat modes
RPT5 RPT4 RPT3 RPT2 RPT1 Alarm setting
1 1 1 1 1 Once per second
1 1 1 1 0 Once per minute
1 1 1 0 0 Once per hour
1 1 0 0 0 Once per day
1 0 0 0 0 Once per month
0 0 0 0 0 Once per year
IRQ/OUT/SQW
ACTIVE FLAG
0Fh0Eh 10h
HIGH-Z
AI07021

M41T80M6F

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
Real Time Clock Serial 160 (20x8)
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet