Stuck with LCD Display and Black Blocks

Thread Starter

hunterage2000

Joined May 2, 2010
487
I have been trying to get this LCD Display to work but I get a row of Black squares when I power it up. I have followed http://iamsuhasm.wordpress.com/tutsproj/using-lcds/

I havnt used the switches for the enable or data inputs I have just directy wired D7-4 to GND and D3-0 to +5VDC to the LCD to initialize it. Apparently the blocks are because of the contrast setting but I have tried values from 50 ohms (very high contrast) to 1000 Ohms (Very faint contrast) and nothing happens. Im expecting a block to the far left to blink on and off.

Also I think the LED Backlight doesnt work. I have tried using a 100 ohm resistor between the +5VDC line and the +backlight pin but nothing seems to happen, just the blocks.

Can anyone suggest and ideas why this is happening and what I can do to fix it?
 

BMorse

Joined Sep 26, 2009
2,675
You can not initialize an LCD that way, you have to send it commands to tell it what it is, (2 Line x 16 chars, 4 Bit mode, etc....).

Connecting a 100 Ohm resistor to the backlight probably fried the LED's, you should have tried a higher one for 5 volts, typical value would have been a 330 Ohm, unless of course it is an EL back light, then you would need an Inverter driver to power it.
 

Thread Starter

hunterage2000

Joined May 2, 2010
487
It worked for the guy in the link, I also tried this with an arduino and this code:

Rich (BB code):
#include <LiquidCrystal.h>
// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Create an lcd object and assign the pins
void setup() {
lcd.begin(16, 2); // Set the display to 16 columns and 2 rows
}
void loop() {
// Run the seven demo routines
basicPrintDemo();
}
void basicPrintDemo() {
lcd.clear(); // Clear the display
lcd.print("Basic Print"); // Print some text
delay(2000);
}
and in the arduino book it used a 10k res with the constrast and a 220 res with the backlight to get the same row of black blocks. The voltage out of the arduino is about 4.63V.

Is there a way I can test if the LED is fried? Also any suggestions on why the code didnt work
 

BMorse

Joined Sep 26, 2009
2,675
It worked for the guy in the link, I also tried this with an arduino and this code:

Rich (BB code):
#include <LiquidCrystal.h>
// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Create an lcd object and assign the pins
void setup() {
lcd.begin(16, 2); // Set the display to 16 columns and 2 rows
}
void loop() {
// Run the seven demo routines
basicPrintDemo();
}
void basicPrintDemo() {
lcd.clear(); // Clear the display
lcd.print("Basic Print"); // Print some text
delay(2000);
}
and in the arduino book it used a 10k res with the constrast and a 220 res with the backlight to get the same row of black blocks. The voltage out of the arduino is about 4.63V.

Is there a way I can test if the LED is fried? Also any suggestions on why the code didnt work

I doubt what you did would work for the guy in the tutorial since you did not follow his instructions, he had wired the switches to emulate a controller writing the commands to the LCD, you have not done this so it will not work the way he was showing.

As for the code, where is the main subroutine that calls the setup routine.
 
Top