Other Parts Discussed in Thread: MSP430WARE, LP5569,
I am trying to establish I2C communication between an LP-MSP430FR2476 microcontroller and a TI LP5569 LED driver using the driver library provided in MSP430Ware. I am programming out of Code Composer Studio v10 .1.0.00010 and using MSP430Ware v3.80.10.09. Unfortunately, when I run the example code provided in MSP430Ware_3_80_13_03\driverlib\examples\MSP430FR2xx_4xx\eusci_b_i2c\eusci_b_i2c_ex3_masterTxMultiple.c, my program hangs on the first call to "EUSCI_B_I2C_masterSendMultiByteStart(EUSCI_B0_BASE, TXData++);". In that function call specifically, my program seems to halt in eusci_b_i2c_.c. Here's the function where my program gets stuck:
void EUSCI_B_I2C_masterSendMultiByteStart (uint16_t baseAddress, uint8_t txData ) { //Store current transmit interrupt enable uint16_t txieStatus = HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE; //Disable transmit interrupt enable HWREG16(baseAddress + OFS_UCBxIE) &= ~(UCTXIE); //Send start condition. HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTR + UCTXSTT; //Poll for transmit interrupt flag. <----------------- CODE GETS STUCK HERE while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ; //Send single byte data. HWREG16(baseAddress + OFS_UCBxTXBUF) = txData; //Reinstate transmit interrupt enable HWREG16(baseAddress + OFS_UCBxIE) |= txieStatus; }
The only deviations I've made for the example code is to changing the slave address (I set it to 0x40 for the LP5569), the GPIO Pins (used P1, Pins 2 and 3) and I've changed the interrupt code to send certain two bytes (a control register address followed by a new value for that register, but the program never reaches that phase anyways).
Thanks in advance!