The lcd defines are not correct format.
The 16f628a does not use adcon1, but you need to turn off comparators that are on porta.
'ADCON1 = 7 'Set PORTA and PORTE to digital
CMCON = 7 'turn off comparators
address E0 is not set anywhere.
remove the spaces after "$"
that i2cread will only read one byte, you'll need to set an array and use str\x or a loop to read the whole string.
You may want to send something to the lcd first to make sure it's working before solving the i2cread issues.
the following compiles and should display the "Display working" at least
Code:
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
SCL var PORTA.0 'Clock pin
SDA var PORTA.1 'Data pin
E0 var WORD 'Address <<<< I changed this to "WORD"
B1 var byte 'Data 1
CMCON = 7 'turn off comparators
Pause 100 'Wait for LCD to start up
E0 = $0000 'didn't see i2c address anywhere, need to set.
b1 = e0 + $80 'B1 is the EEPROM data
pause 100
LCDOUT $FE,1,"Display working!" ' see if lcd setup correctly.
I2CWRITE SDA, SCL, $A0, E0, [B1, "pic basic pro"] 'WRITTEN
pause 100
I2CREAD SDA, SCL, $A0, E0, b1
PAUSE 100
lcdout $FE, 1, B1
end
Bookmarks