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

Reading an Epson RX8901CE crystal RTC timestamp: Why seconds and minutes alone are not enough

FIFO removes a complete record at a time. Even if the application displays only minutes and seconds, read all ten bytes continuously before choosing which fields to use.

Epson’s RX8901CE is a real-time clock module with a quartz timebase. Its timestamp first-in, first-out (FIFO) procedure calls for one continuous ten-byte read from 0x60 to 0x69 and prohibits a partial read. The manual calls for a 1 ms wait after a record before taking the next, and one record read decrements the FIFO count. Reading two addresses with a generic register utility does not establish that a record was removed correctly. A display that once looked normal is not evidence of a compliant driver.

1. The display may use two fields; the driver still needs one complete record

An operator display may need only minutes and seconds. The device manual, not the display format, defines the unit of access. The host can extract and display those fields after receiving all ten bytes; it should not shorten the device read to two. Keeping those layers distinct also preserves a way to trace a displayed record to its original transfer if the event source or raw data is needed later.

FIFO reads start with the oldest entry. Epson’s example does not need RDPAGE to be set for each FIFO record. Do not transfer this behavior to direct mode, which uses different page selection, read enable and buffer organization. This article covers reading one FIFO record, not clearing flags or selecting pages in other modes. Confirm the mode actually programmed on the board before interpreting the data.

A continuous ten-byte read does not rule out an address-selection operation to start the read at the right location. It means that once the record is being read, the data is taken in the required continuous operation. A library that starts a separate transaction for each register does not implement that operation by reading ten individual registers. Inspect the actual frames at the module rather than trusting call arguments alone.

2. Data arrival and pointer update are separate

The count and flags can still be updating after the data is read. The manual allows up to 1 ms for the FIFO state update and calls for a 1 ms wait after reading each record. Measure it from completion of the bus read, not when the application first enqueues a request. With a bus queue the submission time and arrival of the final byte can be different.

CheckpointEvidence to retainCommon error
Buffer modeActual configuration and manual revisionApplying direct-mode paging to FIFO
Individual readTen continuous bytes from 0x60 through 0x69Assembling ten independent register reads
Post-read waitTime from record completion to the next readCounting the 1 ms from host enqueue
Batch drainInitial count, each result and post-read statusTreating arrivals as a failed decrement

First obtain the available count. After reading the batch as specified, check the pointer or empty status again. New triggers may have added entries during reading, so a nonzero count after the batch does not by itself show that a prior entry failed to dequeue. Compare input triggers, bus and state timing. Handle full and overwrite conditions separately for the actual mode; the wait described here does not guarantee against event loss.

3. Worked example: three short reads cannot retrieve three records

Suppose the initial count is three and no new trigger occurs. Obtaining three complete records takes three continuous ten-byte reads, or 30 record payload bytes, excluding addressing and other protocol overhead. If the first read completes at 2.00 ms on the host timebase, the next can start at 3.00 ms under this wait rule. The earliest third start is the actual end of the second read plus 1 ms. It cannot be scheduled from the first call alone.

A program that reads only two bytes for each record receives six data bytes over three reads. That is not equivalent to three complete records. Do not infer that the pointer will decrement three times as it would after valid reads. If the count unexpectedly differs, capture all three transactions and compare starts, stops, lengths and timestamps. Do not read extra entries at random just to make the status return to zero. Use the documented count and status to decide whether more reads are appropriate.

If the last byte fails on the bus, do not log the record as reliably saved. A hardware read and a successful host storage operation are different events. The application can stage a complete raw record in a buffer with a defined retention policy, or mark an uncertain result and consult status again under the approved recovery procedure. A normal-looking screen after a retry does not prove missing data was recovered.

4. Give engineering and service the same evidence

Retain the firmware version, exact module, buffer mode, trigger source, effective configuration and each actual read. If a fault only occurs during field batches, record scheduler delays, retries and host storage time. If heavy bus traffic is involved, distinguish delayed service, insufficient spacing and data lost at a higher layer. All can look like missing records and call for different changes.

Incoming or alternate-part approval should specify more than “timestamp output.” Document record length, legal read sequence, time for count updates, error recovery and required firmware behavior. Two modules that store time need not share a register read protocol. Map the exact part to prototype and production settings so a later firmware or lot change can be reviewed. Use a recognizable event sequence in a no-new-trigger test and one with allowed concurrent triggers. Keep basic protocol, concurrency and final display results separate.

Scope a passing result as carefully as a failure. One check establishes only the tested configuration. It does not release other bus rates, task orderings or power interruptions. If a shared bus library changes, repeat the full-read and wait checks rather than verifying only that the display refreshes.

Include actual continuous-read length and minimum observed post-read wait in the log. If the library reports success but the capture shows the wrong length, check the library arguments against the bus trace before attributing the issue to a production lot. Retain both the hardware trace and the application storage result; neither replaces the other.

5. Quick questions

If a capture shows ten continuous bytes, can we remove the 1 ms wait?

Do not treat one successful read as a reason to bypass the documented post-read wait. Check the end of the record and pointer-update behavior, then evaluate throughput at the application level without shortening an unqualified device interval.

Is it a problem if the application keeps only seconds and minutes?

The application can display or retain selected fields after the driver reads the complete record. Keep raw data if traceability or service requirements call for it.

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.