Continue to Site

# ASM-Bit-Banged I2C Driver For PCF8574 I2C LCD Backpack for Enhanced PIC's

#### augustinetez

##### Active Member
I'm working on a PIC project that just wont do what it is supposed to do when all the various functions are assembled in to one file, so having a couple of pins spare, I decided time to look at various registers on an LCD and see what was going on (original project doesn't have a display attached).

I found some I2C LCD code on here originally written by Mike - K8LH back in August 2018 for the 16F690 and as I am using the 16F1827, I have modified Mike's code to suit the 16F1827 and attached the file here.

Just make sure to assign the pins you want to use for SCL & SDA in the appropriate place - I'm using RA1 & RA4 as I had those spare.

Rich (BB code):
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;  define 'scl' and 'sda' port and pins
;
iic_tris equ TRISA        ; TRIS reg for scl/sda pins
iic_port equ PORTA        ; PORT reg for scl/sda pins
sclndx  equ RA1            ; index for scl pin (RA1)
sdandx  equ RA4            ; index for sda pin (RA4)

Thank you Mike K8LH for the original.

#### Attachments

• 16F1827_LCD_I2C_Backpack_x2.asm
15.8 KB · Views: 84

Replies
14
Views
943
Replies
37
Views
2K
Replies
42
Views
4K
Replies
4
Views
677
Replies
5
Views
558