Go Down

Topic: 4x20 LCD I2C Adapter - 1st 4 char of line4 repeated over last 4 char of line2 (Read 2477 times) previous topic - next topic

OldSalt1945


Quote
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
Always keep the shower curtain INSIDE the tub.

floresta

Quote
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

raschemmel

Quote
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:
Code: [Select]
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.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

OldSalt1945


Quote
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
Always keep the shower curtain INSIDE the tub.

raschemmel

If they weren't so cheap you could send it back to the vendor but that would cost more than it costs.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

OldSalt1945


Quote

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
Always keep the shower curtain INSIDE the tub.

raschemmel

Now I know who to go to when I need a good excuse for something....
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

floresta

Quote
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.


Quote
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

OldSalt1945



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

Don

Code: [Select]

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
Always keep the shower curtain INSIDE the tub.

Rokkit

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



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:
Code: [Select]
#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:
Code: [Select]

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
"Every day is a good day, some are just gooder than others."   D. Fowler

OldSalt1945


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


Thanks Rokkit.  That pretty well drives the final nail in my LCD's coffin.

The very first 4x20 LCD I ever bought turned out to be wierdly bad.  Whodda thunkit?

Case closed.
Always keep the shower curtain INSIDE the tub.

OldSalt1945

I finally got the replacement LCD Display.
It works perfectly.
Case closed.

Thanks for all the help, guys.

John
Always keep the shower curtain INSIDE the tub.

raschemmel

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

MAS3

Always see the sunny side:

Didn't you learn a great deal with this ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

OldSalt1945

Yes, I did.   :)

On the other hand, look at all the trouble I caused for a lot of people over bad hardware. :0

There is no gravity.  The world sucks.  :P

But I know all about LCD's now ---- well, sort of.

John
Always keep the shower curtain INSIDE the tub.

Go Up