
Application Manua l
Real Time Clock Module RX-8581SA/JE/NB


In pursuit of "Saving" Technology ,Epson electronic device. Our Lineup of semiconductors, Liquid crystal displays and quartz devices assists in creating the products of our customers' dreams. Epson IS energy savings.
written permission of Seiko Epson. • The information, applied circuit, program, using way etc., written in this material is just for reference.
Seiko Epson does not assume any liability for the occurrence of infringing any patent or copyright of third party. This material does not authorize the licence for any patent or intellectual property rights. • Any product described in this material may contain technology or the subject relating to strategic
products under the control of the Foreign Exchange and Foreign Trade Law of Japan and may require an export licence from the Ministry of International Trade and industry or other approval from another government agency. • The products (except for some product for automotive applications) listed up on this material are designed
to be used with ordinary electronic equipment (OA equipment, AV equipment, communications equipment, measuring instruments etc). Seiko Epson does not assume any liability for the case using the products with the appoication required high reliability or safety extremely (such as aerospace equipment etc). When intending to use any our product with automotive application and the other application than ordinary electronic equipments as above, please contact our sales representatives in advance.



I2C-Bus Interface Real-time Clock Module RX - 8581 SA / JE / NB
This module is an I2C bus interface-compliant real-time clock which includes a 32.768-kHz crystal oscillator. In addition to providing a calendar (year, month, date, day, hour, minute, second) function and a clock counter function, this module provides an abundance of other functions including an alarm function, fixed-cycle timer function, time update interrupt function, and 32.768-kHz output function. The devices in this module are fabricated via a C-MOS process for low current consumption, which enables long-term battery back-up. All of these many functions are implemented in a thin, compact SON package, which makes it suitable for various kinds of mobile telephones and other small electronic devices. 2. Block Diagram
32.768 kHz
DIVIDER
OSC
CALENDAR
FOUT
TIMER
FOUT
FOE
CONTROLLER
REGISTER
INTERRUPT
ALARM
/ INT
CONTROLLER
REGISTER
I 2 C-BUS
CONTROL
REGISTER
SCL
INTERFACE
SDA
CIRCUIT
CONTROLLER
and · and SYSTEM


3.2. Pin Functions





BIT 7
BIT 6
BIT 0
ACK
STOP CONDITION
START CONDITION
MSB
(A6)
LSB (R/W)
(A)
(S)
(A7)
(P)
(S)
tSU ; STA
tLOW tHIGH 1 / fSCL
tSU ; STA
(S)
(P)
(S)
tr tf
(A)
tHD ; DAT tSU ; DAT tHD ; STA
tSU ; STO
tHD ; STA

This function is used to set and read out month, day, hour, date, minute, second, and year (last two digits) data. Any (two-digit) year that is a multiple of 4 is treated as a leap year and calculated automatically as such until the year 2099. ∗ For details, see "8.2. Description of Registers". 2) Fixed-cycle interrupt generation function
The fixed-cycle timer interrupt generation function generates an interrupt event periodically at any fixed cycle set between 244.14 µs and 4095 minutes. When an interrupt event is generated, the /INT pin goes to low level ("L") and "1" is set to the TF bit to report that an event has occurred. (However, when a fixed-cycle timer interrupt event has been generated, low-level output from the /INT pin occurs only when the value of the control register's TIE bit is "1". Up to 7.8 ms after the interrupt occurs, the /INT status is automatically cleared (/INT status changes from low level to Hi-Z). ∗ For details, see "8.3. Fixed-cycle Interrupt Function". . 3) Time update interrupt function
The time update interrupt function generates interrupt events at one-second or one-minute intervals, according to the timing of the internal clock. When an interrupt event occurs, the UF bit value becomes "1" and the /INT pin goes to low level to indicate that an event has occurred. (However, when a fixed-cycle timer interrupt event has been generated, low-level output from the /INT pin occurs only when the value of the control register's UIE bit is "1". This /INT status is automatically cleared (/INT status changes from low level to Hi-Z) 7.8 ms (a fixed value) after the interrupt occurs. ∗ For details, see "8.4. Time Update Interrupt Function". 4) Alarm interrupt function
The alarm interrupt generation function generates interrupt events for alarm settings such as date, day, hour, and minute settings. When an interrupt event occurs, the AF bit value is set to "1" and the /INT pin goes to low level to indicate that an event has occurred. ∗ For details, see "8.5. Alarm Interrupt Function". 5) 32.768-kHz clock output
The 32.768-kHz clock (with precision equal to that of the built-in crystal oscillator) can be output via the FOUT pin. The FOUT pin is a CMOS output pin which can be set for clock output when the FOE pin is at high level and for low-level output when the FOE pin is at low level. 6) Interface with CPU
Data is read and written via the I2C bus interface using two signal lines: SCL (clock) and SDA (data). Since neither SCL nor SDA includes a protective diode on the VDD side, a data interface between hosts with differing supply voltages can still be implemented by adding pull-up resistors to the circuit board. The SCL's maximum clock frequency is 400 kHz (when VDD ≥ 1.8 V), which supports the I2C bus's high-speed mode. ∗ For further description of data read/write operations, see "8.6 Reading/Writing Data via the I2C Bus Interface".

8.2. Description of Registers 8.2.1. Register table
Note When after the initial power-up or when the result of read out the VLF bit is "1" , initialize all registers, before using the module. Be sure to avoid entering incorrect date and time data, as clock operations are not guaranteed when the data or time data is incorrect. ∗1) During the initial power-up, the TEST bit is reset to "0" and the VLF bit is set to "1". ∗ At this point, all other register values are undefined, so be sure to perform a reset before using the module. ∗2) Only a "0" can be written to the UF, TF, AF, or VLF bit. ∗3) Any bit marked with "!" should be used with a value of "0" after initialization. ∗4) Any bit marked with "•" is a RAM bit that can be used to read or write any data. ∗5) The TEST bit is used by the manufacturer for testing. Be sure to set "0" for this bit when writing.



