I would like to use the 32 kHz clock signal.
The documentation states the following:
If I am correct I need the following code? Right?32K
The 32K pin is open-drain (needs a pullup resistor) and outputs a 32768 Hz clock signal. This can be enabled using the EN32kHz bit in the Status register (address 0x0F). This pin could be used as an accurate oscillator reference for some external device.
Code: Select all
void setup()
{
Wire.begin();
Serial.begin(9600);
// clear /EOSC bit
// Sometimes necessary to ensure that the clock
// keeps running on just battery power. Once set,
// it shouldn't need to be reset but it's a good
// idea to make sure.
Wire.beginTransmission(0x68); // address DS3231
Wire.send(0x0E); // select register
Wire.send(0b00011100); // write register bitmap, bit 7 is /EOSC
Wire.endTransmission();
Wire.beginTransmission(0x68); // address DS3231
Wire.send(0x0F); // select register
Wire.send(0b00001000); // write register bitmap, bit 3 is EN32kHz
Wire.endTransmission();
}
Thanks all for any help!