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.

i2c master strange behaivor and I2CSlaveDataPut hasn't timeout

Other Parts Discussed in Thread: EK-TM4C123GXL, ENERGIA

I'm using Energia 0101E0012 with EK-LM4F120XL and EK-TM4C123GXL.

I found I2C master behaivor strange when no pull ups in i2c bus.

First problem is i2c bus scanner:

Wire.beginTransmission(addr); 

byte error = Wire.endTransmission();

The 'error' always be zero, means no error! 

Second problem is i2c write

Wire.beginTransmission(addr);
Wire.write(value); <----------- stuck here until pull up connect to bus
Wire.endTransmission();

Looking at Wire.c (from TivaWare used in Energia sources)  I found which I2CSlaveDataPut hasn't any timeout parameters.

  • Murilo Pontes said:
    I found I2C master behaivor strange when no pull ups in i2c bus.

    Many would find I2C master behavior, "strange" if it worked without pull-ups!  Pull-ups are, "normal/customary" for each/every I2C application...

  • Hello Murilo,

    But of course w/o pull up I2C will not work. And why it get stuck is because w/o pull ups the SCL and SDA will be sampled most of the time as 0 which would mean to the I2C Controller that the Bus is Busy.

    In the energia code base the first thing it checks is if the Bus is Busy and indeed it finds it busy (as lines are sampled 0). When you connect the pull up's the line is no longer busy and it goes ahead.

      if(TX_BUFFER_EMPTY) return 0;
      //Wait for any previous transaction to complete
      while(ROM_I2CMasterBusBusy(MASTER_BASE));
      while(ROM_I2CMasterBusy(MASTER_BASE));

    Regards

    Amit