How to find which one is master/slave? – PIC

eepromi2cpic

Im using PIC24FJ64GA002 microcontroller interfacing with EEPROM(24C256). EEPROM's SDA and SCL pins are connected with respective PIC24F I2C1's SDA and SCL. All other pins of eeprom are grounded. Here i have EEPROM address that is 0xA0. Now, how to find which one is slave and master? Is PIC or eeprom? I've heard which has clock that is a master. Both have clock pins.

enter image description here

Best Answer

The EEPROM is the slave.

In the On Semi 24C256 datasheet, for example, it says

The CAT24C26 acts as a Slave device.

However it should be obvious that this is the case, because the EEPROM has no idea what I2C address the PIC is using, nor which storage address should be read or written, until it is told, and the master is responsible for providing this information.

Also, under I2C, only the slave has an address. Since the EEPROM has an address (often even called a "slave address") it is clear the EEPROM acts as the I2C slave.

Related Topic