This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P401R: I2c sending default buffer value as 0xff

Part Number: MSP432P401R

Hi,

I written the code for msp432 with cap1188 using embedded c language and CCS IDE.

first i am trying to read one register value so. communication started with write mode with slave address and received the ack also. but the register value is direct sending the 0XFF(255) value. when i am changing the  register values  default it is sending the 0xFF only. Reading is working properly with 0xff register address value. 

// Configure USCI_B0 for I2C mode
EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_SWRST; // Software reset enabled
EUSCI_B0->CTLW0 = EUSCI_B_CTLW0_SWRST | // Remain eUSCI in reset mode
EUSCI_B_CTLW0_MODE_3 | // I2C mode
EUSCI_B_CTLW0_MST | // Master mode
EUSCI_B_CTLW0_SYNC | // Sync mode
EUSCI_B_CTLW1_SWACK | //transmit mode
EUSCI_B_CTLW0_SSEL__SMCLK; // SMCLK

EUSCI_B0->BRW = 30; // baudrate = SMCLK / 30 = 100kHz
EUSCI_B0->I2CSA = 0x0028; // Slave address
EUSCI_B0->CTLW0 &= ~EUSCI_B_CTLW0_SWRST;// Release eUSCI from reset

EUSCI_B0->IE |= EUSCI_B_IE_RXIE | // Enable receive interrupt
EUSCI_B_IE_TXIE;// | // Enable Tx Mode interrupt

  • Rajineekar,  

     Have you tried running the I2C example that uses the Driverlib APIs? These are more device-independent. The rest of your code can stay the same.  Have a look at the i2c_master_w_multibyte-master_code project in Resource Explorer at dev.ti.com/tirex/# .  The driverlib examples are available under:

    Software -> SimpleLInk MSP432 SDK -> Examples -> Development Tools -> MSP-EXP432P401R -> DriverLib

    If you prefer to write code at the register level, you can refer to the msp432p401x_euscib0_i2c_10.c example at the same path shown above (substituting "Register Level" for "DriverLib" in the path above. 

    Regards,

      Bob

  • Sir,

        i am trying with pure c only. not yet tested with API calls. 

    Regards,

    Rajineekar.

**Attention** This is a public forum