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 Slave Addressing Questions

Part Number: MSP432P401R

Setting up an MSP432 LaunchPad to transmit via I2C to a custom SBC that also has an MSP432P401R. Currently same MCU type on both ends, each with several I2C ports.

What is the default I2C address for both the Master transmit MCU's I2C port, and the Slave receive MCU's I2C port? 

Can you set any valid 7 bit, or 10 bit address in UCBxI2CSA for that specific I2C ports slave address?

The 432 has four possible Own Address Registers: UCBxI2COA0, UCBxI2COA1, UCBxI2COA2, and UCBxI2COA3. Do these correspond to the Own Address for UCB0, UCB1, UCB2, and UCB3 respectively?

  • By default, neither Master nor Slave has an Own Address, since UCOAEN=0 for all OA registers. I.e. a slave will respond to any address, and a Master doesn't pay any attention anyway.

    You can put any address (that fits) in I2CSA. 0x00-0x07 and 0x7x are not recommended since they are General Call and Reserved respectively. [Ref UM10204 Tab le 3]

    Each UCBn can respond to 4 different addresses. These are indicated by different IFG bits in UCBnIFG.

  • By default, neither Master nor Slave has an Own Address, since UCOAEN=0 for all OA registers. I.e. a slave will not respond to any address, and a Master doesn't pay any attention anyway.

    You can put any address (that fits) in I2CSA. 0x00-0x07 and 0x7x are not recommended since they are General Call and Reserved respectively. [Ref UM10204 Tab le 3]

    Each UCBn can respond to 4 different addresses. These are indicated by different IFG bits in UCBnIFG.

    [Edit: Somehow lost a "not".]

  • I have some follow up questions - I'm looking at the two TI I2C example programs:

    msp432p401x_euscib0_i2c_10
    line 109 I2CSA = Slave Address = 0x0048 16 bit Register, uses 9 bit Field
    msp432p401x_euscib0_i2c_11
    line 103 I2COA0 = Own Address = 0x48 9 bit Field

    These examples use 0x48 for both the slave and own address - this could have been any value that fits in a 9 bit space, and doesn't use any of the reserved addresses - correct? They don't have to have the same value either?

    Are interrupts better than polling for I2C?

    If I want a similar example, but one that uses polling, would I: delete the interrupt statements, replace tests with polling vars, move the ISR into an endless loop at the bottom of the program?

  • I think those two examples are intended to be used together, and if you do that the two addresses you mentioned have to be the same. I don't think address 0x48 has any particular significance. 

    Both programs use 7-bit addressing.

    I personally find interrupts for I2C simpler than polling -- the IFGs provide a convenient state machine. This is particularly true for a slave. Also, with MCLK=3MHz and I2C speed 100kHz you have about 300 CPU clocks per byte, which is a lot of spinning.

    I don't think TI provides any register-level examples for I2C polling mode. If you're going to do this, be sure to follow the state charts in TRM (SLAU356I) Figs 26-9 through 26-13.

  • Thanks for your reply, yes these two examples are meant to be used together