lcd won't work with library

hello i'm a first timer and green horn here (hey my freetronics ethermega and lcd sheild only turned up 2 days ago) i know absolutley nothing about these things except i've seen guys programing plc's at work and thought hey thats cool so i got into this,the only thing i have going for me is i learn fast, but what im getting at is any solutions will have to be explained pretty simply please? any way i bought a ethermega bought a lcd shield because it said this ''SKU 321'' and this ''Blue Backlight with white words It uses HD44780 controller, uses 4 Bit Arduino LCD Library'' i figured out how to load sketches (i even managed to make an led blink on pin 13 wowee) so next i fit my shield and and load the blink out of the lcd library and..................... nothing, well the top display line came up in solid blocks and thats all i get can anyone help me? if someone tells me how i'll paste a link to the lcd sheild i got.

wrxsti:
hello i'm a first timer and green horn here (hey my freetronics ethermega and lcd sheild only turned up 2 days ago) i know absolutley nothing about these things except i've seen guys programing plc's at work and thought hey thats cool so i got into this,the only thing i have going for me is i learn fast, but what im getting at is any solutions will have to be explained pretty simply please? any way i bought a ethermega bought a lcd shield because it said this ''SKU 321'' and this ''Blue Backlight with white words It uses HD44780 controller, uses 4 Bit Arduino LCD Library'' i figured out how to load sketches (i even managed to make an led blink on pin 13 wowee) so next i fit my shield and and load the blink out of the lcd library and..................... nothing, well the top display line came up in solid blocks and thats all i get can anyone help me? if someone tells me how i'll paste a link to the lcd sheild i got.

imsorrybuticantfigureoutwhatyouaresayingorwhatyouareaskingtrybreakingthatdownintocoherentsentencesyoucouldalsotrygoogleDon

Since you've seen people programming PLC (I've not), I suppose one can't program it without looking at how it is connected to the display and what program to load. You are putting anyone trying to help in that situation, no program to read, no pic to see how things are connected, no way to help. Plus, fix your comma and period keys on your keyboard!
The first thing in asking a question is to provide enough clues to the receiver so the question can be answered without consulting with crystal balls. This is regardless whether you are asking a question as a teacher to a student or the other way around. For "the other way around", you want to provide all details you can since you are not the one with the answer :wink:

HexHammer:
'nothing, well the top display line came up in solid blocks and thats all i get'

Hi there, I got that first time as well. Try swapping round the two control pins, the data pins are probably correct or you'd get weird stuff scrolling across the display.
I pretty soon discovered its easy to mix up the connections even after breading up a LCD and Uno a few times...

LCDs for the beginners...

Black blocks means control pins are wrong. Swap them round and leave the data pins alone.

Nothing at all means power and or contrast arent done properly. You NEED that 10K pot mentioned in the docs, it wont work properly and will have a short lifespan without it.

Weird characters scrolling across the top line means the control pins are correct but the data pins are reversed (1-4,2-3,3-2 and 4-1)

Weird characters that dont move, or flash and disappear during writing means the data pins are not all in the correct order (some may be)

Constantly writing the same thing to the display faster than 50x a second can 'blank' half the display as only the first few characters stay onscreen long enough for the eye to pick them up before the display banks during writing. Write to the display only when you need to change it, it has memory to store your data and doesnt need refreshing.

Hey Doc - it's all right here so I guess they won't need our input any more.

Don

Hope the OP finds the right way...

Don,

Just random thought, I emulate these displays on PC. Fairly straight forward, I rewrite a LiquidCrystal class and it writes to a command prompt like all windows console programs do and pretend it were a real LCD (well it IS displayed on my computer LCD :slight_smile: ) So maybe it's easier to emulate them as beginners before actually connecting up wires?

Too bad the basic Arduino serial monitor doesn't have cursor control. Otherwise I could port my emulator to Arduino serial monitor and newbies can play with "LCDs" all day long without connecting up a single wire. Instant gratification! But then if they encounter problem in actually wiring LCDs, we know their code is already solid from the emulation, half problem solved, no need to sing the "post the code" song. Have you read that post, hilarious :wink:

I'll think of something to solve "post the code" problem. I might just create a Processing window to do that, if I still remember how that was done before or I will only try to address windows users.

... we know their code is already solid from the emulation, half problem solved,...

Maybe. If they are using a library how do we know that their actual wiring matches what they have 'told' the library without seeing their code. If they are writing their own code can the emulator deal with checking the setup and hold times, the enable pulse width, and the required delays?

Have you read that post, hilarious

I assume you mean the one by HexHammer. It would be funny except that some beginners might actually think it is helpful when the fact is that all but one of his suggestions is absolutely wrong. The first sentence of the one about power and contrast is correct.

Don

sorry about the lack of detail team.

as to the wiring the lcd is a shield so the wiring is limited to where the pins go so theoreticaly it should be right. or is it possible that the lcd and the ethermega are not compatible?

