Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

msp430 i2c slave address

Other Parts Discussed in Thread: MSP430G2452

hi,

i want to control 'n' no. of slave devices all of which are msp430 and the master is also msp430. how do i address or communicate with each of the slave devices separately?

  • I2C uses closed transactions. YOu address a slave, send (or receive, one or the other) data and end the transaction. Then you can either change the direction of the transfer or address a different slave. Also, you can send to all slaves simultaneously.

    Each slave has a factory-set address. Some of them also have parts of this address programmable by I/O pins. And I've seen a few where you could set an addres sby sending a broadcast command to all slaves, containint a serial number (factory set) and an I2C address to be used by the slave with this (unique) serial number. But that's rather unusual.

    If both, master and slaves, are MSPs, each MSP needs to have its own, unique 7 bit address and the master has to know them.

    Then the master says 'hey, slave #xy, I want to send you data' or 'I want data form you' and the slave acknowledges (if it exists) and then data is exchanged until the master says "that's all"

    For details on I2C, you can read teh respective chapter in the MSP430 users guide of the family you want to use. Also, there ar lots of threads about I2C in this forum.

  • Thank you for your reply.

    I'm using MSP430G2452 for all the devices. All MSP4302452 have the same slave addresses. How can i make the master to differentiate between the slaves?

  • Shalini Sanchivi said:
    All MSP4302452 have the same slave addresses. How can i make the master to differentiate between the slaves?

    You cannot. That's why it is a "slave address" and not a "slave model nr."

    No two devices on an I2C bus may have the same slave address. Never.

  • Thank you.

    I'll see what can i do with my problem.

  • Shalini Sanchivi said:
    I'll see what can i do with my problem.

    If oyu have a dew unused I/O pins, you may tei them to VCC or GND and use these bits as LSBs for the individual address. SO each chip has the same firmware, but has its pins connected differently. This is the sam emechanism as used for cmany commercial I2C devices where the upper 4 (or more) bits of the address are fixed for the device, and the lower 3 (or less) bits can be programmed by I/O pins, allowing up to 8 identical devices on the same I2C bus.

**Attention** This is a public forum