4x20 LCD I2C Adapter - 1st 4 char of line4 repeated over last 4 char of line2

John,
Where did you get your lcd Constructor ?

 LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

The reason I ask is that in your other post you said you used this constructor and it worked with fm's library:

 LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7);

You said you downloaded the Guessor but never said anything about actually running it or about the backlight blinking 3 times so I am wondering if you ever ran it and what happened ? (and why the difference in constructors)

OK, Don. I moved it back to Setup. If I want to see it repeat, I can always hit the reset button.

I ran the sketch you provided and it printed line 1,
then line 3,
then line 2 with the last 4 characters also printing to line 4,
then line 4 with the first 4 characters also printing over the last 4 of line 2.

Line 2 now reads WXYZ****_\abcdefklmn (I put * for symbols I couldn't find on the keyboard)

Line 4 now reads klmnopqrstuvwxyz{|}* "

1945 means I am 1 thousand nine hundred and forty-five years old. I started programming computers when I was 3. I win!!!! :smiley: Unfortunately, I forgot everything and am having to start over. My first program was written in Autocoder on an IBM 1403. It had 4K of core RAM built in and a 16K add-on core memory. The computer was the size of 3 or 4 refrigerators bolted together. The 16K core memory unit was about 24" x 24" x 24". It generated enough heat that we warmed our pies (from the cafeteria) in it. 80-column punch cards and tape drives. Who could afford hard disk drives?

John

If the computers keep shrinking you'll need a microscope...

I ran the sketch you provided and it printed line 1,
then line 3,
then line 2 with the last 4 characters also printing to line 4,
then line 4 with the first 4 characters also printing over the last 4 of line 2.

This seems to point toward the LCD module itself. Are your old eyes good enough to do some de-soldering?

1945 means I am 1 thousand nine hundred and forty-five years old. I win!!!!

Using that reasoning you would indeed win.

My first program was written in Autocoder on an IBM 1403.

Wasn't that a printer?

I vaguely remember using a 1620 and paper tape.

Don

If the computers keep shrinking you'll need a microscope...

I can't speak for John but I already need one for most everything.

Don

raschemmel:
John,
Where did you get your lcd Constructor ?

 LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

The reason I ask is that in your other post you said you used this constructor and it worked with fm's library:

 LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7);

You said you downloaded the Guessor but never said anything about actually running it or about the backlight blinking 3 times so I am wondering if you ever ran it and what happened ? (and why the difference in constructors)

I had hardwired the I2C and LCD to use Arduino pin D13 to turn on the backlight because I didn't know any better way to do it.

Bill (bperrybap) helped me to do it right. The "LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); " worked perfectly and I removed the hack to D13.

John

floresta:

I ran the sketch you provided and it printed line 1,
then line 3,
then line 2 with the last 4 characters also printing to line 4,
then line 4 with the first 4 characters also printing over the last 4 of line 2.

This seems to point toward the LCD module itself. Are your old eyes good enough to do some de-soldering?

1945 means I am 1 thousand nine hundred and forty-five years old. I win!!!!

Using that reasoning you would indeed win.

My first program was written in Autocoder on an IBM 1403.

Wasn't that a printer?

I vaguely remember using a 1620 and paper tape.

Don

I'll send the LCD back to the ebay vendor. Or just not use those areas. They are cheap, I'll get a few more, test them and send back duds.

You're right. 1403 printer (600 lines per minute). The computer was a 1401.
I had to write a couple of programs for the 1620 for a course at Purdue.
I also had to wire up boards with patch cables for an accounting machine, a 402, I think. Later, I worked for a couple of companies that were actually using the old beasts for production jobs.

Don't tell anyone that I gave Brutus the knife.

John

John,
Have you tried running Rokkit's code from Reply#9 of your other post ?
Robert

you said you downloaded the Guessor but never said anything about actually running it or about the backlight blinking 3 times so I am wondering if you ever ran it and what happened ? (

Did you ever run the Guesser ? Did the backlight blink 3 times ?
Did it display the same constructor you are using ?

raschemmel:
John,
Have you tried running Rokkit's code from Reply#9 of your other post ?
Robert

It works perfectly, except for the last 4 characters of line 2. Of course, they are repeated on the first 4 characters of line 4.

Damn blasted display. Grrrrrrrrr.

John

raschemmel:

you said you downloaded the Guessor but never said anything about actually running it or about the backlight blinking 3 times so I am wondering if you ever ran it and what happened ? (

Did you ever run the Guesser ? Did the backlight blink 3 times ?
Did it display the same constructor you are using ?

Yes. The constructor was the problem in the other posting. Once that was solved, I initiated this posting.

I tried your garage sketch. I can't get it to work because you are using a hard-coded backlight on Arduino pin D9 and I'm too tired to fool with it now. Maybe tomorrow.

Gotta order some replacement LCD's for this P.O.S. one.

John

It works perfectly, except for the last 4 characters of line 2. Of course, they are repeated on the first 4 characters of line 4.

Those eight locations use sequential memory addresses 0x50 - 0x57 which may be some sort of clue.

Don

I can't get it to work because you are using a hard-coded backlight on Arduino pin D9

That's actually not the backlight driver pin. That was a poor choice of names for the push button that tells the program to turn on the backlight and start the 10 second count down. If you replaced the constructor it should work. The two buttons have 10k pullup resistors on the side connected to the arduino and 1 k pulldown resistors to GND on the other side of the switch so when you pressthe button it pulls the signal down without actually shorting it to ground. The author of the program chose the name "blpin" because that button will turn the backlight ON (indirectly) when you press it but he did not foresee it being misinterpreted in the future to be an actual backlight driver pin, (a pin driving a transistor through a resistor that supplies power to the backlight through the transistor). The person who wrote that program had the criteria that the BACKLIGHT BE OFF UNTIL you press the "blpin" and then turn on and start the count down timer. The "blpin" is nothing more than a signal to the arduino to turn on the backlight and start the timer. At the time I downloaded the program from a forum post, I did so because I wanted the delay code example and never even looked at the variable names. You are the first person to notice the name and misinterpret it to be a backlight driver output pin when it is actually an INPUT pin. Look at the setup statement:
pinMode(blpin, INPUT_PULLUP);           // Bryter til backlight

The word "Bryter" is German because the author of the program was German. I don't even know what it means. But I do know that the "pinMode" statement is an INPUT statement which means it couldn't possibly be a backlight driver as you thought.

floresta:

It works perfectly, except for the last 4 characters of line 2. Of course, they are repeated on the first 4 characters of line 4.

Those eight locations use sequential memory addresses 0x50 - 0x57 which may be some sort of clue.

Don

Unfortunately, my level of experience doesn't equip me to make use of the clue.

I have never programmed an LCD display before, so I don't know what to expect. For instance, is it supposed to wrap from the 1st line to the 3rd, then 2nd, then 4th?

I ordered a couple from a different vendor, but they won't be here until near the end of March, so I don't have anything to compare to.

I am having a hard time believing it is hardware. Seems unlikely that the manufacturer would never have tested one of them and the fault is soooooo obvious.

John

If they weren't so cheap you could send it back to the vendor but that would cost more than it costs.

raschemmel:

The word "Bryter" is German because the author of the program was German. I don't even know what it means. But I do know that the "pinMode" statement is an INPUT statement which means it couldn't possibly be a backlight driver as you thought.

I was tired, so I wasn't paying much attention. My other excuse is that I've only been fooling around with this Arduino stuff for a couple of weeks, so I miss a lot that others would see instantly. I'm still plagued with missing ";" . I'm sure I typed them. They just fell off the screen. They are starting to clog up the 1st row of keys.

John

Now I know who to go to when I need a good excuse for something....

I have never programmed an LCD display before, so I don't know what to expect. For instance, is it supposed to wrap from the 1st line to the 3rd, then 2nd, then 4th?

Unfortunately the answer is yes.

This behavoir is due to the fact that the same controller is used for all LCD display configurations. For a complete explanation follow the LCD Addressing link at http://web.alfredstate.edu/weimandn.

I am having a hard time believing it is hardware. Seems unlikely that the manufacturer would never have tested one of them and the fault is soooooo obvious

If 'it' is referring to the duplicate display problem that you are having - this is not due to a design deficiency in the hardware it is more likely a problem in your particular pc board. The manufacturer would have to test every board to catch your problem.

If 'it' is referring to the interlaced rows - I have explained the situation above. This has been 'fixed' by at least one manufacturer that I know of (New Haven Displays), but their controllers are therefore no longer completely HD44780U compatible which is a problem for some Arduino users.

Don

floresta:
Those eight locations use sequential memory addresses 0x50 - 0x57 which may be some sort of clue.

Don

0x50 = 01010000
0x51 = 01010001
0x52 = 01010010
0x53 = 01010011
0x54 = 01010100
0x55 = 01010101
0x56 = 01010110
0x57 = 01010111

Bit 2 (value 0x04) fail to change state from 0 to 1, but, apparently only for an address beginning with value 5 in the first nibble. I know this because the rest of the characters displayed are proper.

(Update): That is not exactly right. When addresses 0x50-0x53 are printed, they ALSO appear at 0x54-0x57. When 0x54-0x57 print, they ALSO appear at 0x50-0x53. (End Update).

What a screwy deal. If it was from Japan, I might suspect payback for Hiroshima, but it was likely made in China (isn't everything?).

John

I loaded your sketch (below) and the display worked properly - see picture.

OldSalt1945:
The first 4 characters of line 4 overlays the last 4 characters of line 2 on my 4x20 LCD display with I2C adapter.
Arduino Uno R3 2012. Using fm's New LiquidCrystal library.

Simple test program:

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

void setup()
{
 lcd.begin(20,4);               // initialize the lcd
}

void loop()
{
  lcd.home();
  lcd.clear();
  lcd.print("Line2GoofedUpExample");
  lcd.setCursor ( 0,1);
  lcd.print("ThisIsTheSecondLine2");
  lcd.setCursor (0,2);
  lcd.print("ThisIsTheThirdLine33");
  lcd.setCursor(0,3);
  lcd.print("LastLineFirst4Repeat");  
 
  delay (2000);
}




This displays:


Line2GoofedUpExample
ThisIsTheSecondLLast
ThisTheThirdLine33
LastLineFirst4Repeat




No matter what I print in the 4th line, the 1st 4 characters overlay the contents of the last 4 characters of the 2nd line.

I tried this with 3 different I2C adapters from 2 different sources. I only have the one 4x20 LCD.

Anyone heard of this before? 
Got any ideas for something I can try?

John