Not always. For the Epson RX8901CE BUF1 in Direct mode, a full buffer that has actually overwritten entries holds the newest entry at the indicated page. Its oldest entry is the next page around the ten-page ring, not necessarily page 1. If the newest is page 3, the oldest is page 4, and oldest-first output runs from 4 to 10 and wraps from 1 to 3. Epson's example reads physical pages and reconstructs order. The application must also account for read/write conflict and the interval during which capture is paused.
Take a state snapshot instead of looking for the highest page
Confirm Direct timestamp mode, not FIFO or general SRAM access. Epson allocates ten BUF1 records in Direct mode. Snapshot BUF1_STAT.PTR and FULLF together with BUF_OVWF.BUF1OVWF. PTR identifies the newest page; FULLF identifies whether there is free space; the overwrite flag distinguishes the example in which the page order has rotated. A PTR of 3 alone does not distinguish three entries from ten, or establish that a report should start at page 1.
Epson's procedure pauses capture to the buffer, reads its status, enables read access and then takes records page by page. Reading one flag, servicing another task and returning for the next flag may not describe one state if the source is still changing. Save the snapshot, page-level results and reordered export separately. That makes it possible to trace why a record appears in a given position.
Physical access order is not event order
| Observed BUF1 state | Relevant pages | Oldest-first interpretation |
|---|---|---|
| Empty | No current records | No entries to export |
| Not full, PTR=3 | Pages 1, 2 and 3 | 1 → 2 → 3 |
| Full, no overwrite | Pages 1 through 10 | 1 → 2 … → 10 |
| Full and overwritten, PTR=3 | Pages 1 through 10 | 4 … 10 → 1 … 3 |
For the overwritten case with a stable snapshot, the oldest page is one plus the newest page modulo the capacity. Thus page 10 wraps to page 1. For a partially filled buffer, Epson reads only as far as the newest page. For a full buffer, it reads all ten in physical order and reconstructs their logical order. A program may also walk backwards from the newest to older entries. Reverse that sequence if the application promises oldest-first output.
Keep the physical page number in diagnostic records. A bus trace in the order 1, 2, 3 and 4 and a report starting at page 4 can both be correct. Conversely, a report sorted by address can introduce an apparent jump backwards even though the RTC never set its calendar backwards. Use system synchronization records to investigate actual clock adjustments rather than attributing every date anomaly to the ring.
Why does Epson pause capture before reading?
With Direct and Overwrite active, a capture may write the same page the host is about to read. If page 3 is newest, the next capture can claim the current oldest page, page 4, just as the host reads it. Epson pauses capture to BUF1 before reading and resumes it afterwards. Check which sources can target that buffer rather than assuming there can be no other trigger. Events disabled during that interval are not promised a record.
This is not a command to stop the RTC clock. It controls producers for the target buffer; removing power, stopping the host or pausing the calendar is not equivalent. Give one task ownership of the snapshot and retrieval interval, then restore capture after the data are safely collected. If the application cannot tolerate events going unrecorded during a pause, expose the gap or reconsider the mode and independently validate the alternative. Reading ten entries is not enough to establish coverage.
Test a real wrap with identifiable events
Generate identifiable events with the mode and initial state controlled. Check partial fill, then exactly full without overwrite, then add enough valid events to wrap and advance PTR to page 3. Capture their actual order with a source sequence or independent monitor rather than inferring it from the export. Retain the state snapshot at read time, event identifiers by physical page, and the final chronological order. Both full cases can return ten entries; known identifiers reveal a reversal.
Test the concurrency boundary separately. Log where capture pauses and resumes, and mark eligible events generated during that interval on an external timeline. Missing records can then be distinguished from events that never happened. If a read is interrupted, keep the snapshot and note whether capture stayed frozen. Do not splice pages from different capture states into one complete export, or reuse the previous pointer after capture restarted without checking it again.
Finally test exact page boundaries. With newest page 10, the successor is page 1; with newest page 1, oldest is page 2. This exposes off-by-one arithmetic. Compare with the full but never overwritten case, so the application does not declare overwrite purely because it saw the last page or omit the first valid record. This check belongs in the event-ordering test and need not rely on incomplete field logs.
For example, successfully capture thirteen identified events from empty with no reads, flag clears or competing triggers. Pages 1–3 should then hold events eleven through thirteen, and pages 4–10 hold events four through ten. The export begins with event four and ends with thirteen. Repeat with just ten events from empty. The length is still ten, but the export starts with event one. This is a test with known input, not a way to reconstruct the total inflow later. If flags conflict, a page is out of range or capture appears to have continued, report an inconsistent snapshot and retain raw data rather than guessing a continuous order. Flag order errors separately from missing capture freeze: the first can be checked by replaying the ordering logic, while the second requires a fresh consistent snapshot.
In regression tests keep a never-overwritten control and a wrapped case rather than comparing only their export lengths.
Common questions
Is the record at page 10 always newer than page 1?
Only in particular states, such as before wrap. Once an overwrite has rotated the full ring, PTR and the overwrite flag establish the relative order. Export state along with the pages so the comparison can be explained later.
Can I sort the ten entries by date instead?
Not as a general replacement. Device time can be adjusted or multiple records can share a timestamp at the available resolution. Preserve capture order from the ring first, then apply product-specific date confidence and presentation rules.
