• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Assembly Language Bit-Banged I2C Driver For PCF8574 I2C LCD Backpack

Not open for further replies.

Mike - K8LH

Well-Known Member
Attached, please find an example assembly language program for bit-banging low-level I2C start, write, and stop functions for PIC devices that do not have a hardware I2C peripheral (MSSP). The program is rather crude and pretty much the bare minimum necessary to drive a PCF8574 based I2C LCD backpack and HD44780 display. The program weighs in at 172 words of program memory and uses 4 bytes of RAM memory.

The 16F690 target uses the 8-MHz INTOSC and the I2C clock is being driven at 100-kHz. Low-level LCD init, putCmd, and putDat functions support the backpack and display. It takes ~617-us to write a byte of data to the LCD so throughput is equivalent to about 13000 baud.

Have fun... Please let me know if you have any questions...

Cheerful regards, Mike, K8LH

Bit-Banged I2C.png


Last edited:
Not open for further replies.

Latest threads

EE World Online Articles