A battery logger needs to wake at 06:30 each day while a low-power counter receives a continuous 32.768 kHz reference. If the schematic connects only INT/SQW to the host, switching that pin from square-wave to alarm mode will remove the clock it was supplying. The DS3231 has two outputs for this job. Use the dedicated clock pin for the counter and the interrupt pin for the wake input.
Give each output its own destination on the schematic
| DS3231 pin | Role in this design | What to check |
|---|---|---|
Pin 1, 32kHz | Continuous 32.768 kHz clock | Set EN32kHz in status register 0x0F. The host clock input must accept an external drive. |
Pin 3, INT/SQW | Active-low alarm interrupt | Set INTCN in control register 0x0E and enable the alarm. Use an input that can wake the host from its intended sleep mode. |
Both pins are open drain. The DS3231 drives them low and their pull-ups bring them high. For a host input normally used with a passive crystal, check whether it supports external-clock bypass mode, which pin takes the signal, its logic thresholds and how to handle the other pin. With INTCN=0, RS2/RS1 select a square wave on INT/SQW at 1 Hz, 1.024 kHz, 4.096 kHz or 8.192 kHz. Taking 32.768 kHz from pin 1 leaves pin 3 available for the alarm. ADI pin descriptions · ADI square-wave and interrupt control
Size the pull-ups for both rise time and battery load
The pull-up rail must fit both the RTC’s output limits and the host’s input limits. Suppose both can use a 3.3 V pull-up and the clock line has an estimated 50 pF of total capacitance. A 10 kΩ pull-up gives a 0.5 µs time constant. In the simple RC model, rising from zero to 70% of the rail takes about 0.60 µs. With a 100 kΩ pull-up, the same rise takes about 6.02 µs. A 32.768 kHz period is about 30.52 µs, with a 15.26 µs half-cycle at an assumed 50% duty cycle. The rise to the input threshold reduces the time the host actually sees a logic high.
The 10 kΩ resistor draws about 0.33 mA from 3.3 V while the line is ideally low and about 0.165 mA on average at 50% low time. That current comes from the pull-up rail, so check what supplies it in backup mode. The example assumes a 70% threshold, 50 pF and 50% duty cycle. Use the actual VIH, VIL, sink-current and leakage limits and wiring capacitance for the board. Check the high-level pulse width at the receiving pin and account for probe loading. The clock and interrupt lines can use different pull-ups because their timing and power requirements differ. ADI low-level output, leakage and supply conditions
Run a test with a known alarm match at 06:30:20
Use Alarm 1 when you need to specify seconds. For a daily 06:30:20 alarm in 24-hour mode, write 0x20, 0x30, 0x06 and 0x81 to 0x07 through 0x0A, respectively. The time fields are BCD. The high bit in the last byte masks day/date, and the lower bits contain a valid placeholder date. Alarm 2 has no seconds register. You could use it for a daily 06:30 alarm that matches at 06:30:00. Use the datasheet’s mask table if the schedule changes. ADI alarm registers and mask table
Set the test clock to a time before the alarm, such as 06:28:00, which gives 140 seconds to the match. Enable only A1IE, deal with any stale flags and confirm the interrupt line has risen before arming the host. At the match, read A1F and A2F to record the source, then write zero to the flag you have handled. Writing one to the other flag preserves its state. Avoid a blanket write of zero to the status register, which could also clear a second event or disable EN32kHz. Read back the status and observe the pin. If it stays low, check for another enabled alarm flag, a short or another device driving the same wake line. ADI status register and flag-clearing behavior
Test host sleep and RTC backup operation in two runs
For the first run, keep the RTC on main power and put the host in the intended sleep mode. Put one scope channel on 32kHz and the other on INT/SQW. Trigger on the interrupt’s falling edge and retain samples before and after it. Check that the clock continues as the interrupt goes low and that the host logs the expected GPIO wake source. Clear the alarm and check for a return to high, then test the next match. If only the first one wakes the host, check whether the line was released before the next match and whether the sleep mode detects the configured polarity or edge.
For the second run, reduce VCC so the RTC switches to VBAT, then repeat both observations under the product’s actual power policy. With the oscillator running and EN32kHz=1, the datasheet describes pin 1 operating from either supply. EOSC affects oscillator operation on battery. BBSQW and the relationship between VCC and the power-fail threshold VPF affect pin 3. The datasheet describes INT/SQW entering high impedance when BBSQW=0 and VCC is below VPF. If the product must wake after main power falls, test that pin 3 can pull low in the intended configuration, the wake input domain is powered and the pull-up does not back-power an unpowered host. Seeing the RTC count past the alarm time verifies backup timekeeping. Capture the pin and host wake event to verify the rest. ADI backup supply behavior and output controls
The backup test also helps isolate a failure. If the flag is set when RTC communications resume but the scope shows no low on pin 3, investigate its configuration and pull-up first. If the pin goes low and the host stays asleep, check power to the wake input domain and whether firmware armed that input. If the host wakes at the supply transition, use the captured edges to see whether it mistook the transition for an alarm.
Keep the two waveforms with the complete part number
Give purchasing and validation the complete part number, its operating temperature grade, the PCB revision, both signal names and their pull-up rails. Record power conditions, alarm settings, the shared waveform capture and the host wake reason in the acceptance record. If a quote says only “32.768 kHz,” confirm that it covers the RTC with its integrated crystal, timekeeping, alarms and interface. A standalone crystal still needs the circuitry that generates the clock, keeps time and raises the alarm. For related or alternate parts, compare how backup power and interrupts work and verify them on the board. ADI DS3231 product and ordering information
