A continuous read returns the expected first two bytes, but the next two do not match their register names. First check the bank selected by the SPI command. On the RX4111CE, the address wraps from Fh to 0h without selecting the next bank.
Epson's RX4111CE is a real-time clock with a built-in 32.768 kHz crystal. ETM62E-04 section 14.10 specifies that the mode field selects read or write and the register bank. The four-bit address increments cyclically during continuous access. Receiving the intended number of bytes while the chip is selected does not prove that the read continued into the next bank. Drivers and diagnostic tools must construct transactions by bank.
Decode the mode and address separately
The SPI transaction begins with four mode bits and four start-address bits. Data is transferred in eight-bit units, most significant bit first. The mode selects direction as well as the bank. For example, mode 9h reads Bank1 and mode Ah reads Bank2. Do not combine the bank and address into a flat software index and assume both advance during a continuous read. Mode and address share the first byte, but the controller does not send another mode field automatically as it clocks the data.
In one continuous access, the address after Fh is 0h of the same bank. That is normal cycling, not a bus error. The host can receive every data byte and still map the values to the wrong registers. A driver can even print labels from its expected sequence, which hides the discrepancy in a summary log. Retain the actual mode, start address and chip-select boundaries, not just the register names printed by software.
Chip select also has an electrical meaning. The module uses CE high during access. Do not carry over a common active-low select setting from a different device. Check the voltage and clock activity at the module pins rather than relying on the controller's parameter names. Before diagnosing a boundary issue, verify that the part was actually selected. A transaction that never reached the device cannot be explained by address wrapping.
Plan reads near the bank boundary
For each register, record bank, within-bank address, access permissions and any special behavior. A diagnostic tool can split a cross-bank request into separate transactions instead of increasing the continuous-read length. To read a different bank, end the current transaction and start one with the next bank's mode and target address. Do not sweep the entire space merely to test the address logic, especially where reads are not permitted or addresses have special purposes.
When reading the final registers of Bank1, decide whether the operation actually needs to continue into the start of the same bank. If not, limit its length. If deliberately verifying wraparound, use a controlled test unit and check the relevant addresses first. Keeping banks in separate transactions during normal troubleshooting also makes it easier to see a wrong mode, wrong address or controller-initiated chip-select change in a logic trace.
Many controller APIs have a setting for releasing select at the end of a request. One long buffer submission does not guarantee a single uninterrupted select interval at the device. Segmentation, controller defaults or select configuration can change CE along the way. Capture CE, CLK, DI and DO together. Identify mode and address first, then count valid data bytes. Do not mistake the data-out level during the command for the first register value.
Worked example: four bytes can have different meanings and timing
For a controlled address example, read four consecutive bytes from Bank1 Eh. The logical addresses are Bank1 Eh, Fh, 0h and 1h. The last two are not Bank2 0h and 1h. If the requirement is two bytes from each bank, use two transactions: mode 9h with Eh for the first two, then mode Ah with 0h for the next two. Actual use depends on what those addresses do and what operations are permitted. The example is not an instruction to send unknown diagnostic commands.
Suppose a validated bench setup clocks at 1 MHz. Count only clock pulses, not select gaps or software waits. A single four-byte read has a one-byte header and four data bytes: 40 clocks, or about 40 μs. Two separate reads each have a one-byte header and two data bytes, for 48 clocks total, or about 48 μs. The extra 8 μs represents the additional header at this example rate. It excludes any interval between the transactions. Do not save that time by treating different banks as contiguous memory.
Avoid trying a long cross-bank write to diagnose the problem. Epson also specifies complete eight-bit units for writing. A byte interrupted by early CE release cannot be treated as a normal write. Start driver self-tests with a simulated peripheral or permitted read-only transactions. Compare planned accesses with the real frames, then verify only the write addresses the project allows. If behavior is unexpected, preserve captures rather than repeatedly altering a production unit and destroying evidence of its original state.
A maintenance record can show predicted and decoded addresses side by side. For older firmware that fails only near the last address, reproduce the real transaction first and check for assumptions about flat addressing. For a replacement, verify bank selection, write length and select behavior as software compatibility items. A matching crystal frequency and SPI interface do not preserve a driver's address-boundary assumptions.
Deliver both the access plan and original capture. The plan says what should be read; the trace shows what was transmitted. If they disagree, correct the driver submission or address generation before deciding the device is faulty. Verify reads within a bank, at the boundary, and across two explicitly separated banks on the same sample. Retain both passing and failing conditions.
If firmware allows a bulk read to be canceled partway through, send an explicit bank selection on the next transaction instead of reusing a software-cached offset. Bus recovery, module power changes and application timeouts can leave host and device with different views of transaction progress. Record actual versus expected length and never fill an incomplete result with the tail of the previous buffer. Also identify whether diagnostic register labels came from the actual trace or were generated from the original request. If they disagree, retain the raw data for reproduction.
Continuous-access checklist
| Item | What to check | Evidence to retain |
|---|---|---|
| Header | Bank, direction and start address selected by the command | Raw command byte |
| Chip select | Actual CE interval and clock sequence | Bus capture including CE |
| Bank transition | Wrap stays in the bank; a new bank uses a new mode | Split request plan and captured frames |
| Release | Access permissions, length and special addresses | Driver revision and test-board record |
Common questions
If all four bytes arrived, do we still need to inspect the mode?
Yes. The number of bytes shows that the host got data, not that the software assigned the right bank to each byte. Use the header and within-bank address to map the result.
Does splitting a read into several transactions guarantee coherent time fields?
No. This article addresses register banks and addressing. If fields must represent one instant, use the relevant snapshot procedure for that feature. Correct bank selection does not guarantee time coherence.