if not can anyone help me with what changes i should make?
can i do this in the sketch or do i have to get a soldering iron out?

here is the code.................

LiquidCrystal Library - Blink

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD and makes the
cursor block blink.

The circuit:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}

void loop() {
// Turn off the blinking cursor:
lcd.noBlink();
delay(3000);
// Turn on the blinking cursor:
lcd.blink();
delay(3000);
}

OK where is the link to that possibly-incompatible LCD shield? and the ether-arduino? A few dozen LCD shields exists. We don't all have all these so you have to provide these. I have a few shields but pretty sure they are not what you have.

Also - go back and remove the color tags that you used to set off your code. Then use the 'Code' button (#) instead of 'Change Color'. When your eyes get as old as mine you will find out why this is necessary.

Don

here is the link it's not real informative but see what you think

and here in the code in black

/*
LiquidCrystal Library - Blink

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD and makes the
cursor block blink.

The circuit:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}

void loop() {
// Turn off the blinking cursor:
lcd.noBlink();
delay(3000);
// Turn on the blinking cursor:
lcd.blink();
delay(3000);
}

That link wasn't really helpful. No tech spec, and no identifiable mark of the maker of the shield. And the shield is mighty expensive (just looked at exchange rates). I would rather but from places that have a manual. Without a tech spec, the shield is pretty dead weight. I plan to convince some admin on the forum to have a "beginner's tool/part list" stick to the forum. See if you have at least number 5 on the list to get started with some electronic forensics:

That looks just like the DFRobot LCD shield (Arduino_LCD_KeyPad_Shield__SKU__DFR0009_-DFRobot).

In that case you you would need to use:

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

And the backlight would be controlled by digital pin 10. There's a complete sketch at that link as well. Do not even try the first one, the LCD4Bit library and it's derivatives are obsolete and poorly written (just read the comments if you don't believe me).

Don

floresta:
That looks just like the DFRobot LCD shield (Arduino_LCD_KeyPad_Shield__SKU__DFR0009_-DFRobot).

In that case you you would need to use:

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);




And the backlight would be controlled by digital pin 10. There's a complete sketch at that link as well.

Don

OP, please give that a try.

I agree they look alike on the surface. Hope what's under the hood are the same. One has DFRobot on it and the other doesn't. There is a reason I haven't released my phi-2 shield design EAGLE files yet, some will take them, make a whole bunch and dump to the market, no support, nothing. That is, in my opinion, working against open source hardware intents.

I agree they look alike on the surface. Hope what's under the hood are the same. One has DFRobot on it and the other doesn't.

If the counterfeiters were worried about being sued for their practices they might have changed the board layout and some of the pin connections but I doubt that is the case. They probably just copied the board layout and stuffed it with less expensive components and/or had it assembled by workers in a lower pay grade.

Don

floresta:

I agree they look alike on the surface. Hope what's under the hood are the same. One has DFRobot on it and the other doesn't.

If the counterfeiters were worried about being sued for their practices they might have changed the board layout and some of the pin connections but I doubt that is the case. They probably just copied the board layout and stuffed it with less expensive components and/or had it assembled by workers in a lower pay grade.

Don

Excellent points! That indicates to me open source hardware only works best when we have a more consistent pay for same skills across the globe.

If the counterfeiters were worried about being sued for their practices they might have changed the board layout and some of the pin connections but I doubt that is the case.

This just reminded me of an experience we had with some of our first IBM PC clones. It's been almost 30 years so I don't remember all of the details but I do remember that we started out with two genuine IBM PC XTs and we expanded with clones that we assembled ourselves. The motherboards looked identical but we had one program involving the timer and/or speaker that worked on the genuine IBMs but not on the clones. We eventually found one PC trace that was broken or missing on the clone board. The boards were otherwise identical and it looks like the clones were manufactured on the same assembly line. The clones could have been a midnight project by some rogue employees or just a rip-off by the subcontractor.

By the way, we got into the clone construction mostly because of IBM's greed. Our PCs were purchased on 'state contract' and New York, in it's infinite wisdom, purchased the computers without any warranty. One of our hard drive controllers failed shortly after we got the machine and IBM wanted an outrageous price for a replacement. We found an ad in Computer Shopper for a controller and hard drive at a lower price than IBM wanted for the controller alone. When the parts arrived we found that the controller boards were absolutely identical. That's when we decided to build our own computers and we never did buy another genuine IBM machine. Things might have been different if the motherboard experience had preceded the hard drive experience.

Don

Very good story! I wonder what Xerox was thinking when giving out its GUI operating system for Jobs to steal and how sorry they feel about it.

And the backlight would be controlled by digital pin 10.

But don't try to use it. I forgot about the problem that Bill found: (http://arduino.cc/forum/index.php/topic,77120.90.html and http://arduino.cc/forum/index.php/topic,96747.0.html)

Don