∗ For details, see "8.5. Alarm Interrupt Function".
[Caution] (1) The /INT pin is a shared interrupt output pin for three types of interrupts. It outputs the OR'ed result of these interrupt outputs.
When an interrupt has occurred (when the /INT pin is at low level), the UF, TF, read AF flags to determine which flag has a value of "1" (this indicates which type of interrupt event has occurred). (2) To keep the /INT pin from changing to low level, write "0" to the UIE, TIE, and AIE bits. To check whether an event has occurred without
outputting any interrupts via the /INT pin, use software to monitor the value of the UF, TF, and AF interrupt flags.

5) RESET bit Like the STOP function described above, this function stops functions related to counter operations. It also resets the RTC module's internal counter value when the value is less than one second. Writing a "1" to this bit stops the counter operation and resets the RTC module's internal counter value when the value is less than one second. Writing a "0" to this bit cancels stop status for (restarts) these operations. If a STOP condition or repeated START condition is received while the 0.95-second bus timeout function is operating, stop status is automatically canceled (the RESET bit value is changed from "1" to "0"). ∗ For optimum performance, do not use this bit for functions other than the clock and calendar functions.

8.2.3. Flag register (Reg-E)
∗1) The default value is the value that is read (or is set internally) after powering up from 0 V. ∗2) "o" indicates write-protected bits. A zero is always read from these bits. ∗3) "−" indicates a default value is undefined. • This register is used to detect the occurrence of various interrupt events and reliability problems in internal data. 1) UF (Update Flag) bit If set to "0" beforehand, this flag bit's value changes from "0" to 1" when a time update interrupt event has occurred. Once this flag bit's value is "1", its value is retained until a "0" is written to it. ∗ For details, see "8.4. Time Update Interrupt Function".


8.2.4. Extension register (Reg-D)
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
D (Default) (0) (−) (−) (−) (0) (0) (−) (−)
Extension Register TEST WADA USEL TE ! ! TSEL1 TSEL0
∗1) The default value is the value that is read (or is set internally) after powering up from 0 V. ∗2) "o" indicates write-protected bits. A zero is always read from these bits. ∗3) "−" indicates a default value is undefined. • This register is used to specify the target for the alarm function or time update interrupt function and to select or set operations such as fixed-cycle timer operations. 1) TEST bit This is the manufacturer's test bit. Its value should always be "0". Be careful to avoid writing a "1" to this bit when writing to other bits. ∗ If a "1" is inadvertently written to this TEST bit, there is a safety function where by this bit will be automatically cleared to zero when a STOP condition or Repeated START condition is received or when the 0.95-second bus timeout function operates.

3) USEL (Update Interrupt Select) bit This bit is used to specify either "second update" or "minute update" as the update generation timing of the time update interrupt function. Writing a "1" to this bit specifies the internal clock's "minute update" (once per minute) operation as the timing by which time update interrupts are generated. Writing a "0" to this bit specifies the internal clock's "second update" (once per second) operation as the timing by which time update interrupts are generated. ∗ For details, see "8.4. Time Update Interrupt Function".

0 0 4096 Hz /Once per 244.14 µs
0 1 64 Hz / Once per 15.625 ms
∗ For details, see "8.3. Fixed-cycle Timer Interrupt Function". 8.2.5. RAM register (Reg - 7)
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

8.2.6. Clock counter (Reg - 0 ∼ 2)

Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
0 SEC ! 40 20 10 8 4 2 1
1 MIN ! 40 20 10 8 4 2 1
2 HOUR ! ! 20 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
0 SEC ! 40 20 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
1 MIN ! 40 20 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
2 HOUR ! ! 20 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
3 WEEK ! 6 5 4 3 2 1 0
∗) "o" indicates write-protected bits. A zero is always read from these bits.

WEEK bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 Day Data [h]
0 1 Sunday 01 h
0 1 0 Monday 02 h
0 1 0 0 Tuesday 04 h
0 1 0 0 0 Wednesday 08 h
0 0 0 1 0 Thursday 10 h
0 0 1 0 Friday 20 h
0 1 0 Saturday 40 h
∗ Do not set "1" to more than one day at the same time.
Also, note with caution that any setting other than the seven shown above should not be made as it may interfere with normal operation.

8.2.8. Calendar counter (Reg 4 to 6)

Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
4 DAY ! ! 20 10 8 4 2 1
5 MONTH ! ! ! 10 8 4 2 1
6 YEAR 80 40 20 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
4 DAY ! ! 20 10 8 4 2 1

1, 3, 5, 7, 8, 10, or 12 01, 02, 03 ∼ 30, 31, 01 ∼ 4, 6, 9, or 11 01, 02, 03 ∼ 30, 01, 02 ∼ February in normal year 01, 02, 03 ∼ 28, 01, 02 ∼ Write/Read
February in leap year 01, 02, 03 ∼ 28, 29, 01 ∼ 2) Month counter
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
5 MONTH ! ! ! 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
6 Years Y80 Y40 Y20 Y10 Y8 Y4 Y2 Y1

Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
8 MIN Alarm AE 40 20 10 8 4 2 1
9 HOUR Alarm AE • 20 10 8 4 2 1
WEEK Alarm 6 5 4 3 2 1 0
A DAY Alarm AE • 20 10 8 4 2 1
Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
B Timer Counter 0 128 64 32 16 8 4 2 1

