Read AF first. Epson's Japanese RTC-8564JE/NB manual states that if an alarm flag is still pending, changing AIE from 0 to 1 immediately pulls /INT low. Re-enabling the output exposes a retained event; it does not establish that a second alarm matched at that moment. Record the alarm match, AF state, AIE write and host wake separately before replacing the clock or changing the calendar.
Masking the output still allows evidence of an alarm to remain
The alarm field configuration controls matching. Epson describes AF as a retained event flag: once set, it remains until cleared as specified. AIE controls whether that event can produce an active-low signal on /INT. Software can observe AF with AIE at 0 to detect an alarm without requesting a pin interrupt. That lets it collect status before notification, but it also means masking the pin does not cancel the comparison.
If the requirement is to stop generating alarm events, use the action defined for the model. On the RTC-8564JE/NB, the Japanese manual says ignoring all four comparison fields prevents new alarm events. That differs from setting AIE to 0. Do not assume changing the fields also clears a previously latched AF. A common driver should distinguish temporarily masking hardware wake, disabling alarm matching and acknowledging an old event, with separate checks for each.
The same /INT pin may also reflect the timer. AIE at 0 does not prove the pin will read high at all times. Timer routing, external pull-up and other open-drain drivers on the board can affect it. Identify the source before clearing flags. Clearing everything to make a scope trace go high can destroy useful evidence.
A hypothetical two-minute delay separates event time from delivery time
Suppose an alarm is set for 08:00 while AIE = 0 and the alarm fields remain active. When the alarm matches at 08:00, AF sets but the host gets no wake from that alarm output. At 08:02 software writes AIE = 1. If AF is still 1, the manual says /INT goes low immediately. A host log reporting notification at 08:02 does not establish that the alarm ran 120 s late or the crystal drifted. The 120 s in this example separates a masked event from its later notification.
A service board may not retain the instant at which the alarm matched. The flag shows that an event was detected under applicable conditions. It is not a timestamp or a count of matches while masked. If exact timing matters, retain documented status snapshots in host polling or use an external timebase to capture the configured conditions and follow-up. Do not infer a historical event time from the final AIE write.
If the product policy is to deliver unhandled events after re-enabling, clearing AF first and declaring that nothing happened is incorrect. If expired alarms should not wake the host, do not re-enable without checking AF. Archive or handle the retained state, clear only the appropriate flags as specified, and read back and verify re-enabling. A single interrupt can then have an unambiguous explanation.
Distinguish the paths with three bench runs
First configure a valid alarm with output enabled and record the alarm fields, RTC time and /INT. In the second run, disable only AIE and leave the comparison active. After the next expected event, read AF and check that this event did not pull the pin low. In the third run compare a retained AF with AF cleared after processing, then re-enable AIE and record the pin, host interrupt and log. Check that no other source is using the open-drain line during these comparisons.
Plan for the boundary in real firmware: another match can occur between handling the old status and re-enabling. Read back and recheck as the project allows, and assign ownership of unexpected AF status. Initialization delay is not equivalent to checking the state. On sleep recovery or an interrupted reset, restore time and settings as required before deciding which prior alarms to deliver.
For a substitute, review the full part number, registers and driver together. Even another RTC with AF and AIE may handle a pending event differently when the enable changes. Keep a test case for re-enabling with an old flag and repeat it before and after replacement. Timekeeping and a static idle pin do not test it.
In low-power equipment, also verify that the host consumes the event after waking. If the pin goes low but no host log appears, check the wake trigger, logic levels and recorded wake cause; the module need not have lost the event. If the host has a record but the RTC status has changed, check for another task reading or clearing it rather than asking the two systems to infer each other's behavior.
The host interrupt controller can retain its own pending state. If firmware still reports an interrupt after the RTC releases the pin, check whether the controller latched an earlier edge or another device is still holding the line low. Capture the pin and the software interrupt source separately. Clearing the host flag does not establish that the external RTC status was cleared. Document the clearing rule for each side.
Polling frequency also limits how precisely AF's set time can be known. An event detected by polling occurred between the previous clear reading and the set reading. For notification latency, separate this sampling interval from the time the host takes to resume from sleep. A detailed log timestamp is not necessarily an exact device event time.
In field logs, give each re-enable action a sequence identifier and attach the settings, pre-enable state and clearing decision. Repeated wakes can then be traced to one retained state or multiple events. Use that record in manual reproduction too; do not erase evidence before capturing it.
For another RTC, verify the new manual's handling of this case before reusing the test sequence. If backup operation differs, test main and backup power separately rather than transferring normal-operation results to wake recovery.
Alarm re-enable checklist
| Check | Evidence to retain | If it is unclear |
|---|---|---|
| Comparison | Full model, alarm fields and masks | Do not treat those as AIE |
| Retained status | AF before and after the change and its handling record | Do not infer from the pin alone |
| Re-enabling | AIE write, /INT level and wake time | Distinguish a retained event from a new match |
| Shared line | Timer and related status plus external wiring | Identify the source before clearing it |
FAQ
If AIE is 0 and there is no interrupt, can we rule out an alarm event?
No. That masks the alarm's pin output. If the comparison is active, AF can still retain the event. The project should define how to record and handle it.
If re-enabling AIE pulls /INT low immediately, did the clock run fast?
Not necessarily, especially if AF was already set. First check whether re-enabling exposed an unresolved event. Verify timekeeping separately against an independent reference.
