Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

RX8130CE Crystal RTC Timer Will Not Pause? Check TBKE and TSTP First

If a timer keeps counting in backup after software writes its pause bit, do not start by blaming the crystal. On Epson’s RX8130CE, the effect of TSTP depends on TBKE. Pausing is also different from reloading a count.

Japan’s Epson RX8130CE is an RTC module with a built-in 32.768 kHz crystal oscillator. Its wake-up timer can count across main and backup power or only in one of those states. Mode selection and software pause are not fully independent. For maintenance timing or usage tracking, define which time is being accumulated before deciding how the system should respond to a pause request.

Decide which supply state the timer measures

The manufacturer’s mode table gives three choices. With TBKE at 0, the timer counts in normal and backup modes and TBKON is irrelevant. With TBKE at 1, TBKON at 0 counts in normal mode only and TBKON at 1 counts in backup only. These are actual RTC supply states. A charged backup battery may be connected without supplying the module. A software command to turn off the main rail does not establish the instant the module switches.

The wake-up timer counts down. Software using it as a usage timer can convert the decrease to elapsed time, but it cannot substitute elapsed calendar seconds. A 1 Hz source gives one nominal second per count; use the appropriate period when a different source is selected. If the end goal is a maintenance alert, specify whether it should happen after cumulative enabled time across power states or at a date and time. Those goals need not use the same timer path.

Name the requirement precisely, for example “accumulate backup operation only” rather than “power-failure count.” The latter can also mean how many outages occurred or the time since the last outage. Procurement should make the intended behavior part of board acceptance instead of relying on a generic long-timer feature label for a substitute.

Record the external power command, pin voltages, and evidence of the module’s actual state separately. A note that the main supply was off for a minute does not show detection delay or a brief reconnection. For a lifetime-use record, state that counts follow the RTC’s selected power state, not the supply command log.

Why a successful TSTP write may not stop the count

With TE at 1, STOP at 0, and TBKE at 0, setting TSTP stops the countdown. Clearing it resumes from the stopped value. With TBKE at 1, the manual’s stop table marks TSTP ineffective. That means the pause request is ignored. It does not mean TBKON is ignored or the counter runs under both supplies. In backup-only mode, counting remains enabled in backup and excluded in normal operation.

Clearing TE stops the countdown but loads the preset. It does not preserve the remaining count. Setting TE again will start from the preset, not the former balance. A design that needs to retain remaining time can use an approved readout method while access is available and maintain time state in software, or use a different approach that provides both gating functions. Do not assume the host can write in time while the RTC is in backup.

Nor is the global STOP bit a drop-in pause. Its effect on the countdown depends on the source frequency, and 1 Hz is one of the listed sources that stops. Review its effect on the calendar and other functions. If the maintenance timer should pause while timekeeping continues, do not substitute a control that can alter other time paths. Check the read-back flags and preset, then observe the count or event. A successful register write is not evidence that the action occurred.

Worked example: which of three 120-count timers expires?

Assume TE is 1, STOP is 0, the preset is 120, and the source is 1 Hz. Ignoring switching latency and initial clock phase, suppose the module is in normal mode for 40 seconds, backup for 50 seconds, and normal again for 30 seconds. A timer enabled in both modes ideally uses all 120 counts. Normal-only uses 70 counts and has 50 left. Backup-only uses 50 counts and has 70 left. These are independent runs, not the result of rewriting the mode while counting. The both-mode example reaches expiry at the assumed boundary; initial count timing, periodic behavior, and flags need their own verification.

Now suppose a 20-second software pause request overlaps the verified backup interval in the backup-only run, and that the test setup can deliver the TSTP write. With TBKE still at 1, do not subtract the 20 seconds: the ideal decrease remains 50, not 30. This example illustrates mode gating, not host bus availability in real backup. If the product cannot write there, prepare an accessible comparison in advance and mark which writes actually occurred and when power states changed.

Start with two comparisons. Hold one supply state while checking whether pause preserves the remaining count. In a separate run, exercise power-mode gating. Changing every variable together can leave a failing observation without identifying wrong supply state, reloaded preset, or a stale event. Log the start, valid power intervals, read method and whether the observation crossed expiry. Do not infer initial-cycle error or switchover-detection time from this whole-second illustration.

If backup time contributes to a battery-life estimate, do not equate equal time with equal drain. Record current separately and integrate it over time to estimate charge. This timer can identify an enabled duration, not battery consumption.

Preserve four records for interpreting recovery

CheckEvidence to retainError to avoid
Actual supplyVDD, VBAT, transition state and event timesA connected battery means backup is active
Timer gatingTBKE, TBKON, TSEL and presetAll elapsed calendar time was counted
Software pauseTE, STOP, TSTP and the count before and afterReading back pause proves that it paused
Expiry and outputTF, TIE, actual interrupt state and read timeNo low interrupt means the timer did not count

TF records a timer event; TIE controls whether that event is driven onto the interrupt pin. If the processor sees no low interrupt, check permission to drive the pin and then inspect the flag or count. Conversely, a retained flag may belong to a previous run. Keep the effective supply state, pause behavior and recovery evidence in separate production checks instead of signing a single “timer OK” line.

After a firmware change, reuse the same normal-and-backup sequence as a regression test. Vary one gate at a time and state which segment should count, which should not, and when the preset reloads. Relate readback to the actual expiry. Do not clear the first recovery flag before collecting it.

Frequently asked questions

Can TSTP pause and resume backup-only counting?

It is not a guaranteed control for that mode. When TBKE is 1, the manual says TSTP does not stop the countdown. An application that needs supply-based accumulation and a preserved pause state needs another validated time-state design.

Why not clear TE and then start again?

That reloads the preset; it does not resume from the old balance. It may be suitable for a new countdown. If the system needs to retain accumulated time, preserve the elapsed and remaining values separately rather than treating those operations as equivalent.

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.