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.

I2c Addressing

Other Parts Discussed in Thread: MSP430G2553

Hai,

Iam using msp430g2553 ,so it has USCI.

Then my question is that when Iam interfacing with DS1307 using I2C  what is the address loaded in the 

UCB0I2CSA. I chose 0x68. Then needed to shift the adress again?

  • Ask the DS1307 datasheet.
    What slave address does the device have? Note that you need to use the slave address, which is the same for read and write and ranged from 0x00 to 0x7f (7 bit value).

    But some manufacturers instead give the start byte, which is different for read and write operation. In this case, you need to shift it right by one bit. The USCI will automatically add the R/W bit based on current operating mode (UCTR), when sending a start byte.

  • The datasheet shows slave address as  b1101000  ie 0x68

    can i use like this UCB0TXBUF=0x68

    can I follow bit bang method?  

  • Hi,

    The same problem i have faced long back in 6638 meters.

    U need to shift address byte by one bit right and place in to TXBUF.

    That is if address is 0x68 then u need to place 0x34 in to TXBUF.

    It will work for shore.

    Regards

    Raviteja V

  • You don’t send the start byte through TXBUF. The USCI module internally takes care of the addressing.
    When you set the UCTXSTT bit, the USCI will automatically assemble the start byte and send it. TXBUF (and RXBUF) is plain data only. Addressing and handshaking is done by the hardware.

    Take a look at the diagrams in the uses guide. They show cleanly how a transfer is performed and what has to be done when.

**Attention** This is a public forum