Go Down

Topic: problem interfacing LCD using I2C bus (Solved :) ) (Read 5 times) previous topic - next topic

sushant

Aug 21, 2012, 06:07 pm Last Edit: Aug 27, 2012, 01:54 pm by sushant Reason: 1
hi,
i was trying to interface 16x2 LCD to the Arduino using I2C bus, but despite all the efforts was unable to Display "Hello world" example.

informations:

1) i'm using pfc8574AP, the circuit is theone demonstrated herehttp://dangerousprototypes.com/2009/08/13/bus-pirate-hd44780-character-lcd-adapter/

2)A2,A1,A0 is connected to ground .so have assigned the address as 0x38 w.r.t the datasheet
3) have connected pull-down resistors of 4.7K (as per the instruction on various forums)

4)code used is:

Code: [Select]

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x38,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
 lcd.init();                      // initialize the lcd

 // Print a message to the LCD.
 lcd.backlight();
 lcd.print("Hello, world!");
 Serial.begin(57600);
}

void loop()
{
}

(code tags fixed by moderator - you were pretty close!)

need help in getting this thing working.

thanks,
Sushant

CrossRoads

Isn't there usually a part where you define the pins you are using with the library?

I didn't see any software or links to software at dangerous prototypes
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

CrossRoads

Oh, I2C = so you are connected to SCL/SDA?
You need this too then:
Wire.begin(address);

http://arduino.cc/en/Reference/Wire
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

CrossRoads

Check this too

http://arduino.cc/playground/Code/LCDi2c

"09-14-2009 Mario added support for using a standard HD44780 compatible LCD using the PCF8574 . The new library named "LiquidCrystal_I2C" and can be found here http://www.arduino.cc/playground/Code/LCDAPI "
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

m12lrpv

#4
Aug 22, 2012, 06:45 am Last Edit: Aug 22, 2012, 07:06 am by m12lrpv Reason: 1
Just quickly... I2C needs pullups not pulldowns


Also i'm looking at the TI datasheet for the PCF8574 and it suggests that the full address is not 0x32 (32 is actually the decimal value from the table)

According to page 4 it should be combined with the read write.

If I was you I'd forget the LCD for the moment and just connect the PCF8574 to some LED's. Once you get the address and the communication worked out connect it to the LCD.

Go Up