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.

MSPM0G1107: I2C Auto Switch to Slaver / Master

Part Number: MSPM0G1107


Tool/software:

Hi TI,

We are developing M0G1107. They need to switch I2C as Master or Slave Mode. Please help clarify below three items. Thank you.

1. For below picture, inside the yellow circle. Will these two parameters (DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER, DL_I2C_INTERRUPT_TARGET_ARBITRATION_LOST) affect Master or Slave Mode ?

2. below picture, red circle, will these initialization affect Master or Slave mode

3. In below picture, are the parameters coding to switch Master, Slave correct ?

  • 1A) DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER (STXFIFOTRG) is designated for  Slave (Target) mode. The corresponding mask for Master (Controller) mode would be DL_I2C_INTERRUPT_CONTROLLER_TXFIFO_TRIGGER  (MTXFIFOTRG).

    1B) DL_I2C_INTERRUPT_TARGET_ARBITRATION_LOST (SARBLOST) is designated for  Slave (Target) mode. The corresponding mask for Master (Controller) mode would be DL_I2C_INTERRUPT_CONTROLLER_ARBITRATION_LOST (MARBLOST). [SARBLOST is a curiosity since a Slave doesn't participate in Arbitration; it's not clear  that SARBLOST Ever triggers.]

    2) I'm not quite sure what happens if you enable both Master (MCTR:ACTIVE) and Slave (SCTR:ACTIVE) modes simultaneously. I haven't seen anything in the TRM that suggests the I2C unit can switch modes automatically (e.g. after a lost-arbitration). [Edit: The IRQn is the same for both modes.]

    3) These look like the correct sequences. As corroboration, they seem to match those used in Example i2c_controller_target_dynamic_switching (here).