[Solved] Pullup resistor strangeness on DS3231 RTC module

The DS3231 RTC chips have an open drain output (SQW) that produces pulses with an output frequency from 1Hz to 8 kHz, set with an internal register. There is a battery backup mode that enables this output when an external source of power is not present, so that the module can still be used for timekeeping. Of course, the data sheet instructs to use a pullup to an external power source when using the output in this mode. http://datasheets.maximintegrated.com/en/ds/DS3231.pdf

In my first lashups with a scope, I verified that the output appeared to work as advertised, but when connected to an MCU input pin with a 50K ohm internal pullup resistor enabled, no pulses were observed.

Re-investigating, connections to the battery backed module were made using only the ground and SQW pins, with a pullup resistor from SQW to +5 V supplied externally. All grounds are connected, of course.

Indeed, with a 50K pullup, the SQW output voltage is near zero at all times (observed with a scope with 10Mohm input impedance). With a 3.9K pullup, I see a square pulse from 0 V to 4.5V. For pullup values in between, the pulse becomes less positive, dropping to about 1V at 20K ohms. Two such modules behave identically.

What is going on?

Solved: the modules have a tiny 4.7 K pullup from SQW to module Vcc, which was loading down the external pullup. Edit: Remove that stupid pullup, as described here: https://edwardmallon.wordpress.com/2014 … from-ebay/

So the battery backup voltage does not go to module Vcc (doh) and so the internal 4.7K pull-up is acting as a pull-down when Vcc is unpowered and tied to ground. Have I got it right ?

If so then what use is the “battery backup mode that enables this output when an external source of power is not present, so that the module can still be used for timekeeping” ? If I had a relay to open Vcc from the RTC’s Vcc, would that work ? Or will the unpowered circuitry of the RTC pull Vcc to ground and give us the pull-down situation ? Is the only way that function is useful is to have a strong external pull-up, thus negating (somewhat) the low power advantage ?

THX for the info !

A better way to think about the problem is that I was (in effect) attempting to power the entire module through a ~50K + 4.7K resistor, which doesn’t work. The DS3231 has internal circuitry to switch between battery backup power and external power, depending on voltage levels, but there is not enough information to know if Vcc has high impedance in battery backup mode.

I’ve removed that 4.7K resistor and the DS3231 now works fine as a 1PPS clock source. It should run for a couple of years on a CR2032 cell, used as input to an ATmega328p interrupt pin (with the internal pullup on).