I have a DS3234 RTC wired up to an Uno and it all works fine using the 5V output from the Uno to the Vcc on the DS3234, using SPI natively (no library). The datasheet says typical voltage is 3.3v so I used that output from the Uno and I can set the time and read it but it never increments and the interrupt doesn't work. All the clock functions only work on Vcc=5V.
I took out the Vcc and GND from the Uno and put the battery in and it's the same. Clock won't increment and interrupt doesn't work.
If I read the time in the loop while on 3.3V the time is all 0s.
Is there something I'm missing? I don't have pullup resistors in the circuit, just wires from chip to Uno. Are the wires too long? They are standard breadboard wires about 6in long.
You have the Enable Oscillator bit cleared?
Control Register (0Eh/8Eh)
Bit 7: Enable Oscillator (EOSC). When set to logic 0,
the oscillator is started. When set to logic 1, the oscillator
is stopped when the DS3234 switches to battery
power. This bit is clear (logic 0) when power is first
applied. When the DS3234 is powered by VCC, the
oscillator is always on regardless of the status of the
EOSC bit. When EOSC is disabled, all register data is
You have the Interrupt Control bit set correctly?
Bit 2: Interrupt Control (INTCN). This bit controls the
INT/SQW signal. When the INTCN bit is set to logic 0, a
square wave is output on the INT/SQW pin. When the
INTCN bit is set to logic 1, a match between the timekeeping
registers and either of the alarm registers activates
the INT/SQW (if the alarm is also enabled). The
corresponding alarm flag is always set regardless of
the state of the INTCN bit. The INTCN bit is set to logic
1 when power is first applied.
You have a pullup resistor on the Interrupt line?
Active-Low Interrupt or Square-Wave Output. This open-drain pin requires an external pullup resistor.
You are leaving Vcc open?
Power-Fail Voltage VPF min 2.45 typ 2.575 max 2.70 V
The power control function is provided by a temperature-
compensated voltage reference and a comparator
circuit that monitors the VCC level. The device is fully
accessible and data can be written and read when VCC
is greater than VPF. However, when VCC falls below
both VPF and VBAT, the internal clock registers are
blocked from any access. If VPF is less than VBAT, the
device power is switched from VCC to VBAT when VCC
drops below VPF.
thanks for that. Reading those parts made it clearer what's needed.
5V from Uno, no battery, fine
3.3V from Uno, no battery, registers not accessible although they should be as 3.3 > 2.45Vpf. Perhaps it's not 3.3V coming out of the Uno.
3.3V from Uno, battery, fine. Clock and interrupt working and the battery is persisting the correct time.
I also made the mistake of thinking the clock could be powered by the battery alone, i.e. disconnecting Vcc but Vcc always needs to be connected to at least 3.3V.
thanks for the pointers.
The timekeeping section should run on the battery alone. That's what the battery is for. But it may not be possible to communicate unless Vcc is powered up. But that doesn't explain why it doesn't work with Vcc at 3.3V. If you have another Arduino or ESP that runs at 3.3V, it would be interesting to see if everything works with both sides at 3.3V.
I've been reading around and I think it's down to the statement that in general, pins expect to be the same voltage as Vdd. Feeding Vdd 3.3V from an Arduino Uno powers it but the pins on the Uno are 5V so the I2C doesn't work as the pins are expecting 3.3V. I'm now using the DS3234 at 3V on an ESP8266 which is 3.3V and it's working fine.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.