The Epson RX-8571NB uses the same timer addresses in two states, but the meaning of a read depends on TE. Identify the state before deciding whether the result is consistent.
The RX-8571NB from Epson in Japan uses an internal 32.768 kHz crystal timebase. Its fixed-cycle timer supports a preset count. A common mistake is calling every value from the timer address pair “time remaining.” With TE clear the pair returns the preset. With TE set it returns the running count, and a read does not hold that count. A maintenance routine that clears TE before taking its snapshot is reading something different. It cannot reconstruct the preceding elapsed time from that value.
Decide which kind of value the software needs
The manual places the timer low byte at 0Bh and the high byte at 0Ch. The published preset range is 0001h through FFFFh. TE sits in extension register 0Dh. Clear TE before writing the preset or changing the timer source, as specified. Epson warns that writing the preset while the timer is enabled can give an incorrect first subsequent event. A configuration writer should not double as a status reader, and a diagnostic should not change the counter every time it observes it.
To verify that configuration was stored correctly, read the two bytes while TE is zero. After the preset is written but before the timer is enabled, check the raw bytes and combined value against the specification, and record the source selection. To inspect the live count, leave TE set and record the observation time. Label the raw result as a preset, a running snapshot or an uncertain read instead of assigning all three to one “remaining” field. That makes it possible to tell what a logged 300 meant long after the test.
A host call timestamp does not necessarily show the state in which hardware was read. If another task can reconfigure TE or the source, coordinate access to the RTC so it cannot change state between a control read and the counter inspection. Retain the control value, data bytes and bus timestamps. This is an application-side precaution, not an assertion that the chip will lock configuration for the firmware. Check whether a diagnostic write would change the very function under test.
Check running reads for consistency without stopping the timer
The manual explicitly says that accessing the running count does not hold it. It gives an example of reading twice and taking an agreeing pair. Read both bytes in the specified order and assemble one full candidate before repeating the full read. If the values differ, do not average them or accept the lower one by default. Double reads can work when the timing window and source allow them, but agreement does not prove an exact global timestamp. Record that window and avoid reload boundaries the test cannot resolve.
For a debug-only display, cap the number of retries rather than blocking the bus indefinitely. If no consistent pair is obtained, record the source, bus speed and time taken by the repeated reads, and mark the snapshot uncertain. If the question is whether the timer expired, use the event, flag or interrupt as applicable. The transition from 0001h to 0000h is associated with an event, but flag clearing and pin notification are separate observations.
Start by making sure the observation does not disturb the timer. Clearing TE can make the preset easier to read reliably, but it does not capture the running count. Reading a running value does not mean the preset has been erased. To verify both operations, separate configuration, enable, reads and cleanup in an independent test script and retain two labeled logs. Do not interrupt a production interval just to create a convenient observation window.
Worked example: 300 preset, 272 while running
Assume a 64 Hz timer source, a preset of 300 and a timer already working through a complete interval. Ignore first-tick phase and read latency for this illustration. A read of 012Ch, or 300, with TE clear only confirms the preset in that state. After enabling, assume a valid read produces 0110h, or 272. Both are reasonable in their own states. The running value corresponds to about 272 ÷ 64 = 4.25 s remaining, while 300 ÷ 64 = 4.6875 s is the nominal full interval. Substituting the preset for the running count would hide the 28 ticks, or about 0.4375 s, between them.
Now suppose the count crosses from 0100h to 00FFh during a read. A candidate that combines the old low byte 00h and the new high byte 00h can look like 0000h. This is an illustration of mixed sampling, not a manufacturer claim that every crossing produces zero. If a full reread then returns 00FFh, do not report the previous zero as an expiry. Keep both raw reads and obtain a result that meets the test rule. If expiry is the question, verify the event instead of trusting a potentially mixed value.
The same read procedure has less time with the faster 4096 Hz source. A 64 Hz tick takes about 15.625 ms; at 4096 Hz it takes about 244.14 µs. A reread method that works at the first setting is not automatically proven at the second. If a dependable window is not available under target conditions, expose a bounded status observation and event log rather than promising an exact remaining count on every call. Validate the required resolution once the source and bus architecture are known.
Keep four types of evidence
| Check | Evidence to keep | What it distinguishes |
|---|---|---|
| TE and source | Control and extension values around the read | Preset versus running snapshot |
| Preset data | Low byte, high byte and write sequence | Assembly error versus counter problem |
| Live read | Two complete reads, timestamps and bus speed | Whether there was a consistent candidate |
| Expiry | Event, flag and interrupt conditions | Actual expiry versus a lone 0000h read |
Include the exact module and manual revision in production or repair reports. A replacement with the same nominal timebase can still have different register mappings, read semantics or latching. If a failure repeats, determine whether it is due to concurrent reconfiguration, a long acquisition window or byte order before replacing parts. A latching description for another RTC does not apply to this one by default.
If the fixture displays only converted seconds, also store the raw 16-bit value, read state and frequency used for conversion. A wrong source and a live count mislabeled as a preset can otherwise show similar offsets. Start qualification with an approved preset having a nonzero high byte, then verify byte assembly and the state change in order. Use the log to separate a configuration failure from a display unit or timestamp error.
FAQ
If both reads say 300, can I report 300 remaining ticks?
First confirm both were made with TE set, the source unchanged and the running-read procedure satisfied. With TE clear, agreement only means both reads saw the same preset. Record the state and sample time beside the number so it can be interpreted later.
Can stopping the timer solve an inconsistent running read?
A stable value after stopping can be the preset, which is a different observation. Verify a live count with the running procedure. If that fails, retain the failure, read window and expiry evidence instead of using a post-stop value as a pre-stop snapshot.
