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.

Interface MSP430 to multiple I2C slaves

My problem is that i can communicate MSP430 with a single I2C slave, then i can do it. However, I actually dont know the procedure to interface MSP430 to multiple I2C slaves at the same time. 

Anybody can explain to me, or give me some example projects!

Thanks in advance!

  • hi,

    u can go for multiple slaves on I2C bus using MSP430. But one thing u have to be careful is maximum bus capacitance. But, at a time u can communicate with only one slave. Simultaneous communication on same bus is not possible. Its just simple. U have to use different slave addresses. Many slaves can be present on the same bus. Bus capacitance is the factor that limits the number of slaves. For that you have to go through the slave and masters datasheets. Just use different slave addresses and connect the slaves to the same bus. It will solve your issue.

    Regards,

    Gurumoorthy

  • Well, my idea is how to communicate multiple I2C slaves one after one. In my case, i want to get data from MPU9150 and then BMP180 and then loop again.

    Initialize MPU9150();

    Initialize BMP180();

    Loop{

        Set address of MPU9150;

        Get data;  

        Set address of BMP180;

        Get data;

    }

    Is that okie or need to be modified!

  • Happy Smile said:
    to multiple I2C slaves at the same time

    Writing to all Slaves at the same time is possible using the General Call address ‘0’, but Slaves needs to be enabled for this feature. Reading on this way can generate en Arbitrage error.

  • Maybe i use the wrong word that make you misunderstand my idea. What i want is to read data from MPU9150, then BMP180 then loop again. Can you suggest me the correct procedure?

  • I2C is a bus with individual slave addressing. So any number of slaves (well, up to 100, as there are only 128 addresses and some are reserved) can be attached to the bus at the same time (however, the input capacitances will then limit the maximum bus speed)

    On each transfer, the first thing the master sends is the slave address. Only the slave with this address will respond, all others will remain silent.
    Be careful if attaching multiple laves of the same kind. Some of them have one or more address pins, so you can assign them different addresses. Others use some weird mechanism to assign them a slave address using the aforementioned general call. But this is rather complex and too difficult to handle for a beginner. Get some experience with a simple slave first, if your final target is such a device.

  • hi,

    if you read the I2C protocol from the NXP semiconductors properly, I am sure that you will find appropriate way to do it.

    Regards,

    Gurumoorthy

  • Can you give me the link to the pdf file?

  • The original I2C specification was from Philips/Valvo, now NXP. The specification as released 1992 while I2C is a few years older, but only internally used by Philips devices.
    The latest release is found here: http://www.nxp.com/documents/user_manual/UM10204.pdf

    You can also look here: http://www.i2c-bus.org/i2c-bus/

**Attention** This is a public forum