I2C_Edge_Conditions 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. I2C Edge Conditions:
  2. ====================
  3. I2C devices may be left in a write state if a read was occuring
  4. and the CPU was reset. This may result in EEPROM data corruption.
  5. The edge condition is as follows:
  6. 1) A read operation begins.
  7. 2) I2C controller issues a start command.
  8. 3) The I2C writes the device address.
  9. 4) The CPU is reset at this point.
  10. Once the CPU reinitializes and the read is tried again:
  11. 1) The I2C controller issues a start command.
  12. 2) The I2C controller writes the device address.
  13. 3) The I2C controller writes the offset.
  14. The EEPROM sees:
  15. 1) START
  16. 2) device address
  17. 3) START "this start is ignored by most EEPROMs"
  18. 4) device address "EEPROM interprets this as offset"
  19. 5) Offset in device, "EEPROM interprets this as data to write"
  20. The device will interpret this sequence as a WRITE command and
  21. write rubbish into itself, i.e. the "offset" will be interpreted
  22. as data to be written in location "device address".
  23. Notes
  24. -----
  25. !!!THIS IS AN UNDOCUMENTED I2C BUS BUG, NOT A AMCC 4xx BUG!!!
  26. This reset edge condition could possibly be present in every I2C
  27. controller and device available. For boards where a I2C bus reset
  28. function can be implemented a i2c_init_board() function should be
  29. provided and enabled by #define'ing CONFIG_SYS_I2C_INIT_BOARD in your
  30. board's config file. Note that this is NOT necessary when using the
  31. bit-banging I2C driver (common/soft_i2c.c) as this already includes
  32. the I2C bus reset sequence.
  33. Many thanks to Bill Hunter for finding this serious BUG.
  34. email to: <williamhunter@attbi.com>
  35. Erik Theisen <etheisen@mindspring.com>
  36. Tue, 5 Mar 2002 23:02:19 -0500 (Wed 05:02 MET)