Electronics > FPGA

Multiplexing a pin for i2c signals and normal output signals

(1/1)

polarKaung:
Hi, I am doing a project which needs to multiplex a pin for i2c sda and a normal output signal. How do i do that? really appreciate your time and wisdom. I have been researching this on the internet and haven't really come up with any solution. Thanks.

TomS_:
You can very likely manually control the SDA pin without interfering with the i2c devices, but to use the pin for some other purpose (output) you're going to want to latch/clock the state of it into a flip flop or something along those lines. For input you probably want to feed it through a tri-state buffer that you can enable when ever you need to read it's state.

That's going to require one more pin to control the latch/clock/enable function, at which point you haven't really saved yourself any pins, so you might as well use that pin for your IO.

Alternatively, add a GPIO expander to the i2c bus and get yourself a bunch more IO pins.

DavidAlfa:
Not easy because you're going to mess the i2c bus.
You might get it working as long as you are careful, avoiding causing a start or stop condition.

That is, SCL can never change while SDA is low.



So you would need to always set SDA high before changing SCL, then you can whatever with SDA.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod