Hi All,
This is a response to a code request from Jurjen posted in another thread.
As I had my laptop stolen I lost a lot of my source code, but not to fear I set up a new PCF8574 - LCD test bed this morning and came up with the working code shown below.
Bear in mind this is with the PCF8574 not the PCF8574A part.
Out 0 is wired to the E input of the LCD.
Out 2 is wired to the RS of the LCD.
I am using the full 8 bit data path of the PCF8574.
All 3 of the addresses are tied low to keep it simple.
EEPROM 1,("THis Is A TEst"
main:
i2cslave %01000000, i2cslow, i2cbyte
writei2c 0, (%00000001) 'Clear Command
low 2 'Set R/S Low pulsout 0,1 'Pulse E to send
pulsout 0,1 'Pulse E Again
high 2
pause 200
writei2c 0, (%00001100) 'Function set 8bit
low 2
pulsout 0,1
pulsout 0,1
high 2
pause 20
writei2c 0, (%00000001) 'Clear Command
low 2
pulsout 0,1
pulsout 0,1
high 2
pause 20
for b6 = 1 to 14 '14 is the length of my string
read b6,b2 'Read Mem into b2
writei2c 0, (b2) 'Write it to the PCF8574
high 2 'Set R/S High for data
pulsout 0,1 'Pulse E to write to lcd
low 2
next b6
This is a response to a code request from Jurjen posted in another thread.
As I had my laptop stolen I lost a lot of my source code, but not to fear I set up a new PCF8574 - LCD test bed this morning and came up with the working code shown below.
Bear in mind this is with the PCF8574 not the PCF8574A part.
Out 0 is wired to the E input of the LCD.
Out 2 is wired to the RS of the LCD.
I am using the full 8 bit data path of the PCF8574.
All 3 of the addresses are tied low to keep it simple.
EEPROM 1,("THis Is A TEst"
main:
i2cslave %01000000, i2cslow, i2cbyte
writei2c 0, (%00000001) 'Clear Command
low 2 'Set R/S Low pulsout 0,1 'Pulse E to send
pulsout 0,1 'Pulse E Again
high 2
pause 200
writei2c 0, (%00001100) 'Function set 8bit
low 2
pulsout 0,1
pulsout 0,1
high 2
pause 20
writei2c 0, (%00000001) 'Clear Command
low 2
pulsout 0,1
pulsout 0,1
high 2
pause 20
for b6 = 1 to 14 '14 is the length of my string
read b6,b2 'Read Mem into b2
writei2c 0, (b2) 'Write it to the PCF8574
high 2 'Set R/S High for data
pulsout 0,1 'Pulse E to write to lcd
low 2
next b6