Binary subseconds and BCD seconds are different formats
Epson's RA8000CE timestamp table shows two sets of addresses. In the first set, the two highest bits of 0x60 are SUBSEC1 and SUBSEC0. At 0x61, the next byte is SUBSEC9 through SUBSEC2. The subsecond count uses binary weights. The adjacent bytes cannot be read as an ordinary 16-bit integer. At 0x62, whole seconds use BCD with tens and ones fields covering 0 through 59. Being adjacent in a record does not make the encodings the same.
In the second set the corresponding addresses are 0x70, 0x71 and 0x72. Identify the record before decoding. Keep each address, used bits and data type in the parser documentation. When a log seems to make an unexpected jump, inspect the raw record before blaming RTC accuracy or the crystal. A misplaced low-order bit can produce an apparent jump that never occurred.
Assemble the subsecond count using the actual bit weights
Extract only the top two bits of the first byte and move them to the low two positions. Use the second byte in the higher eight positions, equivalent to multiplying it by four. Add the contributions to obtain a count from zero to 1023, then divide by 1024 to express it in seconds. Do not use the other bits from the first byte for more precision or treat the second byte as milliseconds. Its highest bit contributes 512; its lowest contributes four.
For a hypothetical example, if 0x60 and 0x61 both contain 0x80, the first contributes two and the second contributes 128 times four, or 512. The result is 514 ticks, equal to 0.501953125 seconds. If 0x62 is 0x25, decode BCD tens as two and ones as five: 25 seconds, not the decimal equivalent of the whole hexadecimal byte, 37. This verifies the layout, not an event-timestamp accuracy promise.
Small artificial counts make useful parser tests. Vary the two low bits through one, two and three, then set the first bit contributed by the next byte and confirm it adds four. Include the maximum representable value. These cases expose a missing mask, a shift in the wrong direction or reversed field placement. They establish parser behavior, not that actual hardware returned a complete record from the intended address.
Keep four pieces of the record distinct
| Address or field | Interpretation | Do not interpret as |
|---|---|---|
| 0x60 or 0x70 | Top two bits are the low subsecond bits | The entire byte contributes |
| 0x61 or 0x71 | Subsecond bits 9 through 2 | A value in milliseconds |
| 0x62 or 0x72 | BCD seconds, tens and ones | A plain hexadecimal second count |
| Captured evidence | Raw bytes, address set and parser revision | Guaranteed event timing accuracy |
A fractional result establishes the counter granularity only. Each tick is about 0.977 ms, but that is not a maximum event-capture error. Input detection, filtering, alignment and measurement conditions need their own checks. If a report displays only milliseconds, define its display rounding and retain raw ticks rather than rounding and later trying to recover them. Keeping the whole-second field with the original tick value also helps distinguish a display carry from a decoding fault.
Mark artificial data separately from captures. A parser test intentionally selects boundary bytes. A hardware test checks that the applicable board returns a complete real record. Identify both sources so a correct demonstration is not reused as hardware qualification.
Keep raw bytes before troubleshooting formatting
Retain the record address set, raw bytes and converted values from the same read. Do not compare only screenshots of a decimal time. If the host stores milliseconds and a service later converts to microseconds, locate each rounding or conversion. This separates wrong address, misplaced bits, BCD processing and display carry instead of blaming all four on the timebase.
Run the parser against known cases at zero, the first few ticks and the maximum before the next second, using different BCD tens and ones. Then capture complete records on the target board, comparing bus data, host output and stored values. If versions used different decoding rules, keep the original bytes for compatibility review. Do not overwrite historical records. State which hardware and firmware share the verified format.
For anomalous records, record whether the data belong to the same capture, are complete and have a confirmed source address set. Do not force missing data into a formatted time before it reaches the application. Preserve the error and limit how the record is used. Supply a small recomputable example and error case at handoff so another reviewer can reach the same result without interpreting a screenshot.
For longitudinal comparisons, keep integer seconds and subsecond ticks separately in the raw event record. Convert to decimal only for display, with a defined precision. Comparing records can then use the same integer tick format. If rounding brings a fractional value to the next second, update the displayed second as well. Test display rounding independently from the bit layout.
Exercise more than error-free parser execution. Keep expected output for identical bytes across software revisions, and check buffering, ordering and repeat display. If the seconds byte contains an undefined digit, mark it invalid rather than truncating a digit or converting it to a plain integer to make it look plausible. Raw records should reveal when another record or an incorrect interpretation entered the pipeline.
Distinguish the audiences for the evidence. Manufacturing checks the relationship between raw bytes and decoded output. System verification checks integrity from the RTC through the host to the final record. Both can pass without qualifying every external event condition or timing error. If the mode, data addresses or record layout changes, revisit the parser assumptions instead of checking only whether hexadecimal values are still returned.
Frequently asked questions
Can 0x60 and 0x61 be combined by ordinary byte ordering?
No. Only the highest two bits in the first byte contribute, and they become the low count bits. The next byte supplies the higher eight bits. Extract the fields before combining them.
Do valid BCD seconds prove the fractional field and event time are correct?
No. BCD only describes the whole-second value. Verify the fractional bits, record identity and actual event timing separately.
