On the Epson RA8000CE, completing a read does not restore the original register address for the next request. The manufacturer distinguishes an explicitly addressed read from one in which the next transaction sends only the device address in the read direction. In the latter case, the module starts after the last location read. A routine retry can therefore return the next configuration value without any bus error. The issue is not crystal frequency, byte order or a missing STOP. Host software has mistaken an operation that depends on retained state for a query that always targets one location.
STOP Ends the Transfer, Not the Address History
For an explicitly addressed read, select the device in the write direction and send a register address. Issue a repeated START to change to the read direction. After the last data byte the host sends NACK instead of requesting another byte, then issues STOP. The STOP ends that transfer. It does not reset the register address or mean the next read starts at this transfer's first register.
Suppose A and B are neighboring registers. If an explicitly addressed read of A ends normally, a fresh, read-only transaction that skips the register address starts at the location after A. If the first read received A and B, the reference for the next read-only request is B, the last location read, not A, the starting register in the original report. Continuous reads have a separate rule for incrementing the low address nibble. To reproduce this problem cleanly, use registers within the middle of a group and avoid wraparound, special read semantics and calendar snapshots.
Do not carry this behavior over to the similarly named SPI model or assume it is the default for every I²C RTC. This article concerns the RA8000CE. The example labels refer to confirmed ordinary readable registers; production code needs their exact addresses and access properties.
How a Failed Request Becomes a Successful Read of the Wrong Register
A driver explicitly reads A. The controller receives a full byte, and final NACK and STOP are visible on the trace. But an application discards the result because of a queue deadline, because it fails to commit a log entry, or because the caller is canceled on the return path. If retry code sends only the device address in the read direction, the device has no way to know the application rejected that result. It follows the read that actually took place on the bus, not a success flag in the application. The retry can return B normally, after which the program labels the value as A.
Two work queues can expose the same error. One task sets up a location and expects to retrieve it later. Another task gets in between, reads its own data and releases the bus. When the first task resumes, its read-only operation can inherit the other task's location. The last user of the bus is not necessarily the last reader of this module. Limit the analysis to the same device and its actual transaction history. A process-local lock cannot control another bus controller in a multi-controller design.
| Host action | Next read location | Same-address retry? |
|---|---|---|
| Explicitly send A before reading | A, specified in this request | Yes |
| Finish A, issue STOP, then read without an address | The location after the last read | No |
| Read A and B, issue STOP, then skip the address | The location after B, not A | No |
| Resend A after another task's access | A, specified again in this request | Yes |
Yes means the address is the same, not that the data must match. A counter, event field or other autonomously updated value may change even when the right register is addressed. Similarly, matching data at two adjacent registers does not prove a read-only request returned the same address. Keep address correctness separate from normal change in register contents.
Prove the Retry Target on the Bus
On a development board, select two documented neighbors whose reads have no side effects. Do not touch undefined bits to create recognizable values, and avoid status fields whose reads alter behavior. Get an explicitly addressed baseline from each and select a condition in which their values differ. Explicitly read A again, complete NACK and STOP, then issue a separate read-direction request with no register address. Under the documented behavior, this returns the location after A. Explicitly address A again to return to A. Save individual bus captures rather than relying on an application line labeled A.
Capture the device address and direction, whether a register-address byte was transmitted, repeated START and STOP boundaries, and the end of the data phase. If the analyzer uses “address” for both the device selector and the internal register address, list these separately in the test record. The first ACK identifies a responding device; it does not demonstrate that the intended internal register address was sent.
Then add a controlled intervening call from another work queue. Save all three transactions and compare the location used by the read-only request with and without the intervention. This catches a problem that one task on one bench board may never encounter. Inspect the raw sequence if decoded labels are unclear: the analyzer may not know how the application names a payload byte. Retries that succeed at the bus level but fail semantically need evidence of both.
Make the API Target a Register, Not Guess from Progress
A sound default is to have the register-read API accept and transmit an address on every call. Keep address selection and data retrieval in one traceable request; use a combined transaction if the driver interface supports one. Application retries should repeat the same explicit addressing rather than resuming from a presumed position. The address remains unambiguous whether the controller reported an error or the application discarded a successful result.
If performance calls for reusing the position, put that optimization behind a validated internal sequence. Know who owns access, where the last actual read ended, and which exceptions invalidate that context. Do not offer an unaddressed read as a convenience operation to arbitrary callers. Measure the optimization on the actual system instead of assuming a saved address byte makes a meaningful difference.
For acceptance, inject a failure after the controller receives the byte but before the result reaches the caller. Require the original register address to appear again on the retry trace. Insert a diagnostic read before retrying and check that the original request still reaches the right location. This exposes a case a cable-disconnect test will miss: the link can succeed while the application gets the wrong field. Log the requested register, address actually transmitted and data received as separate items.
Frequently Asked Questions
Can the second transaction get a response and still be wrong?
Yes. The response shows the module was addressed on this frame, not that the original register was sent again. A read-only request can legitimately return data from the retained sequence. Check whether the new frame included a register address and, if not, where the previous read actually ended.
Do I need the last register in a group or a calendar register to reproduce this?
No. Begin with adjacent ordinary readable registers away from the group boundary and calendar buffering. If both values match, use other documented locations or judge the address sequence directly. Do not change unrelated register settings just to make the test easier.
