PCF8574 SDA/SCL Connect to GPIO?

Thread Starter

HellRyder

Joined Sep 5, 2013
1
Hello I want to ask a question. I currently need to use I2C chip which is the PCF8574.
I need to interface it with LED, LCD and a 4x4 Keypad. The thing is, my microcontroller has no port specified for SDA and SCL. The name of my microcontroller is VSX-6116. Attached is the datasheet and list of available ports. So can I connect the 2 wire line which is SDA and SCL to the GPIO ports? Including the pull-up resistor required by the 2 lines.
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
Sure you can use any two pins for I2C.

I2C works off open collector drivers, meaning a pull-up resistor makes the high level, and an output will pull down to make a zero. Such outputs are uncommon on micros but a micro can be made to work the same.

The "trick" is you write a zero to the data bit, then use the direction register to control the level: set as output it drives low, set as input the resistor pulls high.

You should find code examples on the web for this under "bit bang I2C."

And welcome to the forum!
 
Top