As the title states. I am trying to get I2C working on an MSP430F2272 and am having a little trouble getting off the ground. Starting with what is essentially reformatted example code, I am simply trying to send a message in Master mode. The micro is sending something, but the data is nowhere near the I2C standard (see screen shot). I suspect I am missing something simple. Any help would be appreciated.
Thank You!
Jason
void Initialize( void )
{
WDTCTL = WDTPW + WDTHOLD; // Stop Watchdog Timer
P3SEL |= 0x06; // Assign I2C pins to USCI_B0
UCB0CTL1 |= UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST+UCMODE_3+UCSYNC; // I2C Master, synchronous mode
UCB0CTL1 = UCSSEL_2+UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = 12; // fSCL = SMCLK/12 = ~100kHz
UCB0BR1 = 0;
} // Initialize
void SetSector( void )
{
UCB0I2CSA = 0x70; // Set slave address to Mux
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
IE2 |= UCB0TXIE; // Enable TX interrupt //Do we need this to Tx???
UCB0CTL1 |= UCTXSTT; // I2C TX, start condition //3
UCB0TXBUF = 0x01; // Write DAC control byte
UCB0CTL1 |= UCTXSTP; // I2C stop condition
IFG2 &= ~UCB0TXIFG; // Clear USCI_B0 TX int flag
UCB0CTL1 |= UCSWRST; // Enable SW reset
} //SetSector