Pages: [1] 2   Go Down
Author Topic: Arduino UNO R3 + PCF8574P + HD44780  (Read 9888 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

sorry for my english. I use Google translation.

To my problem:
Arduino UNO R3 and LCD H44780 still works well.
Now I want to use a PCF8574P. It is no text, just a black screen.
http://www.abload.de/img/foto2o7ptp.jpg


I use this circuit.
http://www.abload.de/img/schematic_diagramk8pgf.jpg]


DISPLAYTECH 162C BCBC Datasheet


Code from http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/

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

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

void setup()
{
  lcd.init();                      // initialize the lcd
 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("ARDUINO+PCF8574P");
  lcd.setCursor(0,1);
  lcd.print("+HD44780=I2C-LCD");
}

void loop()
{
}

« Last Edit: October 03, 2012, 07:02:30 am by DEAFBOY » Logged


Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1. Your pnp is wired backwards;
2. Adjust backlight to show either the text or at least some black boxes;
3. No clue about the liquidlcd library, but make sure your had the i2c address right;
4. Put some pull up resistors there.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is not likely that your LCD library reads data from the LCD module and it therefore may not attempt to control the LCD R/W line (pin 5).   If the corrections in the previous post don't fix your problem then try disconnecting the wire from pin 10 of the PCF8574 and connect it to GND instead.

Don
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 40
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi the other thing that you can do is to give the LCD library (New LiquidCrystal library) here a shot. It looks like it is not initializing the LCD correctly:
http://

Code:


#include <LiquidCrystal_I2C.h>

//   LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
//                     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7 );

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3 );

void setup()
{
  lcd.begin( 16,2 );                      // initialize the lcd
 
  // Print a message to the LCD.
  lcd.setCursor(0,0);
  lcd.print("ARDUINO+PCF8574P");
  lcd.setCursor(0,1);
  lcd.print("+HD44780=I2C-LCD");
}

void loop()
{
}

or, with backlight control

Code:
// Constructor with backlight control
//   LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
//                     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
//                     uint8_t backlighPin, t_backlighPol pol);

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE );

void setup()
{
  lcd.begin( 16,2 );                      // initialize the lcd
 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("ARDUINO+PCF8574P");
  lcd.setCursor(0,1);
  lcd.print("+HD44780=I2C-LCD");
}

void loop()
{
}

That transistor looks a bit fishy too.

If you have the PCF8574 use Address 0x20 if you have the PCF8574A use I2C addres 0x38.
Logged

   

Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

It still does not work. See No text. Both KS0070B (LCD 16x2) and HD44780 (LCD 40x4).

2 comes with 40x4 LCD cursor, the blinking cursor right.

Pull-ups resistors is 4.7 K.
I use PCF8574P. A0, A1 and A2 to GND as shown in the diagram. 0x20

EA W404B-NLW LCD 40x4 (HD44780)
Logged


Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It still does not work.

You probably want to better inform your readers what "it" you were referring to. Having the latest code + schematic would be helpful.

It looks like your lcd is not initialized properly. I would focus on that.

As to the i2c address, given that it is 7-bit, different systems have a different way of representing it. Some would for example write the address as 0x40 (to simply OR or AND the i2c_read / i2c_write bit). Others use 0x20 and then left shift 1 bit first. You may want to read your lcd library to see which notation they use.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I discovered there are two different libraries available for the I2C LCD with a PCF8574.

The first is the one Mario H. uses as well and looks like this:


The second is used by DFRobot and other suppliers:


The lower and higher nibble are swapped on the display pins...
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The lower and higher nibble are swapped on the display pins...
That's why a statement such as this is used.  You have to use your pin numbers, in the proper order, inside the parentheses.

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE );

This would be easier to do if there were appropriate comments preceding and following the statement.

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here



Don

Edit:  I hope they both have fixed their backlight circuits by now. 
« Last Edit: October 05, 2012, 09:26:38 am by floresta » Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I hope they both have fixed their backlight circuits by now.

It actually will work for switching purposes. It just isn't optimal.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Won't it work even better with the transistor wired in correctly?

Don
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Won't it work even better with the transistor wired in correctly?

It would have worked considerably better for linear applications.

It also works better for switching applications but not terribly much.
Logged

Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I discovered there are two different libraries available for the I2C LCD with a PCF8574.

The second is used by DFRobot and other suppliers:


The lower and higher nibble are swapped on the display pins...

I use this and it works!

Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still have problems with that transistor.

Don

Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 40
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I still have problems with that transistor.

Don


+1
Logged

   

Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I still have problems with that transistor.

Don



I use PNP Transistor BC557. 10 Ohm between Emitter (BC557) and LED+. 1K between P3 (PCF8574P) and Base (BC557).

For Arduino and LCD (without PCF8574P), i use NPN Transistor BC547.
Logged


Pages: [1] 2   Go Up
Jump to: