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.

MSP430I2020: I2C in 10 bit addressing mode?

Part Number: MSP430I2020
Other Parts Discussed in Thread: MSP430WARE

Hello! How can I use MSP430I2020 I2C in 10 bit addressing? Is there an example with driverlib?

  • I haven't tried it, but SLAU335 sec 12.3.5.2.3 makes it look pretty easy -- just set UCB0CTLW0:UCSLA10 and/or UCA10 and the USCI does the rest. Figs 12-14 and Figs 12-12/13 look pretty similar in the indications visible to the CPU.

    My copy of the driverlib source doesn't mention UCSLA10 (or UCA10), so I suppose that driverlib doesn't support it directly.

    However Fig 12-17 claims that you can set UCSLA10 when the USCI isn't in reset, so you could probably just set it directly after calling init(). (I'm thinking master here; you might need a different trick if you're making a 10-bit slave with UCA10.)
  • I should have looked a bit further -- it appears that EUSCI_B_I2C_setSlaveAddress() takes a uint8_t, so you may have to set UCB0I2CSA explicitly as well.

    I'm looking at msp430ware_3_80_03_07, so maybe this has been improved since then.
  • Thank you! I've noticed that it requires setting UCA10, but it did not know if the peripheral handles the correct transmission of the address.

    The controller will be a slave, but I don't think the configuration is different.

    That is the latest version of MSP430Ware, so I will have to set the address by register.

  • For a 10-bit slave, SLAU335 sec 12.3.5.1.3 (similarly) suggests that the device deals with it all once you set UCA10. Whether your master knows how to send the extra SLA byte is of course a separate question, but I'm supposing that's how you got to this point.

    Looking through the driverlib source -- I'd encourage you to skim eusci_b_i2c.c to see what's there -- it appears that UCSWRST isn't cleared until you call EUSCI_B_I2C_enable(), so you should be able to set UCA10 between initSlave() and enable().
  • Thank you for the advice!

**Attention** This is a public forum