Hi all,
I've been attempting to get I2C working on a msp430xG4618 configuration
without any success. Examples are hard to come by for mspgcc tool chain.
Here's my init sequence:
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
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 = 40; // fSCL = SMCLK/11 ~ 100kHz
UCB0BR1 = 0;
UCA0MCTL = 0x04; // 4Mhz Modulation
UCB0I2CSA = 0x48; // Slave Address is 048h
UCB0CTL1 &= ~UCSWRST; // Clear SW reset,
resume operation
IE2 |= UCB0RXIE | UCB0TXIE; // Enable RX interrupt
UCB0CTL1 |= UCTXSTT; // I2C start condition
and the ISR:
interrupt(USCIRX_VECTOR) USCIAB0TX_ISR(void)
{
// Some test code here...
}
I'm getting no interrupts generated and putting a scope on the I2C data
line or clock line shows no activity at all.
Any help would be greatly appreciated as I've spent a lot of time on this.
Thanks,
Ciaran