Other Parts Discussed in Thread: MSP430F5438, TPS65023
Hi there,
I'm trying to communicate over I2C using a '5438 as master with an LCD on the USCI B3 line. I can use P10OUT to manually toggle the SDA and SCL lines with the slave connected. Whenever I initialize the port, however, the UCBBUSY bit is always set. This is the initialization code:
P10SEL |= BIT1 | BIT2; // Assign I2C pins to USCI_B3
UCB3CTL1 |= UCSWRST; // Enable SW reset
UCB3CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB3CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB3BR0 = 160; // fSCL = SMCLK/160 = ~100kHz
UCB3BR1 = 0;
UCB3I2CSA = 0x28; // Slave Address is 050h
UCB3CTL1 &= M_CPL(UCSWRST); // Clear SW reset, resume operation
UCB3IE |= UCTXIE | UCNACKIE; // Enable TX and NACK interrupt
At this point in the code, all of the IFG's are cleared but USBBUSY is set. My o-scope show SCL low and SDA high. When I signal transmission...
UCB3CTL1 |= UCTR + UCTXSTT;
The interrupt is called. I fill the UCB3TXBUF buffer but nothing has changed on the bus.
My question is, what causes the UCBBUSY bit to be set? Could something be holding the SCL line low? There is another slave on the I2C bus...
Thanks in advance for your help,
Drogo