help with 4 x 20 LCD


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: help with 4 x 20 LCD

    Quote Originally Posted by mpgmike View Post
    Each line has its own address in the HD44780.

    Line 1 = $80
    Line 2 = $C0
    Line 3 = $90
    Line 4 = $D0

    You would need RS = 0 to send a command and send your line address, then RS = 1 and send the string.
    I'm sorry. I'm not following. I think I understand how to move the cursor around. But what is RS? The register select bit? I'm not getting it to display anything even on lines 1 and 2. What would you do differently here to get it to display "hello" on line 1 and then "world" on line 2?
    Code:
    Lcdout $fe, 1   ' Clear screen   
         Pause 500       ' Wait .5 second   
         Lcdout "Hello"  ' Display "Hello"   
         Pause 500       ' Wait .5 second   
         Lcdout $fe, $c0, "World" ' Move to line 2  and display "World"   
         Pause 500       ' Wait .5 second

  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: help with 4 x 20 LCD

    Quote Originally Posted by keithv View Post
    I'm sorry. I'm not following. I think I understand how to move the cursor around. But what is RS? The register select bit? I'm not getting it to display anything even on lines 1 and 2. What would you do differently here to get it to display "hello" on line 1 and then "world" on line 2?
    Code:
    Lcdout $fe, 1   ' Clear screen   
         Pause 500       ' Wait .5 second   
         Lcdout "Hello"  ' Display "Hello"   
         Pause 500       ' Wait .5 second   
         Lcdout $fe, $c0, "World" ' Move to line 2  and display "World"   
         Pause 500       ' Wait .5 second
    You forgot to designate the line one position

    Code:
    LCDOUT  $FE,1
    lcdout  $FE,$80,"Hello"
    pause 500
    lcdout  $FE,$C0,"World"
    pause 500

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: help with 4 x 20 LCD

    LCDOUT $FE,1
    lcdout $FE,$80,"Hello"
    the $FE,$80 is tolally unnecessary , the $FE,1 not only clears the screen it homes the cursor to
    line 1 pos 0 too

    LCDOUT $FE,1:FLAGS=0:PAUSE 250:LCDOUT $FE,1:PAUSE 250 ' Initialize LCD
    is a waste of code space and indicates that the power on lcd wait may be too short



    Pause xxx ' Wait for LCD to start up
    LCDOUT $FE,1

    is adequate , I have had displays that need the pause xxx to be as long as 500mS


    its also possible that the default config settings in your pic16f887.inc file don't match your setup

    can you blink a led at defined rate correctly ?
    Last edited by richard; - 22nd February 2018 at 23:23.
    Warning I'm not a teacher

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: help with 4 x 20 LCD

    Quote Originally Posted by richard View Post

    its also possible that the default config settings in your pic16f887.inc file don't match your setup

    can you blink a led at defined rate correctly ?
    I added the address for good measure. No luck. I increased the start up wait time. No luck still. I added a blinking LED and that works - on for half a second, off for 1 second. Stuff highlighted in RED is what was added/changed.

    Code:
    TRISB = %00000000
    pause 500
    mainloop:   
         Lcdout $fe, 1                                 ' Clear screen   
         Pause 500                                     ' Wait .5 second   
         Lcdout $fe, $80, "Hello"                                ' Display "Hello"  
         PORTB.7 = 1                                      'LED on 
         Pause 500                                     ' Wait .5 second   
         Lcdout $fe, $c0, "World"                 ' Move to line 2  and display "World"  
         PORTB.7 = 0                                      'LED off 
         Pause 500                                     ' Wait .5 second   
    Goto mainloop                                    ' Do it forever   
    End

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: help with 4 x 20 LCD

    wiring ?
    contrast setting ?
    unused data pins on lcd are grounded not left floating ?
    Warning I'm not a teacher

Similar Threads

  1. Using a parallel LCD(44780 based) as a serial LCD
    By mikejp56 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 30th October 2015, 01:56
  2. Replies: 36
    Last Post: - 14th March 2011, 18:38
  3. Replies: 2
    Last Post: - 5th November 2009, 17:07
  4. LCD and PIC18F2685 - Weird LCD behavior
    By Castor in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th April 2008, 09:55
  5. to convert LCD // hd 44780 --> serial LCD
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th March 2003, 12:37

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