For the past 4 hours I've been trying to troubleshoot a I2C communication between my MSP430G2335 and a DS1307 (powered from a external 5V PSU). This is the code I'm using (it uses alanbarr I2C library):
#include <msp430g2553.h>
#include "i2c.h"
void main() {
WDTCTL = WDTPW + WDTHOLD; // Disable WDT.
BCSCTL1 = CALBC1_1MHZ; // 1MHz clock.
DCOCTL = CALDCO_1MHZ;
BCSCTL2 &= ~(DIVS_3); // SMCLK = DCO = 1MHz.
i2cSetupPins();//0x68
i2cSetupTx(0x68);
i2cTransmit(0, 1);
i2cSetupRx(0x68);
char t[100];
i2cReceive(t, 1); // Nothing. Just for testing.
}
The problem is tha