A completed bus write does not prove a wakeup timer reloaded. The RA4000CE countdown window applies to software requests too. Check the remaining count when the request arrived.
Why a single write involves two decisions
A logger using an Epson RA4000CE or RA8000CE real-time clock module enables the wakeup timer. Software periodically writes the reset bit to restore the preset, but on one occasion the timer still expires on its old schedule. Separate two questions: Did the interface complete the write, and did the timer adopt the request at an allowed time? Those results can differ. The module can accept a bus transaction without reloading under the configured countdown window. An absence of bus errors does not prove the timer was refreshed.
These modules have an integrated crystal. The discussion concerns the wakeup counter, not resetting the entire controller or clearing the calendar. Epson documents two running-counter reload paths: WTCTL.WTRST and an external request at EVIN2. Writing one to WTRST requests a reload; it always reads as zero, so readback does not prove the outcome. The external route has its own enable and signal conditions. Whether that route is enabled is separate from whether the countdown window applies.
The window is defined by remaining counter states
WTCTL.WTRSTWIN has two bits. The documented settings are 00 for the whole interval, 01 for counts 2 through 1, 10 for counts 16 through 1, and 11 for counts 64 through 1. These are countdown states, not milliseconds or a new delay measured from the write. The window applies to both register and external-pin resets. The preset must also be greater than the acceptance-window count. Do not speed up a test by setting the preset equal to, or below, the upper end of the requested window. Confirm countdown mode first; do not transfer the rule to count-up operation.
Near a boundary, keep units straight. With a 64 Hz source, one cycle is about 15.625 ms. The last two counter states span about 31.25 ms in an ideal timing model. That does not promise that a software callback nominally scheduled 31.25 ms ahead will reliably make the window. The counter moves on its hardware timebase, while scheduling, transfer and sampling consume margin. Reading a count of two shows its state at that sample, not that it will be unchanged when a later write arrives. Leave timing margin and check your real firmware load instead of assuming two log timestamps are aligned.
Do not confuse WTRST with writing a new preset. Here the timer is already configured and running. The reload request is not another write to the three-byte preset registers. If the request is accepted, the counter loads the preset and continues; the reload itself does not generate a wakeup-timer interrupt. At a natural countdown to zero, the timer event occurs under its configured conditions and the period reloads. To interpret a trace, distinguish an early return to the preset after a write from a natural trip through zero.
Reproduce both outcomes with a preset of ten and a two-count window
Assume a countdown preset of 10, window selection 01 and a 64 Hz clock, with the counter already running. First send a software reload well inside count 5, away from a transition. Count 5 lies outside the allowed 2-through-1 window. A completed transaction alone cannot demonstrate a reload. Then send the same request in a separate cycle at count 2 with adequate margin and the other operating conditions met. The expected result is a reload to 10. Ten nominal cycles are about 156.25 ms and two are about 31.25 ms. These calculations describe the setup, not a guaranteed latency from issuing a command; do not ignore the phase of the hardware clock.
On the bench, start with clearly in-window and out-of-window cases and record a sequence of counts before and after each trigger. Retain the host action time, a source-time reference, counter progression and interrupt status. Clear or separately tag a timer flag left from a prior run so it cannot be mistaken for a new event. A single count taken after the trial may be after the normal zero crossing. A natural reload can also produce a value near the preset. Capture enough history to place the attempted reset, the zero crossing and the resumed count in order before interpreting the jump.
For an intermittent issue, reproduce it with the same firmware under lighter and heavier task loads and compare the timing from issuance to receipt. A bench build can also switch explicitly to the full-period setting as a control to determine whether the narrow window is required to reproduce the issue. That is a diagnostic change, not a default production fix. If the project uses the window to detect premature servicing, widening it changes fault detection. Decide which failures must be recognized before modifying the production setting, then test firmware and hardware with the same configuration.
Show which event occurred in the acceptance record
| Check | Keep in one record | Not sufficient evidence |
|---|---|---|
| Mode and source | Countdown, 64 Hz or actual selected source, timer enable state | Converting using a different clock |
| Window and preset | WTRSTWIN setting, preset and valid range | A record that the host wrote a reset |
| Reset path | WTRST or EVIN2, external enable and signal conditions | Assuming external disable means software disable |
| Outcome | Counts around the write, whether zero occurred naturally, flag and timeline | WTRST reading zero or a single reading near preset |
Start with mode, count source, preset and window, then decide whether the external pin needs probing. Do not replace the crystal RTC as the first step. If counting advances at the right rate but the request misses the acceptance window, another unit of the same type should not change that programmed behavior. If an electrical or version difference is established, check the application manual and test conditions for the complete order code. Report an observable finding, such as an out-of-window request or insufficient evidence, instead of declaring a bad module because the timer appeared not to reset.
When handing the finding to firmware staff, label decimal counter values separately from hexadecimal register displays. If the test records window counts rather than milliseconds, retain the actual clock selection so others can reproduce the conversion.
Two common questions
If external resets are disabled, why could a software write still fail?
The external enable only controls the EVIN2 route; it does not block a WTRST write. But once a countdown window is in use, a software request must also arrive within the permitted states. Test the two conditions separately. In one configuration, try software commands clearly inside and outside the window before testing the external input, so wiring effects do not confuse the result.
Does a zero WTRST readback mean the command was lost?
No. Epson defines it as a write-one request whose readback is zero. Zero proves neither success nor failure. Verify that a write occurred on the bus, then see whether a request in the permitted window reloads the count, ruling out a natural zero crossing. Keep delivery, acceptance conditions and counter outcome in separate fields so a repeat test identifies which step did not occur.
