AnsweredAssumed Answered

Kinetis K10: Reset the I2C module

Question asked by Dilebo on Mar 4, 2014
Latest reply on Mar 5, 2014 by Dilebo

Hello,

 

I have an issue with the I2C module.

 

Context:

µC K10 is the Master, linked to only one slave.

I configured the Power Management Controller to reset on a Low Voltage Detect (PMC_LVDSC1[LVDRE]).

 

This is what happens:

When the tension rises slowly, the µC boots, then the I2C communication starts but it is stopped by the hardware reset (due to the Low Voltage Detect).

Then, when the tension is high enough, the I2C is locked in a busy mode.

 

Untitled drawing.png

 

Tested solutions:

I tested the SoftReset function from the BareMetal Drivers.

 

/*  Do a Soft Reset of EEPROM (necessary if EEPROM had been left in the midlle of one transaction)
 * @param none
 * @return none
*/
void EEP_I2C0_SoftReset(void)
{


  if ((I2C0_S & I2C_S_BUSY_MASK) != 0) {
      i2c_Stop(I2C0);
  }
  I2C0_S |= I2C_S_IICIF_MASK;        // Clear remaining flags
  I2C0_S |= I2C_S_ARBL_MASK;
  /* send start signal */
  i2c_Start(I2C0);
  Pause();
  /* send ID with W/R bit */
  i2c_write_byte(I2C0, 0xFF);
  i2c_Wait_interrupt(I2C0);
  Pause();
  /* Do a repeated start */
  i2c_Start(I2C0);
  Pause();
  /* Send stop */
  i2c_Stop(I2C0);
  i2c_busy(I2C0); // wait for bus to be "free"
  I2C0_S |= I2C_S_IICIF_MASK;        // Clear remaining flags
  I2C0_S |= I2C_S_ARBL_MASK;
}

 

I tested the solution from Yuri Muhin: Re: I2C reset

 

Any help would be welcome.

Outcomes