Shop OBEX P1 Docs P2 Docs Learn Events
parallax 4x20 or 2x16 is there a clear screen command? — Parallax Forums

parallax 4x20 or 2x16 is there a clear screen command?

mikedivmikediv Posts: 825
edited 2009-06-15 17:04 in General Discussion
Hi guys I have been trying to find a clear screen command or something equivalent to clear the LCD screen completely after a reset does anyone know how to do it?
there is nothing in the manual that I can see?

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-06-09 01:09
    This the very minum that you need to get you start

    In the Data sheet it has this info just go·to link where you buy the Displays and·you should see the pdf· file for it

    '
    [noparse][[/noparse] I/O Definitions ]

    ' LCD············ PIN···· 15············· ' Four LCD Display·or Two Line·Display··

    '
    [noparse][[/noparse] LCD Constants ]
    ·

    DispLightOn···· ·CON···· $11
    DispLightOFF·· · CON···· $12
    LineOne0········ ·CON···· $80
    LineOne1········· CON···· $81
    LineTwo0·········CON···· $94
    LineTwo1······ · CON···· $95
    LineTwo4······ · CON···· $98
    LineThree0····· ·CON···· $A8
    LineFour0······ ·CON···· $BC
    ClearScreen···· CON···· $0C
    Baud············· ·CON···· 32············· ' baudmode constant for LCD Display

    '
    [noparse][[/noparse] Program Code ]

    DO

    SEROUT LCD, Baud, [noparse][[/noparse]Clearscreen]

    PAUSE 100

    SEROUT LCD, Baud, [noparse][[/noparse]LineOne0,·· " HELLO WORLD"]

    PAUSE 1000

    LOOP




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 6/9/2009 1:17:47 AM GMT
  • SRLMSRLM Posts: 5,045
    edited 2009-06-09 01:18
    There is a whole list of all the chars that you can send to the screen in the documentation. Clear screen is called form feed.
  • mikedivmikediv Posts: 825
    edited 2009-06-09 17:51
    Thanks guys wow I did read all that I was hoping there was something along the lines of "CLS" or "Clear" that's a lot of commands to just wipe clear the display.
    Sam thank you for the code very helpful I tried shutting off the display but it does nto clear the ram and as soon as you turn it back on the text shows up.
    another thing I do not completely understand

    If you want to print an ASCII character or text you issue the command 32 but if you look on the list of commands it goes from 32-127 when I issue the command
    Baud19200 CON 32 I can print out ASCII text on the display but what the heck are the rest of the commands from 32-127 for???? I know 32=ASCII but 33,34,35?????
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-09 17:57
    Mike, a single byte is being sent in order to clear the screen ($0C). This is no different than sending a carriage return or the letter 'A' except that once you send the $0C you must wait 5mS (if memory serves) before sending any other data. All the other code was initialization and constants common to any program using the display. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • SRLMSRLM Posts: 5,045
    edited 2009-06-09 18:12
    ASCII is a system for exchanging data. The values dec32 - dec126 are all printable characters, aka, things like letters, numbers, {},!,@,#,$, etc. The lower 32 numbers are for command chars. The LCD repurposes some of these, and hex0C is the clear screen one. The others do other tasks that may be useful. The code in this thread uses an LCD with the propeller to do various tasks.
  • mikedivmikediv Posts: 825
    edited 2009-06-10 00:24
    Thanks again guys, Chris I am using a program that lets me send data to the LCD 4X20 with debug it is working fine I can send dec ASCII code and it will print the character on the LCD it also lets me send the LCD commands like 17 turn backlight on and so forth that is working as well, I converted 0C to dec "12" and sent the command "ESC" 12 to the display but it did not clear it what am I missing?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-10 15:24
    Why are you sending the ESC? Simply sending binary value 12 to the display clears the screen. ESC commands are used in ANSI terminals, but the LCD doesn't know the ANSI commands.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • mikedivmikediv Posts: 825
    edited 2009-06-10 21:23
    Chris there is a program from parallax that lets you test the serial LCD buy using debug and entering characters to the display through the debug window it also lets you send commands "esc whatever the command"
    so I just converted the hex code to dec 12 and tried to send it with the esc 12 through this terminal program . you can not send the commands in hex or binary just dec I just wanted to see if it would clear the command it did not so I must be doing something wrong
    I can send any of the commands this way and have tried most of the , turn backlight on , turn screen off, move cursor that sort of thing
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-11 15:43
    Okay, so maybe that is where the confusion lies…I am not familiar with any application for our LCD display which does this. Where did you get the program from? What is the part number of the display you’re referring to?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • SeariderSearider Posts: 290
    edited 2009-06-11 23:31
    Chris, Thanks for mentioning the 5ms delay. I have been wondering why sometimes my clearscreen works and sometimes not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • mikedivmikediv Posts: 825
    edited 2009-06-12 00:48
    Chris it works thank you so much for all the help thank all you guys, here is the program I am talking about I think it came with the LCD I downloaded it from the Parallax store site I have the 4X20 serial LCD. I was typing the wrong thing when I corrected it "esc 12" converted command from your suggestion 0C Hex to decimal 12 it will now clear the screen with one command
    Chris this program lets you type characters on your serial LCD either the 2X16 or the 4X20 using the debug terminal in the basic stamp editor 2.4.2 you can also send all the LCD commands by hitting "ESC" then typing your command in Dec, well I mean one command at a time but it will work with any of the command listed in the documention.
    Thanks again guys
    Attached
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-15 17:04
    @Searider – The delay is mentioned in the documentation, though I think it often gets missed because it is the only command that requires this. As a note this delay is caused by the Hitachi controller on the LCD itself and happens on parallel displays as well. The difference is in parallel mode most microcontrollers aren’t pausing, they’re waiting for the busy flag.

    @mikediv – Thanks for mentioning the program. As much as I was involved with these displays I wasn’t aware we had released such a program. It is interesting though it would seem the author didn’t take the clear screen command into consideration. I will notify our Tech Support Dept. in case they want to correct that and update the code. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.