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

The RV-3028-C7 counts three triggers. Why can I read only one time?

In standby, a cabinet switch feeds the EVI input of an RV-3028-C7. After waking, the host reads a count of three, yet its log contains just one time. The RTC has one timestamp register set and one event counter. They answer which instant was retained and how many events were recognized. They do not reconstruct a queue of independent records. A single mechanical action can also produce multiple qualifying edges because of contact bounce.

Keep the first event or the most recent event

Micro Crystal's application manual describes timestamp source selection, enable and overwrite control. Select and enable external events as required. With overwriting enabled through TSOW, the newest event replaces the previous timestamp. With overwriting disabled, the first event remains. Starting another first-event interval requires clearing EVF as described in the manual. Resetting timestamp data through TSR and clearing the event flag serve distinct purposes. Document which action rearms the driver. Reading the registers alone does not make the next edge the first.

Suppose three qualifying inputs arrive at 09:15:02, 09:15:04 and 09:15:05. Starting from zero, the count reads 3. First-event mode retains 09:15:02, and overwrite mode retains 09:15:05. Neither retains 09:15:04. The timestamp fields have one-second granularity and cannot assign distinct milliseconds to edges in the same second. If the investigation requires every transition, the host or an external logger has to record separate entries and meet the event rate while waking from sleep.

Zero can be the result of counter rollover

The eight-bit counter returns to 0 after 255. If a prior reading was 250 and the next is 5, a known single rollover means 11 new events. If 267 events occurred, the final reading is also 5. If the host wakes only once an hour, contact chatter or repeated presses can invalidate the assumed maximum. Define a maximum event rate and a maximum polling interval before treating the modular difference as an unambiguous count.

On the board, verify the contact wiring and power paths. If the EVI pull-up depends on a host rail that powers down, the input can change as the rail switches. The first retained edge may then represent the power transition. Check the pull-up rail, input levels, edge polarity and current limits. Inject a repeatable three-edge sequence, then repeat with the actual switch to observe bounce. If the design uses debouncing, specify its minimum accepted interval and verify that it still works on backup power. Test the input while the unit is armed so that debug pulses do not occupy the retained timestamp first.

Reading firmware has its own timing boundary. A new edge during the read can mean the timestamp and count refer to different instants. If the application permits, prevent input changes until the read is complete. Otherwise, read the count before and after, apply a defined retry rule if it changes, and record the concurrent event. That method assumes the count cannot make a full revolution between those reads. Timestamp the read, acknowledgement, and rearm in the host log. Inject an event between adjacent operations to establish which layer owns it.

Decide which layer owns clock corrections. If the host adjusts the calendar before reading a retained timestamp, its log can mix old event times with corrected time. Set the RTC one minute away from the host during a test, trigger an event, then adjust it. Verify that the log preserves the original time source and correction context. Check full calendar fields for triggers across midnight or month boundaries and keep the host read time.

Run a sequence of edges in separate seconds to check the retained time and count. Run another sequence with an edge arriving as a read ends to look for a gap between acknowledgement, clearing and rearming. Preserve the power state, input polarity, overwrite setting, and read procedure. If every opening needs a timestamp, treat the RTC as a one-record hardware capture and qualify host log completeness separately.

References

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.