When servicing a logger built around the PT7C433833A, do not assume that whichever transition is easiest to trigger marks the start of the newly recorded second. When configured for a 1 Hz square wave, this RTC updates its clock registers on the falling edge of SQW/OUT. Three things happen separately: an external quartz crystal sets the oscillator's time base, division produces a signal at the open-drain output, and the host reads the calendar and time over the bus. Picking the wrong edge can leave the clock advancing normally while sample timestamps are out of phase with the actual register rollover. The edge relationship applies to this RTC in this output mode, not to every RTC with a square-wave pin.
Put 32.768 kHz and 1 Hz in their proper places
The time base comes from a nominal 32.768 kHz quartz crystal on X1 and X2. SQW/OUT is a separate, configurable signal, not a crystal terminal or a default one-pulse-per-second marker. The block diagram distinguishes the oscillator, divider, output selection and serial interface. The control address is 07h. Bit 4, SQWE, enables the square wave, and the two least significant bits, RS1 and RS0, select its rate. To use the output as a register-update reference, verify that the square wave is enabled, confirm code 00, and measure the actual signal at the pin.
| RS1, RS0 | Square-wave setting | Falling-edge register-update statement |
|---|---|---|
| 00 | 1 Hz | Applies when the square wave is enabled |
| 01 | 4.096 kHz | Not established by that statement |
| 10 | 8.192 kHz | Not established by that statement |
| 11 | 32.768 kHz, default | Not established by that statement |
The last row is easy to misread. The default rate and the crystal's nominal frequency have the same value, but seeing that frequency at SQW/OUT does not supply a seconds-rollover marker. Nor does it turn a crystal terminal into a clock output. When investigating a rollover from 59 to 00, capture the output, bus traffic and time data together. Record the control value actually read back from the board; the reset default is not necessarily what running firmware has configured.
Why the old second at the rising edge is not necessarily a fault
Suppose the 1 Hz waveform is clean, but legacy code treats its rising edge as the start of a new second. A capture reads 37 seconds around that edge, then 38 after the falling edge. If the reads fall into the appropriate windows, the observation is consistent with the update description. It does not establish a slow crystal, a lost serial transaction or a missed count. Start by checking whether firmware assigned the wrong meaning to the edge or treated the interrupt arrival and register read as simultaneous.
Do not assume a precisely half-second spacing between edges when translating this error into a time offset. Measure the actual separation instead of inventing a fixed correction from the nominal rate. With an open-drain output, the pull-up supplies the high level; trace capacitance, the input threshold and probing can affect the observed transition. A crossing measured at the RTC pin may also differ from the one at the host input. Treat the falling edge as an alignment reference, not an unspecified nanosecond-level timing guarantee. If the application needs absolute phase rather than correctly labeled seconds, specify and verify that system requirement separately.
Test the edge and the complete read separately
Start under normal main supply and bus conditions. Capture SQW/OUT, SCL and SDA together. With a spare channel, add a debug pin that toggles when the host enters its interrupt handler. For the first pass, verify the rate and polarity over several cycles. In the second pass, schedule complete reads clearly before and after a falling edge. Base the margin on measured transaction length and scheduling delay, not on a timing specification the edge statement does not provide. Mark the beginning, returned bytes and end of each transaction.
Next, deliberately move reads close to the edge, but use them as diagnostic evidence rather than a pass/fail criterion on their own. A transaction that crosses the boundary is not equivalent to one that ended beforehand. If the result is difficult to explain, inspect the bus decode, pin voltage and software log together. Check for queued transactions, clock stretching or delays before interpreting the read with this device's access rules. The edge statement alone does not define a per-byte I²C latch point or determine which second every crossing read must return. Production software can then avoid the boundary, reread or record the event and the read separately, according to the verified access behavior and worst-case application latency.
Include a seconds-to-minutes rollover in the test. Even when subsecond precision is unnecessary, checking seconds alone can hide higher-field errors when grouping records by minute or date. Use an idle maintenance window before changing the square-wave rate on a deployed board. A data-acquisition device or other logic may share that output, and moving from the default high-frequency setting to 1 Hz is not a passive measurement.
Prove that the host observes the corresponding edge
SQW/OUT needs an external pull-up; with the square wave off, OUT sets the static output state. A host reading high has not demonstrated that the pin generated a waveform. Likewise, a clean waveform does not prove the interrupt was handled. Check the pin, its pull-up rail, the host trigger polarity, interrupt masking and the debug marker in that order. If the board inverts the signal, the falling edge at the RTC may appear as a rising edge at the host. Match the event to the RTC transition rather than requiring the same polarity at every node.
Treat battery-backed behavior as a separate test. The output driver can operate with either the main or battery supply, yet bus access can be inhibited below the main-supply power-fail threshold. An external pull-up may also be tied to a rail that disappears on shutdown. A missing bus read does not establish stopped timekeeping, and a missing high level in backup does not, by itself, identify an oscillator fault. Record the RTC supply state, pull-up rail, selected waveform rate, observed input edge and bus accessibility separately. When bus access is unavailable, compare good reads from before shutdown and after recovery rather than interpreting bus silence as a stopped clock.
FAQ
Can firmware keep the default output and count pulses to derive one second?
It can divide the output for another task, but its chosen starting phase is not inherently the RTC's calendar rollover. The documented relationship concerns the falling edge when the output is set to 1 Hz. If the high-frequency output cannot be changed, treat the divider and calendar as separate references and verify how they align on the actual system.
If a read looks one count late, should I replace the crystal first?
No. Establish the edge at the RTC pin, including any inversion or shaping on its way to the host. Check the square-wave enable, rate, transaction window and scheduling. If accumulated time error over multiple seconds is outside the design limit, investigate the time base, crystal and board separately. Timestamp phase and frequency error can coexist, but fixing either does not demonstrate that the other has disappeared.
