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.

CCS/TM4C1231H6PM: I2C DUAL SLAVE ADDRESS

Part Number: TM4C1231H6PM

Tool/software: Code Composer Studio

Hi ,

I am currently using the TM4C1231H6PM which will be connected to master MPU (microprocessor) via I2C .

Can we use the Dual slave address for I2C interface with MPU so that we can send with one address the custom data and another address with general data for tiva device.

Please let me know can we use  dual slave address with one master.

Regards

Raghav

  • Hello Raghavendra,

    Please see Section 16.3.1.7 of the device datasheet which covers I2C Dual Address support.
  • Thank you Ralph,

    I have requirement in which,need to access in the following manner with I2C interface

    MPU(MASTER) I2C ----------MCU (TM4C1231H6PM) Slave I2C

    Master MCU (TM4C1231H6PM ------- Slave Device 1
    Master MCU (TM4C1231H6PM------- Slave Device 2
    Master MCU (TM4C1231H6PM ------- Slave Device 3

    How to mux the address when MPU master ---- MCU slave (I2C interface ) to access the slave 1, 2, 3


    Regards
    Raghavendra
  • Hello Raghavendra,

    Your setup isn't fully clear to me, as you state in the first half that the TM4C1231H6PM is the Slave device, but then state that there are 3 TM4C1231H6PM's as Master devices?

    As far as what you trying to do, I am not so sure you need, or would even be able to leverage, dual address mode just given that you claim to have 3 devices involved as slaves. There are only 2 Slave Addresses which can be stored (in I2CSOAR and I2CSOAR2 registers) per TM4C device at maximum regardless, so I am not sure how dual address would even help you.

    In generally, each slave device should have it's own address, and the MPU Master should talk to each slave during their unique address. That is the basis of I2C communication with multiple slaves on the bus. If you are trying to do something more complex, I'm going to need more details to comment what may or may not be possible, along with clarifying your setup (maybe I am not understanding it right?). Though if this is your first time using I2C, let me know and I can provide some helpful documents to assist in your learning.
  • Hi Ralph,

    Please share the docs related to I2C .

    Can we use the following configuration for the above mentioned requirement


    MPU(MASTER) I2C -----I2C0-----MCU (TM4C1231H6PM) Slave I2C

    From MPU (Master ) need to access the Slave device 2 and 3 for basic read and write ,since the Slave device 1 has lots of configuration /settings /Control .Hence can we do this mentioned below or is there any other method.


    MPU(MASTER) I2C ----(I2C0) slave address 1 -- Master MCU (TM4C1231H6PM -------I2C1--- Slave Device 1


    MPU(MASTER) I2C ----(I2C0) slave address 2 ------Master MCU (TM4C1231H6PM--------I2C2--- Slave Device 2


    MPU(MASTER) I2C ----(I2C0) slave address 2 ------Master MCU (TM4C1231H6PM --------I2C3--- Slave Device 3

    Regards
    Raghavendra
  • Hello Raghavendra,

    Here is a general I2C document that is not device specific to help understand how I2C fundamentally works: http://www.ti.com/lit/an/slva704/slva704.pdf

    We also have a I2C document for the TM4C129 devices, you may find this quite useful still though as a lot of information will be applicable for your TM4C123 device: http://www.ti.com/lit/an/spma073/spma073.pdf - there also is a link to I2C specifications within.

    Since you are using I2C0 and I2C1 to separate master and slave, that should work well, just keep in mind you will only be able to send or receive from one peripheral at a time. TM4C is not multi-core, so if for example I2C0 is receiving then that must finish before I2C1 can be used as the CPU will be busy with I2C0. You should plan to use interrupts to streamline the I2C comms between devices.

    You list 'slave address 2' and tie it to two different TM4C1231 devices, that isn't how slave addressing works. The 'dual address' feature is for the TM4C1231 to respond to two different slave addresses. Not to allow the master to use the same slave address between two devices. Neither slave will know the other has the same address so both will try to reply and that will cause a conflict on the bus. You need to have separate slave addresses for each TM4C1231 slave. This is why I don't think you need dual address mode.

  • Thank you Ralph,

    Regards

    Raghavendra 

  • Ralph Jacobi said:
    You list 'slave address 2' and tie it to two different TM4C1231 devices

    TEN (USD) argues that was a "typo" - Slave Address 3 was (more than likely) intended...