I am having trouble interfacing the MSP430G2553 with the Sparcfun breakout board for MCP4725. I never get the interrupt to hit:
The DAC is inittialized after POR to 1/2 of VCC. I have simplified the code to just set the DAC to 0V.
The following is the initialization sequence:
void XI2C_Init()
{
P1SEL |= BIT6 + BIT7; // Assign I2C pins to USCI_B0
P1SEL2|= BIT6 + BIT7; // Assign I2C pins to USCI_B0
// P1OUT |= BIT6 + BIT7;
// P1REN |= BIT6 + BIT7;
// P1DIR |= BIT6 + BIT7;
UCB0CTL1 |= UCSWRST;
UCB0CTL0 = UCMODE_3 + UCMST + UCSYNC; // I2C, Master, synchronous mode
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = 12; // fSCL = SMCLK/12 = ~100kHz
UCB0BR1 = 0;
UCB0I2CSA = 0xC0; // Set slave address
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
IE2 |= UCB0TXIE; // Enable TX ready interrupt
UCB0CTL1 |= UCTR + UCTXSTT; // I2C TX, start condition
UCB0TXBUF = 0x00; // Write MSB
}
The following is the interrupt vector:
#pragma vector=USCIAB0TX_VECTOR __interrupt void USCI0TX_ISR(void) { DOUT_Toggle(LED_RED); UCB0TXBUF = 0; // Transmit data byte } I gave read several times the MSP430 I2C Guide, the MCP4725, several examples, but I am still missing something. The I2C transmitter interrupt never hits??? Your help would be appreciated. Eduardo