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

When the Epson RX8901CE crystal RTC buffer overruns, which timestamp is lost?

An overwrite flag of 1 on the Epson RX8901CE does not always mean the oldest record was overwritten. Epson defines two write policies: with overwriting enabled, new captures replace the oldest unread records; with overwriting inhibited, existing unread data stays and new captures after the buffer fills are discarded. Both situations can set the same flag. Without the active policy, a system report cannot infer which part of its event history survived.

One flag, two retention directions

The RX8901CE is a real-time clock with a built-in crystal. The question here is how its timestamp buffer handles writes when full, not crystal accuracy or bus speed. Epson specifies overwrite and overwrite-inhibit modes. In FIFO mode, the OVWEN setting in BUF1_CFG1 selects the policy. With overwriting allowed, replacement starts at the oldest unread record. When a new event is accepted for capture after the buffer fills, part of the old history can disappear and the retained records favor recent captures. With overwriting inhibited, the same condition discards the new capture while preserving unread history.

The relevant BUFnOVWF bit in BUF_OVWF is set in either of these situations when another capture is attempted after the buffer fills. “Overwrite” is the manufacturer's flag name, not unconditional evidence that an old record was replaced. Distinguish just filling the buffer from delivering a further accepted trigger while full. Bench testing requires one more confirmed timestamp trigger. Counting physical switch actions is not enough: the configured detection criteria or filter can affect what the module actually accepts.

Decide whether the incident review needs the first or latest records

If you want to preserve the onset of a fault, for example the first events after abrupt cut-outs start, consider overwrite inhibit. It preserves only what was already unread in the buffer. It does not guarantee that the oldest retained record is the beginning of the incident. Ordinary events could have filled the buffer before the fault began. Firmware therefore needs explicit capture start conditions, eligible sources and a plan for taking records out. Selecting the policy alone does not prove you preserved the first moments of the incident.

If the goal is to retain the last few changes leading into a failure, consider overwrite mode. When the host cannot read for a while, the buffer retains more recent unread records at the expense of older ones. Even then, the flag does not identify how many replacements occurred or reconstruct any missing times. Mark that segment incomplete and make the uncertainty visible to anyone interpreting the log. Treating one asserted flag as an event count creates precision the hardware did not capture.

Verify retention with a recognizable sequence

ScenarioConfirmed actionWhat to record
Fill onlyApply valid triggers to the configured capacityEstablish a full-buffer baseline
Full with overwrite enabledApply one more identifiable triggerNew record retained; oldest unread replaced
Full with overwrite inhibitedApply the same additional valid triggerUnread records retained; new record not stored
Flag aloneOVWEN and sequence evidence unavailableDo not infer whether the loss was old or new

Keep the bench test simple. Identify the active buffer mode and available capacity, then set it up using the manufacturer's instructions and approved measurement points. Arrange identifiable events, for instance inputs with distinct timings, and independently track the external events and evidence that the module accepted them. Verify accepted captures up to capacity before applying the last event. During that interval, prevent the host from consuming the test buffer and freeing slots. Once triggering ends, read the contents and flag according to the manual and retain the configuration and unmodified capture data.

Use the same event sequence, initial state and observation method for each policy, with independent runs. Changing policy on one already-full buffer is not a controlled comparison against a shared baseline. Record the first missing entry, the entries that remained and the overwrite flag separately. If the sequence disagrees with expectations, check that you selected the correct buffer, no background service was reading and the extra trigger was accepted before debugging the register or retrieval procedure. A set flag is not a reason to replace the crystal.

Tell the application which end of the history may be incomplete

Save hardware configuration with application interpretation. The application can describe policy as “keep earliest” or “keep latest,” but the driver must bind that description to the actual OVWEN readback and buffer identity. If a firmware update changes policy, record when the new policy took effect. Do not apply the new rule retrospectively to old records. If several buffers are used, do not copy one buffer's policy across them. When retention is uncertain, report that the missing end is unknown rather than guessing from defaults.

Validate what happens when the host resumes reading. If it only drains records after waking, captures can continue during the wake latency. Routine bench polling can be fast enough that no post-full event ever occurs. For a worst-case check, define an interval without read service, feed a valid sequence during it, and document both arrivals and accepted triggers independently. Then compare the recovered buffer with the sequence. Evidence that the MCU woke does not prove it preserved every earlier record; these are separate observations.

A production acceptance record can retain four original artifacts: external event times, device configuration, buffer readback and overwrite status. Distinguish “hardware indicates an event after full” from “we identified which record survived.” The latter needs a sequence or independent evidence. If a flag was cleared, the mode changed or the unit restarted without preserving state, limit conclusions to the period after a new baseline was established. When qualifying a replacement or new firmware, check the documentation and register version; do not treat the old test's defaults as universal.

If support receives only an overrun screenshot, first see whether it can recover the matching firmware version, readback of the retention policy, buffer identity and duration without reads. Without that information, do not treat the current setting after a clear or reinitialization as proof of past behavior. A later bench reproduction may substantiate a likely cause, but label it as a new test rather than historical data recovered from the device. That keeps real evidence gaps visible without inventing a timestamp the hardware never retained.

Frequently asked questions

Does overwrite inhibit prevent all data loss?

No. It protects existing unread records, but new captures can be discarded after full. Validate available capacity, acceptable trigger rate, worst-case host service interval and any independent logging needed for a complete history.

Does the overwrite flag count how many timestamps were lost?

No. The bit reports status; it is not a lost-record counter. An independently numbered sequence or external test record can help quantify a gap for a particular observed interval.

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.