The controller restarts while setting the calendar, and waiting a second does not restore communication. Check whether the RTC entered STOP mode. That state pauses the calendar and disables the module's I²C timeout protection.
Epson's application manual ETM11E-05 for the RTC-8564JE/NB says that the internal bus timeout is disabled when the STOP bit in control register 00h is 1. An out-of-time transaction can normally trigger automatic interface clearing, but that protection is not available during a stopped-calendar write. Define host recovery and calendar checks in advance rather than relying only on a delayed retry.
Two different operations share the name STOP
The control register's STOP bit controls timekeeping and related functions. The I²C STOP condition marks the end of a bus transaction. One is a register value; the other is an electrical change on SDA and SCL. A bus STOP does not show that the calendar's STOP bit was cleared. Planning to clear that bit at the end of the routine does not ensure a bus transaction ends correctly. Use distinct names in the driver and logs.
The manual's interface section specifies that ordinary communication from START to STOP should finish within 1 s. If it takes 1 s or longer, the internal timeout clears the interface and puts it in standby. Do not treat the affected read or write as valid. The control-register section gives the exception when STOP is 1. Read both sections in the context of the actual operating state. Interface standby is not a module power cycle and does not certify the calendar fields after recovery.
STOP at 1 pauses calendar operation without establishing that the internal crystal itself stopped. The manual describes separate behavior depending on the output frequency selection. An external edge does not prove calendar advancement or restored timeout protection. Use register state, actual bus evidence and coherent calendar reads to diagnose the fault, not one output pin as a universal status indicator.
Identify where the write sequence stopped
Use controller logs, a scope or a logic analyzer to find the last completed step. Did the transaction setting STOP finish? How many calendar fields were written? Was a real bus STOP followed by an operation clearing the bit? If communications have recovered and the read is allowed, check control address 00h when diagnosing the fault. A later write can make the present value useful for current state but insufficient to reconstruct older state. Retain the original bus evidence rather than relying on the final line of a log.
A calendar write may have updated only some fields. Recovering the bus makes a new transaction possible; it cannot fill missing calendar fields or show that the previous cached reading is fresh. Validate the intended calendar data and permitted configuration, then set or check the full time using the approved recovery procedure. Mark it unverified until then. Do not present old cached fields as a new time reading.
Recovery depends on the host controller and shared-bus requirements. The controller timeout, device pin states and other peripherals are different concerns. If another peripheral is holding a line, waiting for this RTC cannot guarantee that the bus releases. Use the board's validated host-side recovery and confirm it does not unintentionally modify another device. Once a clean new transaction succeeds, use actual readback and the project procedure to resolve calendar state. Do not use a bulk write under unknown configuration as a recovery method.
Worked example: a host delay is not a device timeout
Suppose firmware uses a 200 ms host transaction deadline. A controlled test successfully sets STOP to 1. A later transaction stalls, the host abandons it at 200 ms, and no bus STOP is observed. A service note that says “wait another 1 s and the RTC interface is guaranteed to recover” ignores the exception. The 200 ms is a host policy; the 1 s describes the module with timeout active. Adding them does not give a guarantee during STOP mode.
Suppose an approved recovery succeeds and it takes 80 ms from the start of diagnosis to a valid new transaction, after the host's 200 ms deadline. The hypothetical logs show about 280 ms from the original start, excluding other waits. This is reconstruction of an example, not a recovery-time limit for a real board. Even a successful new transaction does not establish that the calendar is valid or advancing. Verify both separately.
Start with an approved normal calendar write and save the state transitions. Then simulate controller exit under controlled conditions and compare the traces before, during and after recovery. Determine which step the device actually received. Do not assume each failure happens at the same byte. Restore device configuration and time at the end so the debug routine does not leave the calendar stopped in a unit returned to production.
For a substitute, make protection during host interruption, calendar integrity and timekeeping after recovery three separate firmware requirements. A replacement with a bit named STOP need not have the same side effects. Obtain the new manufacturer's description and validate the same error cases. External clock output is another check, not evidence that the whole writing sequence completed.
Document whether recovery runs in the same firmware task. If a restart discards that task's progress, the next boot cannot replace actions actually taken by the RTC with a default state in host memory. On a controlled unit, compare a power interruption with a controller-only reset. Check whether backup power preserves the older configuration. If the results differ, record actual supply and failure conditions rather than presenting the easier recovery as universal.
After confirming completion, check against an independent time reference that the calendar advances. A bus acknowledgment shows only that communication works. If the application emits timestamps, define when it may treat time as valid and keep the last confirmation time. The maintenance guide can show bus state and calendar state separately. Recovery on one path does not make the other one normal automatically.
Interrupted-write checklist
| Item | What to check | Evidence to retain |
|---|---|---|
| Fault state | Control STOP at 1, a missing bus STOP, or both | 00h readback and raw bus capture |
| Timeout definition | Host deadline versus module timeout when enabled | Configuration and physical endpoints |
| Recovery | Shared-bus requirements and first clean new transaction | Controlled traces, return code and recovery result |
| Calendar validation | Complete fields, running count and no stale cache delivered | Coherent reads and state records |
Common questions
If SDA and SCL return to idle, can we deliver the calendar?
Not from that alone. Check what completed before the fault, then verify the control bit and coherent calendar readings. Electrical idle is one checkpoint.
If a clock output is present, can we skip the STOP check?
No. An output does not prove that the calendar is advancing or that the bus timeout is enabled. Verify the register and function separately for this module.
