I am attempting to connect an 8051-compatible microcontroller to an accelerometer using the I2C bus. Both devices operate at the same voltage, 3.3v. However, I am failing to understand something: won't a direct short be created when the microcontroller asserts a logic HIGH on either SCL or SDA and the slave device attempts to hold the line at logic LOW? I don't understand how to avoid this...
How can I make the MCU float the lines instead of placing a logic HIGH on them? I realize I can change the state of the lines to "input" instead of output, but is that safe to avoid a short circuit?
As I see it, the following scenario could happen:
If the MCU switched from 'input' mode to 'output' mode, couldn't the pin be in the HIGH state, even if you set the pin to LOW, then set input mode to 'output'? Won't the input voltage change the state back to HIGH due to the pin being in 'input' mode, before it has a chance to switch to output mode? Then for a few uS you would be outputting a logic high, before the MCU executed the next instruction to turn the pin to LOW.