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

Why Do Fractional Seconds Reset After Writing the Same Second? Check the 32.768 kHz Epson RX8901CE Write Address

The Epson RX8901CE and RX4901CE have a main and mirrored address for second data, but the writes have different side effects. Writing SEC (0x00) clears the 1/1024-second counter. Writing SEC_MIR (0x12) does not clear it as a consequence of that write. If the integer seconds agree but an event log jumps by less than a second, check the actual address before blaming crystal drift.

The same seconds field does not imply the same write operation

SUBSEC_L (0x10) and SUBSEC_H (0x11) hold the fractional count. The low two bits occupy bits 7 and 6 of the low address; the high address holds the upper eight bits. The following mirror allows consecutive access to fractional and calendar data as described by Epson. It represents the same seconds field without necessarily sharing write side effects. In existing firmware, record the read range, write address and setting goal separately rather than relying on a variable called “seconds.”

If the project needs a realignment that deliberately returns the fraction to zero, the SEC behavior may be appropriate. If it must change only the integer field without clearing the fraction as a side effect, SEC is not a harmless shortcut. Check the write sequence for STOP changes, explicit fractional writes and any complete setting procedure. A mirror write does not clear the fraction by itself, but changing the integer second can still create a time step.

Do not change one constant in a service patch and assume the job is done. Check whether a library subsequently runs a full setting sequence, whether bulk initialization starts at the regular seconds address, and whether another call explicitly writes the fraction. Concurrent setting tasks can follow a correct mirror access with a clearing operation. Use the bus capture to establish which bytes were actually written before drawing conclusions from source intent.

Worked example: the fractional field can differ by 625 ms

Suppose an engineering trial starts away from a second boundary with a fractional count of 640. At 1024 counts per second, that represents 0.625 s, or 625 ms. Its high eight bits are 0xA0 and its low two bits are zero. For illustration, two trials both start at integer second 23 and write 24. An SEC write clears the fraction; an SEC_MIR write does not imply a clearing action. The fraction continues under the applicable device behavior.

Ignoring access latency at a common ideal comparison point, the integer second 24 can therefore be accompanied by zero or roughly 625 ms. The difference comes from setting semantics, not 625 ms of oscillator drift during a short transaction. Actual counter samples taken after ACK or chip select can have advanced again. Do not require every subsequent read to show exactly zero or still show exactly 640. Record the reference instant, write end and next read time.

Also test the decode using an example with nonzero low bits. At a count of 643, the high byte is still 0xA0 and the low two bits are binary 11. Placed in bits 7 and 6 of the low register, they give 0xC0 with the other bits ignored. Shift the high value left by two and combine it with the extracted bits to recover 643. Concatenating two full bytes into 0xA0C0 gives a different number. This checks decoding separately from a genuine counter reset.

Retest the address, snapshot and actual time

Use an approved engineering board with stable power. Run an SEC write and an SEC_MIR write against the same target integer second and record the fractional value before each. Prevent a background synchronization task from changing the comparison. Read the required calendar and fractional registers continuously as the manual specifies rather than assembling a time from unrelated snapshots. Test near a second transition separately; do not retain only ambiguous traces.

Use the timing reference appropriate to each interface. RX8901CE uses I²C and RX4901CE uses SPI. Epson defines when the calendar snapshot loads in each case. Use the applicable bus edge, not the instant an application prints a log line. If the objective is agreement with an external time source, capture that reference as well. Correct coding and correct equipment timing answer different questions.

If a jump remains, look for concurrent adjustments, cached timestamps shared across threads, low-bit decoding errors and external-reference alignment. Do not claim one technique fixes all clock jumps or reject the crystal merely because the fraction went to zero. A trace showing real writes and readbacks is more useful than a note that the integer seconds appeared normal.

Four records to reconstruct the operation

CheckEvidence to keepNot a substitute for
Main SEC address0x00, write timing and expected resetMirror write behavior
SEC_MIR address0x12, sequence and expected fractionA guarantee of uninterrupted calendar time
Fractional snapshot0x10/0x11, raw bytes, extraction and reference timeInteger seconds alone
System retestTransaction order, external reference and firmware revisionA screen display or verbal account

Separate acceptance of the integer field from acceptance of fractional preservation or clearing. The two operations can show the same integer second while only one matches the intended use. If evidence from before the adjustment matters, preserve the raw reading before writing rather than reconstructing modified state from the result afterward.

Add a no-write comparison to distinguish an intentional reset from unstable timekeeping. With power and environment unchanged, read two coherent snapshots separated by a known interval and compare their composite time difference with the independent reference. Then see whether the step in a write trial is concentrated at that transaction. This separates ordinary drift, communication anomalies and a deterministic setting effect. If the jump appears only near a setting call, start with the address and call order. If it also occurs without writing, record those conditions rather than explaining every case by the mirror register.

Quality records should distinguish intentional clearing from loss of reliable timekeeping. When a product logs external events in absolute time, mark the records before and after a deliberate adjustment as separate continuous intervals so later sorting does not interpret a clock adjustment as an earlier physical event. In the change record, retain the reason for the selected address, the host verification method and any effect on tracking logs. Those choices provide a reference for later interface or firmware changes.

Frequently asked questions

Does writing mirrored seconds guarantee continuous time?

No. It does not reset the 1/1024-second counter as a side effect, but can still change the integer second. Check the target, other writes and actual timing to establish overall continuity.

If the first later read is not zero after writing SEC, did the reset fail?

A delayed read alone cannot establish that. The counter can advance after being reset. Use the applicable bus timing and a coherent snapshot to distinguish clearing from the counts that elapsed afterward.

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.