The problem is to making soft i2c in my renesas controller.

Discussion in 'Embedded Systems and Microcontrollers' started by tanna, Aug 2, 2015.

  1. tanna

    Thread Starter New Member

    Aug 2, 2015
    2
    0
    hello....i am trying to making soft i2c in my renesas controller....but im facing one problem.....first i m using start condition...and then i am writing 1 byte...and at the 9th clock pulse....when i make my port as a input pin...the SDA line that should be done LOW by EEPROM...it is not happening.....so what can i do for that?plz help
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    I have a love/hate relationship with I2C. Love how easy it is electrically to set up and add new devices to an existing bus. Hate how complicated the transactions can be.

    You are doing the right thing stopping when you don't get the ACK (acknowledge) signal back. That signal is created by one slave device when it sees it's address correctly on the bus.

    Well, you have a bunch of things to do to get that to work. Don't forget there is also a timing issue here so never change both clock and data together.

    The address gives me trouble too, as the address is technically a 7 bit number placed in the upper portion of an 8 bit byte. Some manufacturers spec the 7 bit number, some the shifted number in the 8 bit space. Check the data sheet.

    Finally, the memory itself may support multiple addresses using extra pins. Check you have them correct too.

    I2C may go as slow as you want, so you can check the bus even with a voltmeter by running it in steps literally bit by bit

    If you have further questions could you please post your code and a sketch of the SDC and SCL waveforms? Also what device are you addressing?

    And welcome to the forums!
     
    Last edited: Aug 2, 2015
  3. tanna

    Thread Starter New Member

    Aug 2, 2015
    2
    0
    if u have some kind of similar code....can u please put it on forums?for varification of my code?
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    Sorry I have not had to bit-bang an I2C bus since I stopped working tieh Basic Stamps 15 years ago, and that code was in the Basic language
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,793
    Have you tried sending all possible address bytes to the device to find out which address it thinks it is?
     
Loading...