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.

Slave address problem

Other Parts Discussed in Thread: MSP430FR5739, MSP430WARE

Hi,

Iam bit confusion about setting slave address using I2C in MSP430FR5739.

My slave address without r/w bit is 0x31. 

In the MSP430 data sheet for i2c says it is right justified.

so what actually  i have to set for slave address in I2C? along with r/w or without r/w bit?

Can any one explain me clearly?

Thanks in advance.

Regards. 

  • Uma,

    I assume you are using 7-bit slave addressing on the MS430, and the MSP430 is the I2C host.

    The MSP430 eUSCI on the FR5739 automatically handles the r/w bit for you, so you don't have to worry about it.  All you need to do is put the target's 7-bit slave address in the UCBxI2CSA (bits 6:0).

    In your case, the code should look like this (assuming eUSCI0):

    UCB0I2CSA = 0x31;

    If the MSP430 is the slave devices, then you should put the address in one of the Own Address Registers (UCBxI2COAn) and set the UCOAEN bit in that register.

    Mike

  • Hi Mike,

    Thank you for reply.

    Then how it is possible whether msp430 mcu is reading or writing?

    Regards.

  • Uma,

    The eUSCI module on the MSP430 handles adding the R/W bit automatically, based on what the status of the UCTR bit of the UCBxCTLW0 register when a start condition is generated.  The start condition is generated by setting the UCTXSTT bit of the UCBxCTRLW0 register.

    Please see page 556 (Table 20-4) of the FR57xx Family User's Guide for more details on the UCBxCTLW0 register, as well as the entire Chapter 20 for more information regarding the eUSCI in I2C mode.  Also, the code examples (either in MSP430Ware in CCS or from the MSP430FR5739 Product Page, shortcut here) provide examples of the eUSCI module in both read and write modes.  Please compare the different examples for details regarding the differences in register settings.

    Mike

  • Hi Mike,

    Thank you once again for the information.

    Regards.

**Attention** This is a public forum