Sorry for my stupid English… I’m playing with a RTC (DS3231 / DS3232) and don’t understand working with “Wire.write” on I2C with the control register.
The control register 0E contains several information
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
EOSC BBSQW CONV RS2 RS1 INTCN A2IE A1IE
And an all (untested) examples I found there was always unchecked the content written one byte.
Wire.beginTransmission(DS3232_I2C_ADDRESS);
Wire.write(0x0E); // move register pointer to control register
Wire.write(0); // set to 1Hz
Wire.endTransmission();
In Datasheet only BIT3 and BIT4 controls frequency. The other Bytes are for several other tings.
In my opinion it is necessary first read, then mask and rewrite. Or I’m wrong?
Also in no examples is checked the return code of Wire.EndTransmission. Why?
Perhaps somebody can tell me why I’m wrong.