Hi,
I am working with the MSP430F5438 Experimenter board. I am attempting to get I2C working.
Using the user manual to adapt the I2C master files (TI_USCI_I2C_master.c,TI_USCI_I2C_master.h)
I have tried the UCB0 and UCB1 modules.
UCB0 ports are brought out onto the Header RF3 (UCB0SDA P3.1 and UCB0SCL P3.2) while
UCB1 ports are brought out onto the Header Port x.y (UCB1SDA P3.7 and UCB1SCL P5.4)
Using the following code I would expect the I2C clock start running, but all I see is the clock signal going high and staying there.
void TI_USCI_I2C_transmitinit(unsigned char slave_address,
unsigned char prescale){
/* UCB0 settings */
P3SEL |= SDA_PIN + SCL_PIN; // Assign I2C pins to USCI_B0
/* UCB1 settings*/
// P3SEL |= SDA_PIN;
// P5SEL |= SCL_PIN;
UCB0CTL1 = UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = prescale; // set prescaler
UCB0BR1 = 0;
UCB0I2CSA = slave_address; // Set slave address
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
UCB0IE = UCNACKIE | UCTXIE; // Enable TX ready and NACK interrupt
}
I have selected the SMCLK as the input clock to the I2C. Connecting a scope to P4.7 or P1.6(And setting respective PxSEL bits) I see this clock.
Any tips or advice on how to get I2C working would be greatly appreciated.
Thanks,
Jorgen
PS:I have not connected anything to the I2C bus yet, but tried connecting the SCL signal to P1.7 configuring it with a pull-up with no change in behaviour.