This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to connect 8051 as a slave device through I2C

Hi friends,

I have interfaced EEPROM and RTC with AT89C51 through I2C .Now i am trying to interface another AT89C51 as a slave device.In that i am having two issues

NO1:If I2C Bus needs any External Pull up Resistors ?
I am not having clear idea whether i can connect SDA(Serial Data pin) & SCL(Serial Clock pin ) directly to Master controller from Slave controller.Because while i am connecting EEROM i put 2.2k pull up resistor to SDA&SCL , also i know that in AT89C51 only P0 (port 0) is alone open collector. but here i am using P3 .

NO2:How to deal with I2C driver in Slave 8051?
Do u have any documents that how to write slave side program or web links.. for the same. because when i am searching i found plenty of documents only describing Master side programming. But i need details about slave side programming which is in Bit banking method.

Please share your experience and give good Web Links & Documents

Thanks & Regards,
Kirba

Parents
  • Since SPI is using a separate wire for clock and data,
    how does that distinguish it from IIC?

    Anyhow the problems with a bit-banged slave is basically the same for IIC and SPI, the distinguishing difference is that for SPI you do not need to have the data line connected to an interrupr..

    Erik

Reply
  • Since SPI is using a separate wire for clock and data,
    how does that distinguish it from IIC?

    Anyhow the problems with a bit-banged slave is basically the same for IIC and SPI, the distinguishing difference is that for SPI you do not need to have the data line connected to an interrupr..

    Erik

Children
  • For a couple of ms I was thinking about the Dallas one-wire interface - the danger of writing answers while at the same time working with another interface :)

    Anyway, an advantage with SPI is that it has separated MOSI and MISO so there is no need to switch port direction (or connect two pins to the signal). It also removes the need for open-drain signals.