LCD displays black boxes!!!!


Closed Thread
Results 1 to 4 of 4
  1. #1
    pt3rg's Avatar
    pt3rg Guest

    Angry LCD displays black boxes!!!!

    I've connected a Hitachi 44780 LCD to a 16F84 exactly the same way as shown in the manual's page 94(pdf version).

    This is my program:
    DEFINE LCD_DREG PORTA
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 3
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2

    TRISB.0 = 0
    PAUSE 2000
    LOOP:
    LCDOUT $FE,1,"hello"
    PORTB.0 = 1 'LED on
    PAUSE 500
    LCDOUT $FE,1
    PORTB.0 = 0 'LED off
    PAUSE 500
    GOTO LOOP
    END


    When i tested it, the LED blinks but the LCD displays black boxes instead of "hello". HELP!!!! I've been trying to solve this problem for weeks!!!!! btw, i'm using PBP v2.40

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Some suggestions...

    1. Have you remembered the pull-up Resistor on RA4? On any other pin you can dispose with it, but if you use RA4 then it's gotta be there.

    2. You sure you haven't got anything miss-wired? RA0 goes to DB4... easy to mistake and connect it to DB0... RS-bit and E-bit are easily cross-connected to the wrong pins...

    3. Is your contrast set so dark that everything is blacked-out?

    Melanie

  3. #3
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Talking

    Number 1 trap for young players... Read page 189

    For 4-bit interface data, only four bus lines (DB4 to DB7) are used for transfer.

    Bus lines DB0 to DB3 are disabled.

    So connect the Pic to DB4 to DB7, and recode your program,

    DEFINE LCD_DBIT 4 'Use DB4 DB5 DB6 DB7


    See how you go.



    J

  4. #4
    pt3rg's Avatar
    pt3rg Guest


    Did you find this post helpful? Yes | No

    Default

    Originally posted by Melanie
    Some suggestions...

    1. Have you remembered the pull-up Resistor on RA4? On any other pin you can dispose with it, but if you use RA4 then it's gotta be there.
    Oh yes.... definitely

    2. You sure you haven't got anything miss-wired? RA0 goes to DB4... easy to mistake and connect it to DB0... RS-bit and E-bit are easily cross-connected to the wrong pins...
    Checked it many times. The connections are correct.

    3. Is your contrast set so dark that everything is blacked-out?
    When i turned the pot from one extreme to the other, the display changes from nothing to ........you've gussed it!!! black boxes......
    Originally posted by Squibcakes
    Number 1 trap for young players... Read page 189

    For 4-bit interface data, only four bus lines (DB4 to DB7) are used for transfer.

    Bus lines DB0 to DB3 are disabled.

    So connect the Pic to DB4 to DB7, and recode your program,

    DEFINE LCD_DBIT 4 'Use DB4 DB5 DB6 DB7


    See how you go.



    J
    Changed it. Nothing is displayed on the LCD. If i put
    DEFINE LCD_DBIT 0 , then black boxes reappear.

Similar Threads

  1. lcd stops after about 5 minutes and gets stuck
    By robertpeach in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th September 2009, 12:03
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts