Dislay not working correct... need some help..

Need some help with my display…
Im trying to use Arduino UNO with I2C bus to control a 2x20 display, but the display doesnt work the correct way. Its displaying ‘something’ but it makes no sence, something is wrong… and i need some help to figure this one out, as im not so good programmer.

I tested the display directly from the arduino and it worked
but after including the PCF8574 chip things got strange. I seems like the display is receiving information, but doesnt handle it correct so its just joking around.

The code for the display is 0x20, and seems to be correct

The here is the datasheet for the display

I have tried more I2c display examples… but they keep coming up the same whay, just someting that makes no sence in the display…

the display driver is Controller / Driver : KS0066
but the display seems compatible with the HD44780U, as i see on page 14

so im a little bit out of ideas… can anyone help ?

I use no pullup resistors, as i read the arduino uno has it built it, but i tried it anyway… but no change.
Is it possible that the library needs to be changed to fit to the display, if so… i have no idea how to fix that…
or do i need to use pull up resistors on the 4 wires between the PCF8574 and the display…?

here is the code:

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

LiquidCrystal_I2C lcd(0x20); // Set the LCD I2C address

#define BACKLIGHT_PIN 13

// Creat a set of new characters
const uint8_t charBitmap[8] = {
{ 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
{ 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
{ 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
{ 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
{ 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
{ 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
{ 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
{ 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }

};

void setup()
{
int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));

// Switch on the backlight
pinMode ( BACKLIGHT_PIN, OUTPUT );
digitalWrite ( BACKLIGHT_PIN, HIGH );

lcd.begin(20,2); // initialize the lcd

for ( int i = 0; i < charBitmapSize; i++ )
{
lcd.createChar ( i, (uint8_t *)charBitmap );

  • }*
  • lcd.home (); // go home*
  • lcd.print("Hello, ARDUINO "); *
  • lcd.setCursor ( 0, 1 ); // go to the next line*
  • lcd.print (" FORUM - fm ");*
  • delay ( 1000 );*
    }
    void loop()
    {
  • lcd.home ();*
  • // Do a little animation by writing to the same location*
  • for ( int i = 0; i < 2; i++ )*
  • {*
  • for ( int j = 0; j < 16; j++ )*
  • {*
  • lcd.print (char(random(7)));*
  • }*
  • lcd.setCursor ( 0, 1 );*
  • }*
  • delay (200);*
    }[/quote]

Its displaying 'something' but it makes no sence, something is wrong...

I seems like the display is receiving information, but doesnt handle it correct so its just joking around.

Something that makes no sense to you may make some sense to someone else. What you should do in this case is document exactly what you expect to be displayed followed by exactly what you do see displayed. You should also determine if the incorrect display is always the same or if it differs each time you try.

I tested the display directly from the arduino and it worked

By this I guess you tried something like the 'Hello World' tutorial. That was a very good troubleshooting technique. It verifies that your display is good and that you also know what you are doing.

The code for the display is 0x20, and seems to be correct

I think you are referring to the 'slave address' for the PCF8574 and this does seem to be correct.

the display seems compatible with the HD44780U

It is. You verified this when you tested the display directly.

I use no pullup resistors, as i read the arduino uno has it built it, but i tried it anyway.

You definitely need pull-up resistors. What size did you use when you tried it?

here is the code:

I know that this is a 'standard' program supplied with one of the tutorials and in my estimation it is a horrible choice for an initial program (as is the Arduino version of 'Hello World'). In my opinion a first program should involve using static information on both lines of the display so you can tell what is going on. Try deleting everything in loop() and see what happens.

void loop()
  {
  }

Don

or do i need to use pull up resistors on the 4 wires between the PCF8574 and the display

I just spotted this part. I hope you meant 6 wires. They do not require pull-ups.

Don

You definitely need pull-up resistors. What size did you use when you tried it?

Well, maybe not. You do need pull-ups (on the two I2C lines) but I am reading that the wire library enables the built in ones.

Don

So i tried it all over agian, ripped all wiers off and started over... connected the display directly to the arduino from this tutorial http://www.ladyada.net/learn/lcd/charlcd.html and everything works great But not when i include the PCF8574 im connecting according to this setup http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/

Here is an example what the display shows: http://bildr.no/view/1042825

Iv treid with 10k and 3k3 pullup resistors on the datalines between the display and PCF8574... no change.

i tried to pull out one of the pins E, R/W, Rs.. then the display freezes but continue when i put the wire back.

I also made a test with the PCF8574 chip on the free pin, nr 12, and put a led there. so i can see that the I2C bus works correct and it does.

So the problem has to be between the PCF8574 and the display... either the chip doesnt send out the correct data or the display cant read what it sends..

uhh... its annoying when things like this happens...

any ideas ??

Isnt the display getting initilized correct or is it receiving data with mistakes in it... just wondering

im connecting according to this setup http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/

I could find no information about how to connect the LCD module to the PCF8574 at that link.

Iv treid with 10k and 3k3 pullup resistors on the datalines between the display and PCF8574... no change.

You do not need pull-up resistors on those lines (but they probably will not cause any problems).

i tried to pull out one of the pins E, R/W, Rs.. then the display freezes but continue when i put the wire back.

Are you sure that the R/W line is correctly implemented in the library? I'm not fluent in 'C' but my cursory inspection says no. Try disconnecting the R/W line (LCD pin 5) from the PCF8574 and connect it instead to GND and see what happens.

So the problem has to be between the PCF8574 and the display... either the chip doesnt send out the correct data or the display cant read what it sends..

Agreed.

Don

So i gave up.. =( I will try with another display later when i will get my hands on one.. i think it has to be something with it that makes it not be compatible with the expander chip... so the display is hocked up the normal way now. and i use the expander to control some digital outputs instead..

anyway thanx for effort !!

Try disconnecting the R/W line (LCD pin 5) from the PCF8574 and connect it instead to GND and see what happens.

Did you try this?

Don

yes yes.. it didnt change things to the better.. :disappointed_relieved: