Clearing LCD


Closed Thread
Results 1 to 11 of 11

Thread: Clearing LCD

  1. #1

    Default Clearing LCD

    I'm going to be working on a project that looks at a byte of data from a serial connection and displays a word in response to that data on an LCD.

    I'm LCDOUT novice so bear with my basic questions.

    In intend on displaying different words at different cursor locations on the LCD...
    bit0 = LCDOUT $FE, $80, "WORD"
    bit1 = LCDOUT $FE, $80 + 10, "WORD2"

    etc.

    It looks as though you have to clear the entire LCD before writing updated information to it? ($FE,1)

    Is there any way you can clear just one line at a time?

    Not that it would matter, I suppose, if it cleared and displayed quickly
    enough.

    Also, are there a lot of complications in using (2) LCD displays on one pic? Would you just run all the data lines in parallel and then do a "select LCD1 or select LCD2"?

    Thanks.

    --Mike

  2. #2
    Join Date
    Aug 2005
    Location
    Denver
    Posts
    25


    Did you find this post helpful? Yes | No

    Default Shouldn't be a problem...

    Michael, I've had no problems overwriting data displayed on an LCD. It's not necessary to clear everything. And as for clearing an entire line, would it work for you to send a line of ASCII space characters? That would display a blank line. It's always good practice to clear the display when you first power it up with a "$FE,1". As for multiple LCD's on one PIC, there's been some discussion here. It's not as simple as you think. You should be able to search for those threads.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Post

    Hi, Michael

    You don't need to clear the entire LCD before writing something else : the simplest way is overwriting the previous data ...only where needed.

    So, if you add to some DATAs, spaces to have always the same amount of sent characters, you won't need any clearing !!!
    This just implies DATAs must always be sent to fixed positions ... and have same lenght.

    For general tips, if you need to clear a character ... overwrite it with "blank" (generally $20)

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    See Keith's method (post #5) from the following link for an easy way to clear a line.

    http://www.picbasic.co.uk/forum/showthread.php?t=4137

    (note - you may need to adjust for your display width)
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Ok great.....thanks.

    I assumed there would be something you could throw in quotes....lo and behold it's a simple "blank". (Not mentioned anywhere in the PBP handbook, by the way!).

    Of course, it's either something that simple sometimes or something that resembles assembly language.

    I'm sure I'll have more questions as I find the time to work on the code.

    First impression though, is that LCDOUT is a real lifesaver and pretty easy to work with.

  6. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Michael
    ...I assumed there would be something you could throw in quotes....lo and behold it's a simple "blank". (Not mentioned anywhere in the PBP handbook, by the way!)
    It's certainly inferred by the PBP manual - see Section 4.8 and Section 4.9 and also demonstrated in an unlikely place, Section 5.24 FOR..NEXT

    However for completeness and the main purpose of my response, you also can use 32 instead of " "
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Sorry, I didn't read closely enough.

    I was under the impression the word "blank" would clear the word.

    So you "space,space,space,etc" instead? $20 is the hex for the space key?

    So if you have a 4 letter word to clear at line 1 cursor 1.....

    LCDOUT $FE,$80, $20,$20,$20,$20 (?)

    How is it written?

    THANKS.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Is it this?.....

    LCDOUT $FE, $80, REP " " \4

  9. #9
    Join Date
    Aug 2005
    Location
    Denver
    Posts
    25


    Did you find this post helpful? Yes | No

    Default It's really simple...

    To put four blank spaces at the beginning of the 1st line:

    LCDOUT $FE, $80, " "

    It's a simple as that. And nothing else currently displayed on the LCD will be changed. Controlling LCD's with PBPro is awfully easy. I've had a lot more problems with quirky LCD drivers that want to work in 8 line mode but not in 4 line. But at least the programming is easy.

    A quick edit. The forum software seems to want to eliminate extra spaces in my line of code, but just push the space bar on your keyboard 4 times with quote marks on either end.
    Last edited by mugwamp; - 27th July 2006 at 20:34.

  10. #10
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    You can:
    a) just write on top of that location - no need to clear unless you want to
    b) clear 4 digits with any of the following
    Code:
    LCDOUT $FE, $80, REP " " \4    ' perfect the way you have it
    or
    Code:
    LCDOUT $FE, $80, "        "          ' 4 spaces between the quotes
    or
    Code:
    LCDOUT $FE, $80, 32,32,32,32
    or
    Code:
    LCDOUT $FE, $80, $20,$20,$20,$20
    or
    etc.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  11. #11


    Did you find this post helpful? Yes | No

    Default

    Wow...thanks Paul. I really appreciate it when I get specific information like that.

    It helps me learn "completely".

    Can't believe I actually had the last one right....it was an assumption. I'll stick with 4 blank spaces.....my mind likes the higher level language.

    I have poor retention for hex and decimal equivalents and the like.

    Some people can retain that type of info....I can't.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  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. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  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