8.3. Fixed-cycle Timer Interrupt Function
The fixed-cycle timer interrupt generation function generates an interrupt event periodically at any fixed cycle set between 244.14 µs and 4095 minutes. When an interrupt event is generated, the /INT pin goes to low level and "1" is set to the TF bit to report that an event has occurred. (However, when a fixed-cycle timer interrupt event has been generated low-level output from the /INT pin occurs only when the value of the control register's TIE bit is "1". Up to 7.8 ms after the interrupt occurs, the /INT status is automatically cleared (/INT status changes from low-level to Hi-Z).

TIE = " 1 " TE = " 0 " → " 1 "
period TIE = " 1 " → " 0 "
8.3.1. Diagram of fixed-cycle timer interrupt function

∗ Even when the TE bit is cleared to zero, /INT remains low during the tRTN time.
∗ Even when the TF bit is cleared to zero, the /INT status does not change.
∗ When the TE bit value changes from "0" to "1" the fixed-cycle timer function starts. The counter always starts counting down from the preset value when the TE value changes from "0" to "1".
(1) When a "1" is written to the TE bit, the fixed-cycle timer countdown starts from the preset value. (2) A fixed-cycle timer interrupt event starts a countdown based on the countdown period (source clock). When
the count value changes from 001h to 000h, an interrupt event occurs. ∗ After the interrupt event that occurs when the count value changes from 001h to 000h, the counter automatically reloads the preset value and again starts to count down. (Repeated operation) (3) When a fixed-cycle timer interrupt event occurs, "1" is written to the TF bit. (4) When the TF bit = "1" its value is retained until it is cleared to zero. (5) If the TIE bit = "1" when a fixed-cycle timer interrupt occurs, /INT pin output goes low.
∗ If the TIE bit = "0" when a fixed-cycle timer interrupt occurs, /INT pin output remains Hi-Z. (6) Output from the /INT pin remains low during the tRTN period following each event, after which it is
automatically cleared to Hi-Z status. ∗ /INT is again set low when the next interrupt event occurs. (7) When a "0" is written to the TE bit, the fixed-cycle timer function is stopped and the /INT pin is set to Hi-Z
status. ∗ When /INT = low, the fixed-cycle timer function is stopped. The tRTN period is the maximum amount of time before the /INT pin status changes from low to Hi-Z. (8) As long as /INT = low, the /INT pin status does not change when the TF bit value changes from "1" to "0". (9) When /INT = low, the /INT pin status changes from low to Hi-Z as soon as the TIE bit value changes from "1" to
"0".

8.3.2. Related registers for function of time update interrupts. Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

B Timer Counter 0 128 64 32 16 8 4 2 1
D Extension Register TEST WADA USEL TE ! ! TSEL1 TSEL0
E Flag Register ! ! UF TF AF ! VLF !
F Control Register ! ! UIE TIE AIE ! STOP RESET
∗1) "o" indicates write-protected bits. A zero is always read from these bits. ∗2) Bits marked with "•" are RAM bits that can contain any value and are read/write-accessible. ∗ Before entering settings for operations, we recommend writing a "0" to the TE and TIE bits to prevent hardware
interrupts from occurring inadvertently while entering settings. ∗ When the STOP bit or RESET bit value is "1" the time update interrupt function operates only partially. (Operation continues if the source clock setting is 4096 Hz. Otherwise, operation is stopped.) ∗ When the fixed-cycle timer interrupt function is not being used, the fixed-cycle timer control register (Reg – B to C) can be used as a RAM register. In such cases, stop the fixed-cycle timer function by writing "0" to the TE and TIE bits. 1) TSEL0,1 bits (Timer Select 0, 1) The combination of these two bits is used to set the countdown period (source clock) for the fixed-cycle timer interrupt function (four settings can be made).

0 0 4096 Hz /Once per 244.14 µs 122 µs −
0 1 64 Hz / Once per 15.625 ms 7.8125 ms
1 0 "Second" update /Once per second 7.8125 ms
when the STOP bit or RESET bit value is "1".
1 1 "Minute" update /Once per minute 7.8125 ms
∗1) The /INT pin's auto reset time (tRTN) varies as shown above according to the source clock setting. ∗2) When the source clock has been set to "second update" or "minute update", the timing of both
countdown and interrupts is coordinated with the clock update timing. 2) Fixed-cycle Timer Control register (Reg - B ∼ C) This register is used to set the default (preset) value for the counter. Any count value from 1 (001 h) to 4095 (FFFh) can be set. The counter counts down based on the source clock's period, and when the count value changes from 001h to 000h, the TF bit value becomes "1". The countdown that starts when the TE bit value changes from "0" to "1" always begins from the preset value. Be sure to write "0" to the TE bit before writing the preset value. If a value is written while TE = "1" the first subsequent event will not be generated correctly.
Address B Timer Counter 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
Address C Timer Counter 1

1 Starts fixed-cycle timer interrupt function. ∗ The countdown that starts when the TE bit value changes from "0" to "1" always begins from the

0 The TF bit is cleared to zero to prepare for the next status detection ∗ Clearing this bit to zero does not enable the /INT low output status to be cleared (to Hi-Z). Write
1 This bit is invalid after a "1" has been written to it.
0 Fixed-cycle timer interrupt events are not detected. Read
1 Fixed-cycle timer interrupt events are detected. (Result is retained until this bit is cleared to zero.)

may hold /INT = "L"). Write/Read
When a fixed-cycle timer interrupt event occurs, an interrupt signal is generated (/INT status changes from Hi-Z to low). ∗ When a fixed-cycle timer interrupt event has been generated low-level output from the /INT pin
occurs only when the value of the control register's TIE bit is "1". Up to 7.8 ms after the interrupt occurs, the /INT status is automatically cleared (/INT status changes from low to Hi-Z).
8.3.3. Fixed-cycle timer interrupt interval (example)

TSEL1,0 = 1,1 0 − 1 244.14 µs 15.625 ms 1 s 1 min 2 488.28 µs 31.25 ms 2 s 2 min
41 10.010 ms 640.63 ms 41 s 41 min 205 50.049 ms 3.203 s 205 s 205 min 410 100.10 ms 6.406 s 410 s 410 min 2048 500.00 ms 32.000 s 2048 s 2048 min
4095 0.9998 s 63.984 s 4095 s 4095 min
(Fixed-cycle timer's time setting (∗) − source clock period) to (timer's time setting) ∗) The timer's time setting = source clock period × timer counter's division value.
∗ The time actually set to the timer is adjusted by adding the time described above to the
communication time for the serial data transfer clock used for the setting. 8.3.4. Fixed-cycle timer start timing
Counting down of the fixed-cycle timer value starts at the rising edge of the SCL signal that occurs when the TE value is changed from "0" to "1" (after bit 0 is transferred).


8.4. Time Update Interrupt Function
The time update interrupt function generates interrupt events at one-second or one-minute intervals, according to the timing of the internal clock. When an interrupt event occurs, the UF bit value becomes "1" and the /INT pin goes to low level to indicate that an event has occurred. (However, when a fixed-cycle timer interrupt event has been generated, low-level output from the /INT pin occurs only when the value of the control register's UIE bit is "1". This /INT status is automatically cleared (/INT status changes from low level to Hi-Z) 7.8 ms (fixed value) after the interrupt occurs.

period UIE = " 1 " → " 0 "
8.4.1. Time update interrupt function diagram

∗ /INT status does not change when UF bit is cleared to zero.
(1) A time update interrupt event occurs when the internal clock's value matches either the second update time or
the minute update time. The USEL bit's specification determines whether it is the second update time or the minute update time that must be matched. (2) When a time update interrupt event occurs, the UF bit value becomes "1". (3) When the UF bit value is "1" its value is retained until it is cleared to zero. (4) When a time update interrupt occurs, /INT pin output is low if UIE = "1". ∗ If UIE = "0" when a timer update interrupt occurs, the /INT pin status remains Hi-Z. (5) Each time an event occurs, /INT pin output is low only up to the tRTN time (which is fixed as 7.1825 ms for
time update interrupts) after which it is automatically cleared to Hi-Z. ∗ /INT pin output goes low again when the next interrupt event occurs. (6) As long as /INT = low, the /INT pin status does not change, even if the UF bit value changes from "1" to "0". (7) When /INT = low, the /INT pin status changes from low to Hi-Z as soon as the UIE bit value changes from "1"
to "0".

8.4.2. Related registers for time update interrupt functions.

Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
D Extension Register TEST WADA USEL TE ! ! TSEL1 TSEL0
E Flag Register ! ! UF TF AF ! VLF !
F Control Register ! ! UIE TIE AIE ! STOP RESET
∗) "o" indicates write-protected bits. A zero is always read from these bits.
∗ Before entering settings for operations, we recommend writing a "0" to the UIE bit to prevent hardware interrupts
from occurring inadvertently while entering settings.
∗ When the STOP bit or RESET bit value is "1" time update interrupt events do not occur. ∗ Although the time update interrupt function cannot be fully stopped, if "0" is written to the UIE bit, the time update
interrupt function can be prevented from changing the /INT pin status to low. 1) USEL (Update Interrupt Select) bit This bit is used to select "second" update or "minute" update as the timing for generation of time update interrupt events.

0 Selects "second update" (once per second) as the timing for generation of interrupt events Write/Read
1 Selects "minute update" (once per minute) as the timing for generation of interrupt events

0 The UF bit is cleared to zero to prepare for the next status detection ∗ Clearing this bit to zero does not enable the /INT low output status to be cleared (to Hi-Z). Write
1 This bit is invalid after a "1" has been written to it.
0 Time update interrupt events are not detected. Read
1 Time update interrupt events are detected. (The result is retained until this bit is cleared to zero.)
may hold /INT = "L"). Write/Read
When a time update interrupt event occurs, an interrupt signal is generated (/INT status changes from Hi-Z to low). ∗ When a time update interrupt event occurs, low-level output from the /INT pin occurs only when
the UIE bit value is "1". Up to 7.8 ms after the interrupt occurs, the /INT status is automatically cleared (/INT status changes from low to Hi-Z).
UIE Data Description

8.5. Alarm Interrupt Function
The alarm interrupt generation function generates interrupt events for alarm settings such as date, day, hour, and minute settings. When an interrupt event occurs, the AF bit value is set to "1" and the /INT pin goes to low level to indicate that an event has occurred.

( AF = " 0 " → " 1 " )
AF = " 1 " → " 0 " or AIE = " 1 " → " 0 "
8.4.1. Diagram of alarm interrupt function

(1) The hour, minute, date or day when an alarm interrupt event is to occur is set in advance along with the
WADA bit, and when the setting matches the current time an interrupt event occurs. (Note) Even if the current date/time is used as the setting, the alarm will not occur until the counter counts up to the current date/time (i.e., an alarm will occur next time, not immediately). (2) When a time update interrupt event occurs, the AF bit values becomes "1". (3) When the AF bit = "1", its value is retained until it is cleared to zero. (4) If AIE = "1" when an alarm interrupt occurs, the /INT pin output goes low. ∗ When an alarm interrupt event occurs, /INT pin output goes low, and this status is then held until it is cleared via the AF bit or AIE bit. (5) If the AIE value is changed from "1" to "0" while /INT is low, the /INT status immediately changes from low to
Hi-Z. After the alarm interrupt occurs and before the AF bit value is cleared to zero, the /INT status can be controlled via the AIE bit. (6) If the AF bit value is changed from "1" to "0" while /INT is low, the /INT status immediately changes from low
to Hi-Z. (7) If the AIE bit value is "0" when an alarm interrupt occurs, the /INT pin status remains Hi-Z.

8.5.2. Related registers

Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
1 MIN ! 40 20 10 8 4 2 1
2 HOUR ! ! 20 10 8 4 2 1
3 WEEK ! 6 5 4 3 2 1 0
4 DAY ! ! 20 10 8 4 2 1
8 MIN Alarm AE 40 20 10 8 4 2 1
9 HOUR Alarm AE • 20 10 8 4 2 1
WEEK Alarm 6 5 4 3 2 1 0
A DAY Alarm AE • 20 10 8 4 2 1
D Extension Register TEST WADA USEL TE ! ! TSEL1 TSEL0
E Flag Register ! ! UF TF AF ! VLF !
F Control Register ! ! UIE TIE AIE ! STOP RESET
∗1) "o" indicates write-protected bits. A zero is always read from these bits. ∗2) Bits marked with "•" are RAM bits that can contain any value and are read/write-accessible. ∗ Before entering settings for operations, we recommend writing a "0" to the AIE bit to prevent hardware interrupts
from occurring inadvertently while entering settings. ∗ When the STOP bit or RESET bit value is "1" alarm interrupt events do not occur. ∗ When the alarm interrupt function is not being used, the Alarm registers (Reg - 8 to A) can be used as a RAM
register. In such cases, be sure to write "0" to the AIE bit. ∗ When the AIE bit value is "1" and the Alarm registers (Reg - 8 to A) is being used as a RAM register, /INT may be
changed to low level unintentionally. 1) WADA (Week Alarm /Day Alarm) bit The alarm interrupt function uses either "Day" or "Week" as its target. The WADA bit is used to specify either WEEK or DAY as the target for alarm interrupt events.

0 Sets WEEK as target of alarm function (DAY setting is ignored) Write/Read
1 Sets DAY as target of alarm function (WEEK setting is ignored)

Address Function bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
8 MIN Alarm AE 40 20 10 8 4 2 1
9 HOUR Alarm AE • 20 10 8 4 2 1
WEEK Alarm 6 5 4 3 2 1 0
A DAY Alarm AE • 20 10 8 4 2 1
The hour, minute, date or day when an alarm interrupt event will occur is set using this register and the WADA bit. In the WEEK alarm /Day alarm register (Reg - A), the setting selected via the WADA bit determines whether WEEK alarm data or DAY alarm data will be set. If WEEK has been selected via the WADA bit, multiple days can be set (such as Monday, Wednesday, Friday, Saturday). When the settings made in the alarm registers and the WADA bit match the current time, the AF bit value is changed to "1". At that time, if the AIE bit value has already been set to "1", the /INT pin goes low. ∗1) The register that "1" was set to "AE" bit, doesn't compare alarm.
(Example) Write 80h (AE = "1") to the WEEK Alarm /DAY Alarm register (Reg - A): Only the hour and minute settings are used as alarm comparison targets. The week and date settings are not used as alarm comparison targets. As a result, alarm occurs if only an hour and minute accords with alarm data. ∗2) If all three AE bit values are "1" the week/date settings are ignored and an alarm interrupt event will
occur once per minute.


0 The AF bit is cleared to zero to prepare for the next status detection ∗ Clearing this bit to zero enables /INT low output to be canceled (/INT remains Hi-Z) when an alarm
1 This bit is invalid after a "1" has been written to it.
1 Alarm interrupt events are detected. (Result is retained until this bit is cleared to zero.)
(or may hold /INT = "L"). Write/Read
When an alarm interrupt event occurs, an interrupt signal is generated (/INT status changes from Hi-Z to low). ∗ When an alarm interrupt event occurs, low-level output from the /INT pin occurs only when the
AIE bit value is "1". This value is retained (not automatically cleared) until the AF bit is cleared to zero.
8.5.2. Examples of alarm settings

Reg – A Reg - 9 Reg - 8 Day is specified
Monday through Friday, at 7:00 AM ∗ Minute value is ignored 0 0 1 0 07 h 80 h ∼ FF h
Every Saturday and Sunday, for 30 minutes each hour ∗ Hour value is ignored 0 1 0 1 80 h ∼ FF h 30 h

Reg - A Reg - 9 Reg - 8 Day is specified
First of each month, at 7:00 AM ∗ Minute value is ignored 0 1 07 h 80 h ∼ FF h
15th of each month, for 30 minutes each hour ∗ Hour value is ignored 0 0 0 1 0 1 0 1 80 h ∼ FF h 30 h
Every day, at 6:59 PM 1 Χ 18 h 59 h
AIE Data Description

