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

Why the First Timer Interval Can Be Short on Epson's RX8900 Crystal RTC

If the first timer interval on an Epson RX8900 data logger varies but later intervals are steady, do not start by changing the crystal frequency correction. The manual distinguishes the delay from timer start to the first interrupt from the period between consecutive timer events. Measure the first interval from the edge on which the hardware recognizes the start write. Then check configuration and the internal count phase before blaming crystal frequency.

Find the hardware start in the manufacturer's timing diagram

This discussion covers the fixed-cycle timer in Epson's RX8900 SA/CE manual ETM45E-10, not the second or minute calendar update interrupt. The preset range is 1 to 4095, and a timer event occurs as the countdown moves from one to zero. Clear the timer enable bit TE before writing a new preset. Epson warns that writing the preset while the timer is running causes the next event to be generated incorrectly. A transition of TE from zero to one starts a new countdown from the preset value, rather than resuming the amount previously remaining.

The start point is also documented. The timing diagram places it at the corresponding SCL rising edge after transmission of the least significant bit of the start write. It is not the driver call or the final bus STOP. When a raw bus trace is available, decode the register write and identify the edge using the manufacturer's diagram. An application log entry saying “timer started” is not enough to determine when the hardware actually started. A log timestamp taken at request submission rather than completion will also include queuing, driver, and bus wait time.

The first internal source-clock interval need not be one complete period. Once adjacent timer events are in steady operation, their interval can be understood using the count and the period examples in the table. Also distinguish sensible endpoints: the internal event, the external /INT assertion, and the host successfully entering its interrupt handler. The last two can be separated by input synchronization, interrupt masks, or scheduling delays that do not come from crystal frequency. Check that TIE is enabled for hardware interrupt observation and that another interrupt source is not holding the same pin low.

Worked example: why measure two intervals with a count of 2048?

Assume a 4096 Hz source and a preset of 2048, with valid supply and operating conditions and an ideal source frequency. A full source-clock period is approximately 244.14 µs. The manual lists a fixed period of 500.00 ms for those settings, matching 2048 divided by 4096 seconds. It does not require exactly half a second from the software call to the first interrupt.

For illustration, assume the effective time from start to the first count edge is 60.00 µs, followed by 2047 complete intervals. Ignore delays through the /INT signal path. The first event is then at about 499.816 ms, with the ideal steady period still 500.00 ms. The first interval is shorter by approximately 184.14 µs. The assumed 60.00 µs illustrates one phase, not a manufacturer's delay specification. It does not mean that every sample's first event precedes the half-second point. Verify actual behavior with the chosen time base under the applicable manufacturer conditions.

Now suppose the host writes “started” to its log 2.00 ms before the actual SCL start edge. From that timestamp, the first event appears at about 501.816 ms, seemingly later than half a second. The hardware start did not move; the early software timestamp changed the conclusion. That is why an application's first interval cannot simply be subtracted from a fixed period in the specification. If consecutive hardware edges also depart persistently from expectation, check frequency, preset, source selection, and event ownership. A first-interval difference alone is not enough to diagnose an out-of-tolerance timing reference.

Treat preset changes and first-interval verification as separate tasks

On an approved bench that does not affect in-service equipment, run two tests. Begin the first with the timer stopped and any existing output identified. Write the preset and other required settings according to the manual, then enable the timer. Capture SDA, SCL, and /INT together. In the second test use a real reconfiguration case, such as changing from a longer wake period to a shorter one, preserving both setup writes and host interrupt records. Do not skip stopping the count before rewriting the preset just to shorten the test.

Record at least two intervals separately: the hardware start to the first relevant /INT falling edge, and the spacing between subsequent valid falling edges from the same source. For host latency, add a separate hardware-edge-to-software-confirmation measurement and state how the software clock is referenced. With a shared output, use register evidence or controlled settings to establish that the fixed-cycle timer caused the edge. If the pin is already low at the start, resolve that observation condition rather than counting a reset or release as a new timer event.

A correct preset readback does not prove that the first event followed the required sequence. Save the complete bus transaction and check whether stopping or writing came first. Define recovery for interrupted configuration: if a write is cut short, determine current state and restart from a controlled point rather than arming with a partially written preset. Driver regression should verify the requested value and effective ordering separately. Production reports should distinguish sporadic first-interval anomalies from persistent period errors.

If the equipment requires an action in a narrow window after every power-up, identify whether the required start is a user command, the bus write, or the first valid source-clock edge. If it must line up closely with an external event, assess hardware capture, synchronization, or another timing method separately. Passing an average period does not establish phase alignment. Keep a complete first-unit capture with zoomed views: one view showing start and bus decoding, another showing adjacent interrupts. The endpoint definitions can then be reused with a different host or driver without copying the cursor positions from an old instrument.

Include a repeat test in which start requests are not locked to the source-clock phase. A script triggered by the same cadence every time may cover only a narrow phase range even after one hundred runs. Vary permitted start times over multiple phases, then compare the first-interval distribution with steady readings. Adding decimal places to a software log cannot make up for missing trigger coverage.

Timer acceptance checklist

CheckRecord to retainAvoids
Start referenceSCL edge for the start write and manual revisionUsing the function call or STOP as the hardware start
Preset changeOrder of TE clear, preset write, and re-enableAccepting the first interval from readback alone
Output ownershipTIE state, /INT waveform, and other sourcesCounting shared-line activity as a timer event
Acceptance dataSeparate first delay, later spacing, and software responseSubstituting steady period for first delay

When specifying an RX8900 for production or spares, put the variant, interrupt function, and first-interval acceptance criteria in the controlled part document. Another part with the same crystal frequency and steady period can still have different start timing, preset write rules, and pin behavior. Check its own manufacturer's documentation rather than reusing old pass screenshots.

FAQ

Can we average repeated readings to judge a different first interval?

Repeated measurements can reveal the distribution, but do not mix first intervals into the steady-period average. Define limits and measurement endpoints separately. A mean generally does not establish that every first interval passes.

Is turning off TIE enough before writing a new preset?

No. The manufacturer requires stopping the count first by setting TE to zero. TIE controls whether a timer event drives /INT; it does not replace the stop requirement.

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.