??? 06/20/04 22:15 Read: times |
#72829 - RE: Resetting I2C EEPROMS Responding to: ???'s previous message |
What I have implemented in my code of the I2C initialize and/or error recovery routine is the following sequence for the master.
1) Initialize the master bit-bang port bits 2) Release control on SDA @ master. 3) Release control on SCL @ master. 4) Drive the SCL low and then release back high 9 times. Make sure to clock at an in-spec rate. 5) Look to see that SDA as an input is high. If not high you have an unrecoverable bus error. 6) Assert a START sequence. IE. SCL initially High pull SDA low and then pull SCL low. 7) Generate a STOP sequence. IE. (after coming out of step 6 simply release SCL to go high and then release SDA to go high. Steps 6 & 7 will perform a simple reset of all of the active devices on the I2C bus. Note: When I refer to the action to "release" a line I am referring to removing any output pin drive the microcontroller may have on the I2C hand shake line. I2C bus lines are designed to run in an "open-drain" configuration and so low levels are asserted onto the bus by pulling them to ground. High levels are supposed to be established by the I2C bus pullup resistor. As such the "release" action on a typical master implementation is simply the act of making the port pin an input pin. This is all very easy on an 8051 type microcontroller with its quasi-bidirectional I/O pins. Other types of microcontrollers that have pin direction registers then these must be toggled from output LOW to input to "release" the line. Michael Karas |
Topic | Author | Date |
Resetting I2C EEPROMS | 01/01/70 00:00 | |
RE: Resetting I2C EEPROMS | 01/01/70 00:00 | |
RE: Resetting I2C EEPROMS | 01/01/70 00:00 | |
RE: Resetting I2C EEPROMS | 01/01/70 00:00 | |
RE: Resetting I2C EEPROMS | 01/01/70 00:00 | |
RE: Resetting I2C EEPROMS | 01/01/70 00:00 | |
RE: Resetting I2C EEPROMS![]() | 01/01/70 00:00 |