8.6. Reading/Writing Data via the I2C Bus Interface 8.6.1. Overview of I2C-BUS The I2C bus supports bi-directional communications via two signal lines: the SDA (data) line and SCL (clock) line. A combination of these two signals is used to transmit and receive communication start/stop signals, data transfer signals, acknowledge signals, and so on. Both the SCL and SDA signals are held at high level whenever communications are not being performed. The starting and stopping of communications is controlled at the rising edge or falling edge of SDA while SCL is at high level. During data transfers, data changes that occur on the SDA line are performed while the SCL line is at low level, and on the receiving side the data is output while the SCL line is at high level. The I2C bus device does not include a chip select pin such as is found in ordinary logic devices. Instead of using a chip select pin, slave addresses are allocated to each device and the receiving device responds to communications only when its slave address matches the slave address in the received data. In either case, the data is transferred via the SCL line at a rate of one bit per clock pulse. 8.6.2. System configuration All ports connected to the I2C bus must be either open drain or open collector ports in order to enable AND connections to multiple devices. SCL and SDA are both connected to the VDD line via a pull-up resistance. Consequently, SCL and SDA are both held at high level when the bus is released (when communication is not being performed).
SDA SCL
Other I2C bus device CPU, etc. RX - 8581
Any device that controls the data transmission and data reception is defined as a "Master". and any device that is controlled by a master device is defined as a “Slave”. The device transmitting data is defined as a “Transmitter” and the device receiving data is defined as a receiver” In the case of this RTC module, controllers such as a CPU are defined as master devices and the RTC module is defined as a slave device. When a device is used for both transmitting and receiving data, it is defined as either a transmitter or receiver depending on these conditions.

8.6.3. Starting and stopping I2C bus communications

SDA
0.95 s ( Max. )
transmissions, so communications can be forcibly stopped at any time while in progress. (However, this is only when this RTC module is in receiver mode (data reception mode = SDA released). ∗3) When communicating with this RTC module, the series of operations from transmitting the START
condition to transmitting the STOP condition should occur within 0.95 seconds. (A RESTART condition may be sent between a START condition and STOP condition, but even in such cases the series of operations from transmitting the START condition to transmitting the STOP condition should still occur within 0.95 seconds.) If this series of operations requires 0.95 seconds or longer, the I2C bus interface will be automatically cleared and set to standby mode by this RTC module's bus timeout function. Note with caution that both write and read operations are invalid for communications that occur during or after this auto clearing operation. (When the read operation is invalid, all data that is read has a value of "1"). Restarting of communications begins with transfer of the START condition again ∗4) When communicating with this RTC module, wait at least 1.3 µs (see the tBUF rule) between
transferring a STOP condition (to stop communications) and transferring the next START condition (to start the next round of communications).

SDA
61 µs (Min.)

8.6.4. Data transfers and acknowledge responses during I2C-BUS communications
1) Data transfers Data transfers are performed in 8-bit (1 byte) units once the START condition has occurred. There is no limit on the amount (bytes) of data that are transferred between the START condition and STOP condition. (However, the transfer time must be no longer than 0.95 seconds.) The address auto increment function operates during both write and read operations. After address Fh, incrementation goes to address 0h. Updating of data on the transmitter (transmitting side)'s SDA line is performed while the SCL line is at low level. The receiver (receiving side) receives data while the SCL line is at high level.

SDA
∗ Note with caution that if the SDA data is changed while the SCL line is at high level, it will be treated as a START, RESTART, or STOP condition.
2) Data acknowledge response (ACK signal) When transferring data, the receiver generates a confirmation response (ACK signal, low active) each time an 8-bit data segment is received. If there is no ACK signal from the receiver, it indicates that normal communication has not been established. (This does not include instances where the master device intentionally does not generate an ACK signal.) Immediately after the falling edge of the clock pulse corresponding to the 8th bit of data on the SCL line, the transmitter releases the SDA line and the receiver sets the SDA line to low (= acknowledge) level.

SDA from transmitter (sending side)
SDA from receiver (receiving side)
After transmitting the ACK signal, if the Master remains the receiver for transfer of the next byte, the SDA is released at the falling edge of the clock corresponding to the 9th bit of data on the SCL line. Data transfer resumes when the Master becomes the transmitter. When the Master is the receiver, if the Master does not send an ACK signal in response to the last byte sent from the slave, that indicates to the transmitter that data transfer has ended. At that point, the transmitter continues to release the SDA and awaits a STOP condition from the Master. 8.6.5. Slave address
The I2C bus device does not include a chip select pin such as is found in ordinary logic devices. Instead of using a chip select pin, slave addresses are allocated to each device. All communications begin with transmitting the [START condition] + [slave address (+ R/W specification)]. The receiving device responds to this communication only when the specified slave address it has received matches its own slave address. Slave addresses have a fixed length of 7 bits. This RTC's slave address is [1010 001∗]. An R/W bit ("*" above) is added to each 7-bit slave address during 8-bit transfers.

bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
Write A2 h 1 0 1 0 0 0 1 0 (= Write)
SCL from Master · ACK signal

8.6.6. I2C bus protocol
In the following sequence descriptions, it is assumed that the CPU is the master and the RX-8581 is the slave. a. Address specification write sequence
Since the RX-8581 includes an address auto increment function, once the initial address has been specified, the RX-8581 increments (by one byte) the receive address each time data is transferred.
(1) CPU transfers start condition [S]. (2) CPU transmits the RX-8581's slave address with the R/W bit set to write mode. (3) Check for ACK signal from RX-8581. (4) CPU transmits write address to RX-8581. (5) Check for ACK signal from RX-8581. (6) CPU transfers write data to the address specified at (4) above. (7) Check for ACK signal from RX-8581. (8) Repeat (6) and (7) if necessary. Addresses are automatically incremented. (9) CPU transfers stop condition [P].
P
R/W
ACK signal from RX-8581
b. Address specification read sequence
After using write mode to write the address to be read, set read mode to read the actual data.
(1) CPU transfers start condition [S]. (2) CPU transmits the RX-8581's slave address with the R/W bit set to write mode. (3) Check for ACK signal from RX-8581. (4) CPU transfers address for reading from 8581. (5) Check for ACK signal from RX-8581. (6) CPU transfers RESTART condition [Sr] (in which case, CPU does not transfer a STOP condition [P]). (7) CPU transfers RX-8581's slave address with the R/W bit set to read mode. (8) Check for ACK signal from RX-8581 (from this point on, the CPU is the receiver and the RX-8581 is the transmitter). (9) Data from address specified at (4) above is output by the RX-8581. (10) CPU transfers ACK signal to RX-8581. (11) Repeat (9) and (10) if necessary. Read addresses are automatically incremented. (12) CPU transfers ACK signal for "1". (13) CPU transfers stop condition [P].
P
R/W
R/W
c. Read sequence when address is not specified
ACK from RX-8581 ACK from CPU
Once read mode has been initially set, data can be read immediately. In such cases, the address for each read operation is the previously accessed address + 1.
(1) CPU transfers start condition [S]. (2) CPU transmits the RX-8581's slave address with the R/W bit set to read mode. (3) Check for ACK signal from RX-8581 (from this point on, the CPU is the receiver and the RX-8581 is the transmitter). (4) Data is output from the RX-8581 to the address following the end of the previously accessed address. (5) CPU transfers ACK signal to RX-8581. (6) Repeat (4) and (5) if necessary. Read addresses are automatically incremented in the RX-8581. (7) CPU transfers ACK signal for "1". (8) CPU transfers stop condition [P].
P
R/W
ACK from CPU ACK from RX-8581

