In EXT_CLK test mode, SQW becomes an input and an external signal replaces the RTC's internal 64 Hz signal. If STOP first clears the prescaler and is then released, the manufacturer says the first seconds increment comes after 32 rising edges, with later increments every 64. Entering test mode alone does not establish the starting phase. “First second” here is a count of test edges, not the quartz crystal's startup time.
Why a normally square-wave pin becomes an input
The RTC ordinarily uses a 32.768 kHz crystal. TEST1 in Control/status 1 selects the documented external clock test mode, in which SQW is an input. The stimulus replaces the internal 64 Hz signal, not the crystal at its two terminals. Record normal square-wave behavior, external stimulus and recovered timekeeping separately. If the pin is routed to a circuit that could drive it, verify connection and test authorization before attaching a source to any network still configured as an output.
The datasheet specifies an SQW input pulse width of at least 300 ns and a period of at least 1000 ns. Pulse width and repeated-edge interval are different; a modest frequency does not by itself satisfy pulse width. This article uses those two conditions and the published edge count. Verify levels and load against the applicable specification and project procedure. Capture the waveform at the device rather than saving only generator settings.
| Stage | Evidence needed | Expected result |
|---|---|---|
| Enter EXT_CLK through TEST1 alone | SQW serves as a test input | Initial prescaler phase is unknown |
| Clear prescaler with STOP and release it | A defined starting point | Track first and later intervals separately |
| 32nd rising edge after that start | Valid edge reaches the pin | First seconds increment |
| Each additional 64 rising edges | One continuous observation and readback | Subsequent increments |
Mode entry does not set a synchronized starting phase
The datasheet says entering EXT_CLK is not synchronized to the internal 64 Hz clock. The write time alone does not reveal the prescaler's state. For a comparable first interval, use STOP to establish its starting state and release STOP before operation. Record entry, reset, release and first valid input in order. Pulses sent before reset or release are not part of the defined initial interval.
For example, an approved bench procedure could apply 32 complete valid cycles after STOP release and then read the seconds value while the stimulus is paused. The documented behavior is one increment; 64 more valid edges bring the next. A different run that applies a continuous signal as soon as TEST1 is set, without establishing prescaler phase, need not show the same first increment point. Do not attribute that difference to a damaged crystal. This is a bench counting example, not a production external timing mode recommendation.
Count rising edges, not every transition. An analyzer marking both rising and falling edges can make the list look twice as long. If ringing causes extra threshold crossings near the package, investigate measurement and interface conditions before treating them as distinct valid pulses.
Align calendar reads with the actual stimulus
A seconds read reports a value at a transaction, not a timestamp for each test pulse. One bench technique is to read the initial time, send pulses up to just before a predicted boundary and pause under allowed conditions, then read again. Add the boundary edge and read under the same observation rules. If the starting second is near rollover, retain both minutes and seconds and account for 59-to-00 advancement. Use a starting point away from rollover when isolating the first-edge behavior.
If instruments do not share a timebase, do not infer exact ordering from unrelated screenshots. Capture generator activity, SQW at the device and bus markers in one run where possible. Record each segment's pulse count, waveform and readback. If a run delivers unexpected extra pulses, restart from a known state rather than adjusting the count after the fact. Host wall-clock values do not replace counted edges; stimulus frequency need not match elapsed calendar seconds in this test.
Recheck normal timekeeping after leaving test mode
After the fixture or engineering test, restore approved controls and remove external stimulus before checking timekeeping on the normal crystal. If the product uses SQW elsewhere, verify its restored direction and function. Use separate acceptance records for the 32/64 external-test result and normal calendar operation. A passing external stimulus test does not eliminate the crystal-based test. It provides evidence only for the exercised route and prescaler.
Retain the test state, starting value, actual edge count, board and datasheet revisions, and restoration outcome. If ownership of test-mode exit is unclear, mark it unverified rather than assuming a later restart clears it. Keep a controlled pause separate from a power cut; loss of data after power removal is not an edge-count test. The records should allow another technician to reproduce both intervals on a separate test board.
A fixture can produce a transition when enabling its generator. If only the programmed burst count is visible but not the pin waveform, report the uncertainty instead of stating an exact valid-edge count. Verify generator triggering on an appropriate separate load before attaching to an approved board. Check pin direction and levels again on a different board revision rather than using older traces as acceptance evidence.
A comparison without STOP can illustrate the undefined starting phase. Do not treat any observed first interval in that comparison as an additional guarantee. Follow the same input requirements and record restoration afterward. The acceptance criterion belongs to a defined starting state, not a handful of coincidentally consistent unsynchronized samples. If traces differ, review the prescaler reset, read marks and observation path before guessing the crystal frequency from one interval.
FAQ
Does setting TEST1 alone guarantee an increment at the 32nd edge?
No. Mode entry is not synchronized with the existing 64 Hz phase. The stated first interval requires resetting the prescaler with STOP and then allowing it to run.
Why does the first increment take half as many edges as expected?
After a reset with STOP, the documented first interval is 32 rising edges, then 64 for each later increment. Verify that you counted valid rising transitions only. This does not imply that the normal crystal runs twice as fast.
