Connect with us

Stuck with LCD Display and Black Blocks

Discussion in 'General Electronics Discussion' started by leeb_965, Oct 24, 2012.

  1. leeb_965

    leeb_965

    34
    0
    Feb 5, 2012
    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?
     
  2. BobK

    BobK

    7,599
    1,641
    Jan 5, 2010
    Just putting the data on the D lines does not initialize the LCD. You have to set all of the three control pins as follows:

    RS - connected to ground to send a command.
    RW - connected to ground to write
    E - must be strobed to issue the command (i.e. low to high then low again).

    If you are getting blocks across the screen, the LCD has not been initialized.

    Bob
     
  3. leeb_965

    leeb_965

    34
    0
    Feb 5, 2012
    I tried it with an arduino using the 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);
    }

    Enable and RS are connected to the arduino input ports and RW to ground.
    But the same Black Blocks are there.
     
  4. BobK

    BobK

    7,599
    1,641
    Jan 5, 2010
    When I have used LCDs, the init sequence was much more complicated than one command, but that might be due to using the 4-bit instead of 8-bit interface.

    If i recall, you also have to wait a good long time after powering up before issuing a command, something like 10ms.

    Bob
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-