I want to drive a 2 lines LCD display http://www.dfrobot.com/wiki/index.php?t ... :_DFR0063) with my Pi
This is a HD44780 LCD + 8574 expander
Connected SDA to Pi I2C0 SDA
SCL to Pi Pi I2CO SCL
GND to Pi GND
VCC to Pi 5V (many advanced electronic users say that in this particular case it's no problem using a 5v device on the 3.3v Pi, because the Pi beeing the driver 5v is never used and the i2c device still works fine. After several hours of tries, my Pi is no yet fried. So far, so good)
i2detect -y 0
Code: Select all
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
I want to drive the LCD from a C program, and I'm using this library : https://github.com/j3557o/RPi_i2c_test/tree/master/src
Changed address to 0x27
And because I found these values on Arduino library (which drives the LCD successfully)
Changed LCD_RS from 0x20 to 0x01
Changed LCD_EN from 0x80 to 0x04
When the program executes, the LCD backlight goes on during initialisation phase, then if I try to write a string it goes off and nothing (or garbage) is displayed on the screen
ex.
Code: Select all
int main(int argc, char *argv[]){
char hello[] = "Funny Funny!";
LCD_setup();
usleep(500);
lcd_string(hello);
}Reading 8574 datasheet didn't gave me a clue.
Any idea ?
