=(
I have a DS1339C, the crystal is built in.
Wire.begin(); is called...then
Serial.println("Reading time");
Wire.beginTransmission(0x68);
Wire.write((byte)0x00);
Wire.endTransmission();
Wire.requestFrom(0x68,7);
Serial.println((int)Wire.read());
Serial.println((int)Wire.read());
Serial.println((int)Wire.read());
Serial.println((int)Wire.read());
Serial.println((int)Wire.read());
Serial.println((int)Wire.read());
Serial.println((int)Wire.read());
It always prints back 0,0,0,1,1,1,0, each on a different line, leading me to believe the oscillator is not working or something else is wrong. The i2c communication seems to be working fine, because I can set a time on the RTC chip and when I read it back it's no longer 0,0,0,1,1,1,0.
I THINK I have it wired up correctly. With the notch facing up, top left pin is SCL, top right is SDA.
So, assuming this chip is facing up
SCL - SDA
SQW - GND
VCC - Vbackup
NC - NC
NC - NC
NC - NC
NC - NC
NC - NC
Every NC pin is attached to ground. Vbackup is grounded, VCC has 5v out from a Arduino micro. SQW is floating, GND is grounded, SCL and SDA are hooked up appropriately.
According to the DS1339 datasheets, the chip can handle 5v fine. I am not so great at soldering so I wonder if I somehow damaged the chip, but it's odd that it is partially working.
Reviewing the datasheet again..it calls for a pull-up resistor from SQW to VCC. Just added a 1k there to VCC, but still no dice.
Arduinos, including the Micro, have pull-up resistors built in and enabled by default for i2c, right? The device calls for pullups on SDA and SCL, but the Micro should have that built in?