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

Status
Not open for further replies.

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: 423
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…