8.7. Backup and Recovery

V CLK

Power supply drop time t F 2 µs /V
Initial power-up time t R1 1 µs /V 10 ms /V
Clock maintenance power-up time t R2 1 µs /V 8.8. Connection with Typical Microcontroller


10.1 ± 0.2
0° - 10° 1.4
7.4 ± 0.2
0.05 Min. 3.2 ± 0.1
1.27 × 6 = 7.62
1.27 1.2
(0.75)
7.0 ± 0.3
6.0 ± 0.2
0.35 0.65
(0.75)
0.65 × 9 = 5.85
1.3 1.5 Max.
0.65 0.22
0 Min.
0.12 0.1
6.3 Max.
0.75 0.25
(0.3)
4.0 0.7 0.7
5.0 ± 0.2
0.5 0.2 #1
1.3 ± 0.1
∗1) The crystal oscillator's metal case may be visible in the area (on front and top) indicated in broken lines , but this has no effect on the device's characteristics. ∗2) Do not lay out signal patterns on component surfaces indicated by the shaded areas in the soldering diagram .

(1) Example of frequency and temperature characteristics
[Finding the frequency stability] 1. Frequency and temperature characteristics can be approximated using the following equations. ∆fT = α (θT - θX)2
θT = +25 °C Typ. α = -0.035 × 10-6 Typ.
Frequency ∆fT
temperature α (1 / °C2) : Coefficient of secondary temperature (−0.035±0.005) × 10-6 / °C2 θT (°C) : Ultimate temperature (+25±5 °C) θX (°C) : Any temperature 2. To determine overall clock accuracy, add the frequency precision and voltage characteristics. ∆f/f = ∆f/fo + ∆fT + ∆fV
-50 0 +50 +100
Temperature [°C]
(2) Example of frequency and voltage characteristics
temperature and voltage ∆f/fo : Frequency precision ∆fT : Frequency deviation in any temperature ∆fV : Frequency deviation in any voltage 3. How to find the date difference Date difference = ∆f/f × 86400 (seconds) * For example: ∆f/f = 11.574 × 10-6 is an error of approximately 1 second/day.
Condition :
3 V as reference, Ta=+25 °C
Frequency ∆fv
× 10−6
Supply Voltage VDD[V]
(3) Current and voltage consumption characteristics
(3-1) Current consumption when non-accessed (i)
(3-2) Current consumption when non-accessed (ii)
when FOUT=32.768 kHz
Condition : Ta = +25 °C fSCL = 0 Hz FOE = GND, /INT = VDD FOUT ; Output OFF
Condition : Ta = +25 °C fSCL = 0 Hz FOE, /INT = VDD FOUT ; 32.768 kHz output ON
Current consumption [µA]
Current consumption [µA]
Supply Voltage VDD[V]
Supply Voltage VDD[V]

11.1. Notes on handling This module uses a C-MOS IC to realize low power consumption. Carefully note the following cautions when handling. (1) Static electricity
While this module has built-in circuitry designed to protect it against electrostatic discharge, the chip could still be damaged by a large discharge of static electricity. Containers used for packing and transport should be constructed of conductive materials. In addition, only soldering irons, measurement circuits, and other such devices which do not leak high voltage should be used with this module, which should also be grounded when such devices are being used. (2) Noise
If a signal with excessive external noise is applied to the power supply or input pins, the device may malfunction or "latch up." In order to ensure stable operation, connect a filter capacitor (preferably ceramic) of greater that 0.1F as close as possible to the power supply pins (between VDD and GNDs). Also, avoid placing any device that generates high level of electronic noise near this module. * Do not connect signal lines to the shaded area in the figure shown in Fig. 1 and, if possible, embed this area in a GND land. (3) Voltage levels of input pins
When the input pins are at the mid-level, this will cause increased current consumption and a reduced noise margin, and can impair the functioning of the device. Therefore, try as much as possible to apply the voltage level close to VDD or GND. (4) Handling of unused pins
Since the input impedance of the input pins is extremely high, operating the device with these pins in the open circuit state can lead to unstable voltage level and malfunctions due to noise. Therefore, pull-up or pull-down resistors should be provided for all unused input pins. 11.2. Notes on packaging (1) Soldering heat resistance.
If the temperature within the package exceeds +260 °C, the characteristics of the crystal oscillator will be degraded and it may be damaged. The reflow conditions within our reflow profile is recommended. Therefore, always check the mounting temperature and time before mounting this device. Also, check again if the mounting conditions are later changed. * See Fig. 2 profile for our evaluation of Soldering heat resistance for reference. (2) Mounting equipment
While this module can be used with general-purpose mounting equipment, the internal crystal oscillator may be damaged in some circumstances, depending on the equipment and conditions. Therefore, be sure to check this. In addition, if the mounting conditions are later changed, the same check should be performed again. (3) Ultrasonic cleaning
Depending on the usage conditions, there is a possibility that the crystal oscillator will be damaged by resonance during ultrasonic cleaning. Since the conditions under which ultrasonic cleaning is carried out (the type of cleaner, power level, time, state of the inside of the cleaning vessel, etc.) vary widely, this device is not warranted against damage during ultrasonic cleaning. (4) Mounting orientation
This device can be damaged if it is mounted in the wrong orientation. Always confirm the orientation of the device before mounting. (5) Leakage between pins
Leakage between pins may occur if the power is turned on while the device has condensation or dirt on it. Make sure the device is dry and clean before supplying power to it.
Fig. 2 : Reference profile for our evaluation of Soldering heat resistance. RX - 8581 SA ( SOP-14pin )
Temperature [ °C ]
+260 °C Max.
−1 ∼ −5 °C / s
+1 ∼ +5 °C / s
RX - 8581 JE ( VSOJ-20pin )
+1 ∼ +5 °C / s 100 s
time [ s ]
RX - 8581 NB ( SON-22pin )
35 s · Pre-heating area · Stable Melting area

