Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Digital Interfaces and Clock Division

Epson RX8010SJ Clock Read Failing? Measure the Full I²C Transaction

A real-time clock read transfers little data, yet can time out when the system is busy. Measure from the first START to the final STOP with a logic analyzer. Counting only the time spent shifting bytes misses pauses inside the transaction.

Epson's RX8010SJ real-time clock includes a 32.768 kHz crystal. Its manual requires the I²C transaction to finish within 0.95 s from START to STOP, and says communication lasting 1 s or longer triggers the internal bus-interface timeout reset. The 0.95 s limit is a design requirement; the 1 s statement describes a different behavior. An interface timeout does not mean the crystal stopped or the calendar reset. Do not treat the interval between those figures as usable margin.

Which time belongs in the transaction budget?

Sections 8 and 15 of Epson's ETM37E-08 define the endpoints as the initial START and final STOP on the wires. A typical calendar read writes the register pointer, issues a repeated START (RESTART) to change direction, then reads consecutive registers using auto-increment. The end of the pointer write does not necessarily put a STOP on the bus. Any pause between the write and read phases counts toward this combined transaction. A repeated START does not restart the budget as if the access were two independent transactions.

The elapsed time of a software call is not the same as time on the wires. Some controllers can queue a request for a long time before issuing its START. At that point the transaction has not opened. Conversely, a driver can fill data in two phases, wait for an interrupt or be preempted after START. Accounting from application start and completion logs alone mixes those delays. Identify the physical boundaries in a decoded trace, then align the software scheduling markers with that trace.

If an extended gap occurs without a STOP, identify who is holding each line and what phase the controller has reached. A static clock level alone does not prove a particular peripheral is stretching it. The controller may not yet have submitted the next part of the operation. Capture SCL, SDA and any controller phase markers on the same timeline. An application timeout code alone cannot prove that the device has reset its bus interface.

Why not add extra STOP conditions to the read?

The RX8010SJ holds clock and calendar data at the beginning of the access and updates the carry at its end, so Epson recommends a consecutive read with auto-increment. A valid result needs more than an acknowledgment for every byte. The fields need to belong to the same controlled reading. If seconds, minutes and hours are fetched in separate transactions, a carry between them can produce a timestamp that never occurred. If you split a combined read, revalidate pointer handling and calendar consistency rather than inserting STOP conditions solely to avoid a timeout.

The software does not need to set the STOP register bit to 1 for this purpose. Epson's clock-read procedure keeps that bit at 0. This is a register control, not the I²C STOP condition that ends a bus transaction. Give the two distinct names in the logs. Otherwise a developer trying to cure a bus fault may accidentally stop the clock. After communications resume, verify consecutive calendar reads rather than checking only that the device address is acknowledged.

If an aborted transaction needs a retry, first restore the bus and controller to a state validated for the project. Discard any partial buffer and retry with the full pointer selection and intended length. The actual bus-recovery method depends on the driver and board. Do not assume that the module datasheet guarantees both wires will release on their own. Do not deliver a time value to the application after an incomplete or failed read. If the application is allowed to use an old value, mark it as the last known good reading rather than a fresh sample.

Work through two timing examples

Suppose a prototype running at 100 kHz reads seven calendar bytes in one combined transaction. The write address, pointer, read address and seven data bytes make ten byte units, each including a ninth clock for acknowledgment or non-acknowledgment. Ignoring START and STOP overhead and other gaps, 90 clocks at 100 kHz take 0.90 ms. This is a starting estimate, not a maximum transaction length or a measurement. Compare the logic analyzer's elapsed START-to-STOP time with 950 ms.

If START has already occurred and the controller waits 720 ms between the two phases, assume for this example that only shifting adds further delay. The total is about 720.90 ms, leaving about 229.10 ms below 950 ms. A 960 ms pause would put the total at 960.90 ms. That exceeds the stated transaction requirement even though it is still short of the 1 s threshold described for the internal interface reset. These are illustrations, not a universal 229.10 ms budget or a reason to let a running product approach the limit.

Capture a normal trace as the baseline, then introduce representative scheduling interference in an approved test mode. Measure START to the final STOP, verify every expected field, and check that a previous buffer is not delivered as fresh data after fault injection. Record the bus rate, transaction structure, software timeout and measured duration. If the real issue is a queue backlog rather than a pause on the wires, treat it as a separate fault. Neither automatically indicates poor oscillator accuracy.

For a candidate substitute, compare the maximum transaction time, what the internal timeout actually affects, and how coherent calendar reads are defined. A single successful driver call or a matching 32.768 kHz accuracy rating does not qualify the original software under load. Repeat the same checks under the busiest known conditions when firmware, shared peripherals or the controller change. The application must define how long it can tolerate a stale reading. The device's 0.95 s bus limit is not a default for that purpose.

Some logs use the time at which a shadow register is updated as the read timestamp. For fault analysis, retain three times: observed bus START, receipt of the last byte, and acceptance of the parsed fields by software. These need not agree, but the report must say which is used to judge freshness. When testing across a minute boundary, retain two consecutive complete readings with each transaction’s own endpoints. A read that ends near the second boundary will then be less likely to make an ordinary carry look like a jump caused by a retry.

Clock-read troubleshooting checklist

ItemWhat to checkEvidence to retain
Bus boundariesInitial START to final STOP without resetting at RESTARTTrace with both endpoint timestamps
Calendar dataConsecutive auto-increment read without changing the STOP bitComplete bytes and parsed result
Timeout diagnosisQueue delay, in-transaction pause and interface stateController phase logs and wire trace
ReleaseValid reads under target load and a clean transaction following an errorDatasheet revision, measured limit and error-handling result

Common questions

Can we avoid the timeout by increasing the I²C rate from 100 kHz?

A faster rate shortens shifting and other rate-dependent operations. It normally does not remove a long firmware wait after START. Measure the contributions to the full transaction first, then decide whether to change the submission logic or the bus rate.

If the time is wrong after a failed read, has the internal crystal stopped?

That does not follow. Separate a bus-interface error, incomplete data delivered by the software, and truly invalid timekeeping data. Check the applicable validity status and consecutive readings after recovery. To assess frequency, collect separate evidence under valid measurement conditions instead of treating a failed communication as a frequency test.

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.