Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Low-Frequency Timing and System Power

Epson RTC-4543: Why a 28-Bit Read Can Work but a Write Needs All 52 Bits

The RTC-4543 SA/SB serial protocol permits a shortened read but not a shortened write. Epson illustrates reading seconds through weekday with 28 clock pulses followed by CE low. A write needs all 52 clocks. The final bit is received on the 52nd rising edge and the data transfers to the clock counter. An early CE fall can change certain bits and year data. “Cancel halfway and retain everything” is not a protocol guarantee. Use separate read, write, and interrupted-write recovery procedures for legacy equipment.

1. Why the read can end early but the write cannot

Read mode uses WR low and CE high. The first CLK rising edge loads the calendar and time into the shift register, and subsequent edges shift out the ordered fields. If only a prefix is required, stop once those bits arrive. Epson gives 28 clocks for seconds through weekday. This does not provide arbitrary byte addressing or ensure a read is current at the instant the transaction ends. If a seconds update occurs during the read, the manual warns that the value can be one second behind that update.

Write mode uses WR high and CE high. Send from the low bit of seconds through the required last bit, rather than addressing an arbitrary field for a short write. In a normal frame the 52nd bit completes the data transfer, and additional bits are ignored. A shortened write is not guaranteed to roll back atomically. Do not assume nothing happened because CE fell before bit 52. Verify year and state, not just whether the seconds display looks normal.

Use two distinct driver entry points. One takes the last field to read and clocks only the required prefix. The other assembles a complete time value before starting a write. Validate date format, weekday, and year during preparation, before changing pins. Reject invalid input then rather than trying to abort after CE is active. Separating validation from transmission reduces interruption risk and makes migration to another controller easier to verify.

2. Seven bytes give 56 clocks, but alignment is still essential

A byte-only controller can send 7 bytes, or 56 bits, 4 more than 52. The manual allows bits after the first 52 to be ignored. The first 52 must therefore be aligned and any padding must come at the tail in the actual wire order. If firmware prepends four zero bits and then sends its data, the first 52 positions contain four padding bits and only 48 intended bits. The final four intended bits fall outside the valid window. This is a packing example, not automatic padding recognition or proof that an arbitrary SPI mode satisfies every timing condition.

Verify low-bit order, direction changes, and physical CE behavior. Some controllers toggle selection each byte. Others report a buffer transfer complete before the last clock appears at the pin. Release CE from a completion event only after verifying what that event means on the wire. Keep the send buffer, pin-level data, and actual clocks together. For an unexpected year change, check alignment and the CE end event before blaming crystal accuracy.

3. A shortened write leaves state to be verified

The Japanese manual calls for checking affected flags and year when needed; the English document also warns of possible corruption. If the host resets, communication breaks, or CE drops early after a timeout, mark the operation untrusted. Once supply and interface are stable, use the approved recovery procedure and check time, calendar, and status. If necessary, write a complete frame from a trusted time source and verify it. Resending the same fragment does not complete the previous transfer. Treat each CE transaction separately.

Valid-looking fields are not sufficient. A broken transfer may yield a plausible date in the wrong year. Use trusted configuration and time evidence before releasing the state to applications; log, alarm, or wait for synchronization as appropriate. Typical regression tests include a normal write, a minute or date boundary, a shortened write, and a following full restoration. Perform intentional faults on engineering hardware or an approved test setup, not by disrupting live equipment.

To investigate a year change, start from a valid, recognizable date and compare readback after the stated recovery interval. One shortened-write test with no observed change does not remove the manual's warning. For intermittent production faults, retain several failing and control traces and align actual clock edges with controller task events. If the controller adds leading bits or a debugger causes a read, the raw acquisition should expose that before assigning a cause.

4. Retain traces that show both CE and CLK

The manual gives a maximum CE transaction time of 0.9 seconds and an access recovery wait. Do not hold the part selected while stepping through every bit in a debugger. A prolonged hold and too few clocks are different failures. Verify both.

CheckEvidence to retainAction on mismatch
Read frameWR, CE, starting edge, and required bitsAllow a prefix read; do not reuse it as a write
Write frameFirst 52 bits, padding, actual CE and CLKUse the recovery path after an interrupted write
Duration and recoveryCE interval, inter-access wait, and test conditionsMeasure at the pin, not from software timestamps
Recovery evidenceFlags, year, multi-field readback, trusted timeKeep unverified state away from application logic

For different packages or controllers, save both a known-good full write and a valid shortened read. In an engineering setup, interrupt a write at a controlled point and verify that recovery checks state before using it. Coordinate shared access so another task cannot change direction or selection mid-write. Record reset cause and supply voltage when relevant to distinguish a bus problem from a backup-power transition.

Before releasing the driver, test degraded operation when a full write does not follow. An application may mistake a successful bus read for valid time. Keep transport success separate from time validity and retain the marker in the fault log until a valid time is restored.

5. Frequently asked questions

Is an occasional one-second lag proof the oscillator runs slow?

No. Check whether the read crossed a seconds update. Compare another valid read with an independent reference. One short transaction does not establish long-term rate.

If CE drops after 51 clocks, is the old year guaranteed?

No. A short write can affect year and related bits. Read back and verify under the recovery procedure rather than treating the write as if it never happened.

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.