Application Manual AMERICA EPSON ELECTRONICS AMERICA, INC. HEADQUARTER 150 River Oaks Parkway, San Jose, CA 95134, U.S.A. Phone: (1)800-228-3964 (Toll free) : (1)408-922-0200 (Main) Fax: (1)408-922-0238 http://www.eea.epson.com Atlanta Office 3010 Royal Blvd. South, Ste. 170, Alpharetta, GA 30005, U.S.A. Phone: (1)877-332-0020 (Toll free) : (1)770-777-2078 (Main) Fax: (1)770-777-2637 Boston Office 301Edgewater Place, Ste. 120, Wakefield, MA 01880, U.S.A. Phone: (1)800-922-7667 (Toll free) : (1)781-246-3600 (Main) Fax: (1)781-246-5443 Chicago Office 101 Virginia St., Ste. 290, Crystal Lake, IL 60014, U.S.A. Phone: (1)800-853-3588 (Toll free) : (1)815-455-7630 (Main) Fax: (1)815-455-7633 El Segundo Office 1960 E. Grand Ave., 2nd Floor, El Segundo, CA 90245, U.S.A. Phone: (1)800-249-7730 (Toll free) : (1)310-955-5300 (Main) Fax: (1)310-955-5400
EUROPE EPSON EUROPE ELECTRONICS GmbH HEADQUARTER Riesstrasse 15, 80992 Munich, Germany Phone: (49)-(0)89-14005-0 Fax: (49)-(0)89-14005-110 http://www.epson-electronics.de Düsseldorf Branch Office Altstadtstrasse 176, 51379 Leverkusen, Germany Phone: (49)-(0)2171-5045-0 Fax: (49)-(0)2171-5045-10 UK & Ireland Branch Office Unit 2.4, Doncastle House, Doncastle Road, Bracknell, Berkshire RG12 8PE, England Phone: (44)-(0)1344-381700 Fax: (44)-(0)1344-381701 French Branch Office LP 915 Les Conquérants, 1 Avenue de l' Atlantique, Z.A. de Courtaboeuf 2 91976 Les Ulis Cedex, France Phone: (33)-(0)1-64862350 Fax: (33)-(0)1-64862355
ASIA EPSON (CHINA) CO., LTD. 23F, Beijing Silver Tower 2# North RD DongSangHuan ChaoYang District, Beijing, China Phone: (86) 10-6410-6655 Fax: (86) 10-6410-7319 http://www.epson.com.cn 4F, Bldg.,27, No.69, Gui Qing Road, Cao hejing, Shanghai, China Phone: (86) 21-6485-0835 Fax: (86) 21-6485-0775 EPSON HONG KONG LTD. 20/F., Harbour Centre, 25 Harbour Road, Wanchai, Hong kong Phone: (852) 2585-4600 Fax: (852) 2827-2152 http://www.epson.com.hk EPSON ELECTRONIC TECHNOLOGY DEVELOPMENT (SHENZHEN )CO., LTD. 12/F, Dawning Mansion,#12 Keji South Road, Hi-Tech Park, Shenzhen, China Phone: (86) 755-26993828 Fax: (86) 755-26993838 EPSON TAIWAN TECHNOLOGY & TRADING LTD. 14F, No.7, Song Ren Road, Taipei 110 Phone: (886) 2-8786-6688 Fax: (886)2-8786-6660 http://www.epson.com.tw EPSON SINGAPORE PTE. LTD. No.1, Temasek Avenue #36-00, Millenia Tower, Singapore 039192 Phone: (65) 337-7911 Fax: (65) 334-2716 http://www.epson.com.sg SEIKO EPSON CORPORATION KOREA Office 50F, KLI 63 Building,60 Yoido-dong, Youngdeungpo-Ku, Seoul, 150-763, Korea Phone: (82) 2-784-6027 Fax: (82) 2-767-3677 http://www.epson-device.co.kr Gumi Branch Office 6F, Good Morning Securities Bldg., 56, Songjeong-dong Gumi-City, Gyongsangbuk-Do, 730-090, Korea Phone: (82) 54-454-6027 Fax: (82) 54-454-6093
Electronic devices information on WWW server
Pages referenced in this manual — manufacturer, support and downloads.
Owners and our team usually reply within a day — and your question helps the next person too.
Be the first to ask — other owners or our team will answer.