EPSON
EPSON ELECTRONICS AMERICA, INC.
RTC-658X/RTC-659X
9. Update Cycle
The RTC module executes an update cycle once per second. The primary purpose of the update cycle is to the
clock/calendar by one second and to compare the updated time to the two alarm times.
If the time matches the Real-Time-Clock alarm at the end of the update cycle, then the Alarm Flag (bit 5 of Register C)
is set. If Alarm Interrupt Enable (bit 5 of Register B) is set, an Interrupt Request is generated on the IRQ pin and the
IRQF (bit 7 of Register C) is also set.
If the time matches the extended alarm at the end of the update cycle, then the XAF bit is also set. If XAIE is set, an
extended alarm interrupt request is generated on the XIRQ pin. (For RTC-6591/6593/6597 only.)
At the end of every update cycle, the Update Flag (bit 4 of Register C) is set. If the Update ended Interrupt Enable (bit
4 of Register B) is set then an Interrupt Request is generated and the IRQF is set.
There are three methods that can be employed to accurately access time, date and calendar data from the real time
clock module. The first uses the update-ended interrupt. If this interrupt is enabled, an interrupt occurs after every
update cycle. Immediately following this interrupt, the processor has 998 ms in which to read time and date
information before the next update cycle. If the processor reads the time and date within this interval, no possibility
exists for reading inconsistent times and calendar data. As with all interrupts, the IRQF bit in Register C should be
cleared before leaving the interrupt service routine.
Using the second method for reading time and date, the processor polls the Update-In-Progress (UIP) bit in Register
A to determine if the update cycle is in progress. The UIP bit will pulse once each second. After the UIP bit goes to one,
the update transfer occurs 244
s later. If the UIP bit is 0, the processor has at least 244 s before the time/date data
will be updated. Therefore the system should insure that interrupts and DMA activity do not preclude reading the time
and date information within 244
s.
The third method uses the periodic interrupt to determine if an update cycle is in progress. The UIP bit in Register A is
pulsed high half way between two PF bit pulses in Register C. The processor should read time and date information
within the time interval of (Tpi/2)+TBUC
Periodic Interrupt And Update Ended Interrupt Relationship
Notes:
t pi = time interval for periodic interrupt according to Table 3
t UC = update cycle time = 1984
s
t BUC = delay before update cycle = 244
s