After an industrial event logger changes to a quartz-based real-time clock module, several closely spaced events within one second sometimes show up with identical timestamps. Whole seconds are consistently correct and the crystal is running. The viewer, however, reads only the upper 8 bits of the subsecond divider count and omits the lowest 2 bits from the high end of another byte. Software then merges values that the underlying format can distinguish. Check the timestamp field definitions, bit order, and display precision for the exact part before adjusting oscillator frequency. The examples use laboratory records and synthetic fields only. They do not require reading events from real equipment, wiring changes, stopping the clock, or field operations.
Displaying more decimal places cannot restore valid bits discarded during acquisition. It only adds zeros. Conversely, neighboring values can still display identically if software obtains all the raw information but displays only milliseconds. Keep evidence at the generation, collection, assembly, conversion, and display stages so the source of a duplicate can be located.
Why the Two Adjacent Bytes Are Not One Ordinary Integer
Japan's Epson RX8901CE real-time clock module has a 32.768 kHz quartz timebase. One full part number for the XS A0 configuration is X1B000481000115. The fractional part of its event timestamp comes from a divider count of 1024 ticks per second. The count has 10 valid bits. Its lowest 2 bits occupy the highest 2 positions in the preceding field byte, while the upper 8 bits occupy the adjacent byte. Reading both bytes as an ordinary 16-bit integer in either byte order does not automatically recover the defined 10-bit count. The following whole-second byte encodes decimal digits, which requires different interpretation from the binary fractional fields. Do not treat the whole record as one number in a single base.
In a synthetic example, the two adjacent fractional fields are hexadecimal 80 and 80, in that order. The first byte's high 2 bits are binary 10, contributing 2 low-order ticks. The second byte is 128 and each unit there represents 4 of the finest ticks, for 512 ticks. Together they give 514. Dividing by 1024 gives 0.501953125 s. Keeping only the second byte gives 512 ticks, or 0.500000000 s, losing about 1.953 ms. This calculation illustrates the encoding. It does not measure error for an actual event.
| Synthetic fractional fields in order | Assembled tick count | Correct fractional second | If the lowest 2 bits are discarded |
|---|---|---|---|
| 00, 80 | 512 | 0.500000000 s | Same result |
| 40, 80 | 513 | 0.5009765625 s | Still shows 0.500000000 s |
| 80, 80 | 514 | 0.501953125 s | Still shows 0.500000000 s |
| C0, 80 | 515 | 0.5029296875 s | Still shows 0.500000000 s |
| C0, FF | 1023 | 0.9990234375 s | Gives 1020 divided by 1024 |
These hexadecimal values are synthetic records for comparison. They do not define device settings. For a bit-level review, extract the documented bits from the two fields, apply their weights, sum them, and then convert to seconds or milliseconds. If an interface already returns the 10-bit count, use it directly. Name fields by what they contain and their units. Keeping raw bytes, ticks within a second, and converted seconds separate prevents a later report from reading an assembled count as raw data.
Verify Inputs That Distinguish the Lowest Two Bits
The clearest test uses synthetic values with identical upper 8 bits and varied lower 2 bits. Replay all 4 combinations and check that internal order is distinguishable. Then test the transition to the next whole second to verify that the final tick and the first tick of the next second do not become the same value. This ordering test assumes different raw values from the same valid timebase. Two events can really occur on the same tick. Preserve an event sequence or independent identifier rather than creating precision the hardware did not record.
Some products round displayed fractions to a millisecond or a hundredth of a second. Fix the rounding sequence and specify whether it applies to display or archival data. If a displayed value near the boundary rounds up, carry consistently into the whole seconds, minutes, and date as needed. For internal elapsed-time calculations, use the stored values before rounding each time independently. During acceptance, save the raw fields and compare the internal count with the display for the same input. Identical displays with distinct counts do not establish a read failure. A count that advances only in groups of 4 ticks warrants a review of collection and bit assembly.
Also prepare a deliberately incorrect synthetic sequence to check whether the parser can detect the two fractional bytes being swapped. When fields contain reserved bits, use only the officially defined data bits. Handle unexpected reserved-bit states under the project rules or review them separately. They cannot be used as extra precision. A fixture should retain all 4 low-bit combinations and at least one nonzero sample that is not aligned to a multiple of 4 ticks, so a sample aligned to a quarter second does not conceal the problem. Whole-second and half-second tests alone can miss the omission.
Use separate test vectors for whole seconds. A synthetic byte of hexadecimal 39 means 39 seconds under the specified decimal-digit encoding. Treating it as an ordinary binary integer gives 57. Exercise the 4 low-bit combinations within one whole second, then change the whole-second field and clear the fraction. The first test checks whether the separated valid bits are all present. The second checks whether software interprets the whole-second field according to its own format. If only converted millisecond strings are available, mark this comparison as unavailable. Inferred low bits cannot be recorded as raw measured values.
Tie the Module Configuration to the Timestamp Software Version
Procurement should confirm the full RX8901CE configuration, bus, and application requirements. Other RTCs, including variants with different interfaces in the same series, can lay out fields differently. Check register definitions, event capture capability, and board-level electrical conditions for each candidate. Fixture acceptance should record the part number, actual operating mode, approved time scale, representative samples, and expected decode results. If a module revision changes and only the BOM is updated, a prototype can still produce readable timestamps while silently losing resolution.
Keep format errors separate from timekeeping error. The increment of the 10-bit count is about 0.977 ms. This is the encoding granularity. It does not guarantee absolute timing accuracy or event detection latency. Evaluating oscillator accuracy requires an independent time reference, a test temperature range, and a duration. Trigger-to-record delay requires the operating mode, trigger path, and measurement report. Correct bit assembly cannot qualify those measurements, and an accurate oscillator does not prove the software assembled the bits correctly.
Frequently Asked Questions
Can we ignore the lowest two bits if whole seconds are stable? If the product requires only a whole-second display, fractions can be deliberately omitted under a documented data contract. If acceptance promises millisecond-level decoding or distinguishing events within the same second, retain the raw bits.
Do identical displayed fractions prove that bits were discarded? The events may share a real hardware tick, or the display may round them to the same text. Compare the raw bytes and internal counts against the display rules before making a rework decision.
