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

Status
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

 

Attachments

  • 16F690_LCD_I2C_Backpack_x2.asm
    17.3 KB · Views: 401
  • I2C LCD Backpack Schematic.png
    92.4 KB · Views: 631
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…