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.

MSP432 I2C write to slave bug



Hi,

i'm facing an issue on the MSP432 I2C as master writing/reading to a slave register.

The register address from the slave is 16Bit and its size is 8Bit.

I go and start a multi byte transmition. First multibyte start with the MSB bit and multibyte next with LSB.

After that, i switch it to receive the 8Bit value from slave.

To make that happen i had to send the multibyte next twice somehow.

This is my code:

I am not sending a multi byte finish or stop because i want to read the register value afterwards.

So here is what i have measured with the oscilloscope:

The register adddress is 0x02 and its value read is 0x02 and thats correct.

I am not using any interrupt handler to handle the transmited interrupt or received.

Any idea why i have to send the "I2C_masterSendMultiByteNext" twice?

Thanks,

Michael

  • Hi Michael,

    Linking to your previous post: e2e.ti.com/.../1987365

    A similar command structure is followed on all MSP432 Driver Library I2C examples, with comments as such: "Send start and the first byte of the transmit buffer. We have to send two bytes to clean out whatever is in the buffer from a previous send." Therefore this is considered normal operation, not a workaround.

    Regards,
    Ryan
  • Hi Ryan,

    i was wandering because this configuration works:

    MAP_I2C_masterSendMultiByteStart(EUSCI_B3_BASE,(uint8_t)((pointer&0xFF00)>>8));

    while(ui8Status_3 == eUSCI_BUSY_3)
    {
    if(MAP_I2C_getInterruptStatus(EUSCI_B3_BASE, EUSCI_B_I2C_TRANSMIT_INTERRUPT0))
    {
    ui8Status_3 = eUSCI_IDLE_3;
    }
    }

    ui8Status_3 = eUSCI_BUSY_3;

    /* Send the MSB to SENSOR */
    MAP_I2C_masterSendMultiByteNext(EUSCI_B3_BASE,(uint8_t)(pointer & 0x00FF));
    MAP_I2C_masterSendMultiByteFinish(EUSCI_B3_BASE, (uint8_t)(writeByte));

    But here i send a multibyte finish after next, maybe thats way.

    Thank you,

    Michael

**Attention** This is a public forum