[General] Doubt on I2C multi slave communication.

Status
Not open for further replies.

chandu.kurapati

Full Member level 3
Joined
Oct 31, 2013
Messages
186
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Location
Bengaluru, India
Visit site
Activity points
2,778
Hi every one,

I have one doubt regarding to I2C master-multi slave communication, here i'm communicating the master with 3 EEPROM's they have same address.

when the master start communication it generates the start bit, then address they are same for three slaves, then which slave wins the game and get the access of the master.

I'm totally confuse about it what happen when three slaves are same address,memory and all requirements.please can any one explain about it.

Thanks & Regadrs,
Chandu.Kurapati.
 

Hi horacel1,

I was worked on at24c1024 it has the address 0xA0 in thae data sheet, it is the fixed address to communicating with that EEPROM. According to your words I don't communicate 3 of same manufacturer EEPROM with the micro controller at a time.

My understanding is correct or any thing wrong, can you please explain me.

Thanks & Regards,
Chandu.Kurapati.

- - - Updated - - -

Hi horacel1,
My EEPROM data sheet link is follows it has only one address line A1.
http://www.atmel.com/Images/doc1471.pdf

Thanks & Regards,
Chandu.Kurapati.
 

Hi horacel1,
Your post meaning is we can communicate two same address devices with the micro controller.is it correct.

Thanks & Regards,
Chandu.Kurapati.
 


I2C doesn't work that way...the concept of "winning the bus" is an arbitration shceme that applies to a multi master configuration (which obviously isn't the case in your design).
With I2C, ALL bus slaves MUST have a unique address.
In your case, the maximum number of EEPROMs on the bus is 2. Do allow that, you have to set the address pin to opposite values for each EEPROM IC.
 


Hi horacel1,

You said that with I2C, ALL bus slaves MUST have a unique address what is meaning of that?
But i'm in one of the my project communicating RTC, EEPROM with that same I2C, which have different address that is working fine.

I don't understand another concept in your post i.e for EEPROM AT24C1024 have only one address in the data sheet i.e 0xA0, according to that data sheet i MUST configure that address for communication,But you said that set the address pin to opposite values for each EEPROM I2C, where i wish to set that different address for pins i don't understand that concept.

Can you please explain in detail

Thanks & Regards,
Chandu.Kurapati.
 

You said that with I2C, ALL bus slaves MUST have a unique address what is meaning of that
I said that.
But i'm in one of the my project communicating RTC, EEPROM with that same I2C, which have different address that is working fine.
EXACTLY. They all have DIFFERENT addresses - that's what I meant by: UNIQUE.


The at24c1024 supports 2 address! They're settable by applying either '0' or '1' voltages at the configuration pin.
If one device is set to '0', the other MUST be set to '1'. Otherwise, non of the devices would work correctly.
 

Hi horacel1,

Thank you very much for your support, I understand the concept what i posted, it's solves my requirement.

Thanks & Regards,
Chandu.Kurapati.
 

Hi horacel1,

Thank you very much for your support, I understand the concept what i posted, it's solves my requirement.

Thanks & Regards,
Chandu.Kurapati.
good, hope it works!

one of the advantages of SPI is that you have a chip select signal - so long as the microcontroller has spare digital outputs (or add an IO extender) you can keep adding devices
 

In general,it is not recommended to use same address slaves in one I2C bus. Use the CS(chip select) pin to control the slave connect or disconnect from bus if you want to do so. Delay some specified times before operating to make sure the slave has already prepared success.
 

Hi shell.albert,

I'm using EEPROM AT24C1024, In that chip no dedicated chip select option, then how to select the chip. I think in I2C no chip select option it is applicable only for SPI. I don't understand your concept,Can you please elaborate your post.

Thanks & Regards,
Chandu.Kurapati.
 

you are correct - SPI slaves are selected using chip select I2C has built in slave addresses - both have advantages and disadvantages
 

Hi horacel1,

Thank you for your great support, and another thing is i read about I2C & SPI but i don't understand about in which types of application we select the I2C and which type of the applications we select the SPI. i have too much confusion about it.

Can you please explain it with your development experience, and please explain about major difference between I2C & SPI.

Thanks & Regards,
Chandu.Kurapati.
 

Hi,

I recommend to read about busses and devices before starting a project.
At least when you facing problems you have to read about bus structure, bus arbitration, hardware requirements, addressing and all the other bus related things.
The same is for devices - read the datasheets carefully.

To your problem.
Using multiple devices with same or overlapping address (area) makes no sense.
Either you use
* larger eeproms to store your data,
* eeproms with additional addressing pins
* different eeproms with different hardware address
* use MUX on SCL and SDA to switch between different eeproms

Klaus
 

Hi horacel1,
Can you please explain it with your development experience, and please explain about major difference between I2C & SPI.

Thanks & Regards,
Chandu.Kurapati.
in many cases for a particular application there are solutions in both I2C and SPI, e.g. the Microchip temperature sensors TC72 (SPI) and TC74 (I2C)
sometimes it is a pragmatic choice
1. we already have used a device and have the PCB footprint and the code for it
2. we already have a SPI or I2C device on the PCB so it is simple to extend the bus for another device

other considerations are SPI need a chip select line (extra pin on processor and more PCB routing) but I2C is more complex in software terms (although peripheral libraries provided by many chip manufacturers simplify this).
Also considering chips such as the pic24FJ256GB110 the I2C pins are fixed whereas the SPI pins can be chosen using Peripheral Pin Select making PCB routing simpler.

do a web serach for SPI vers I2C and you will get plenty of links discussing the pros and cons, e.g.
http://electronics.stackexchange.com/questions/29037/tradeoffs-when-considering-spi-or-i2c
http://quick2wire.com/articles/i2c-and-spi/
http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…