Commands for serial LCD


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011
    Posts
    42

    Default Commands for serial LCD

    This seems like the most basic of problems and it is probably just the frustration of trying it for hours that is keeping me from the obvious answer. I have a New Haven Display Serial LCD 20x4 display (datasheet attached) and I am attempting to use it with a PIC12F615. I can get it to print text all day long but cannot get it to do any of the commands such as "Clear Screen." I have tried every variation of sending Hex code that I can think of as well as exhausting the search feature on this forum as well as the forum for New Haven. Any help would be greatly appreciated. Here is the last version of the code I tried. The LCD is 9600 baud and there is an LED on pin 1 just so that I know the PIC is running properly and in time.

    DEFINE OSC 8
    pause 50
    high 1


    pause 1000
    serout2 2, 84, ["Hello"]

    do
    high 1
    pause 500
    low 1
    pause 500
    serout2 2, 84, [$FE,$51]
    loop
    end
    Attached Images Attached Images

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Commands for serial LCD

    I use the display often here are some lines from my code.

    Code:
    Prefix            con     $FE             ' needed before each command
    LcdCls            CON     $51             ' clear LCD (use PAUSE 5 after)
    CursorPS          con     $45             'Cursor Position
    Backlight         con     $53             ' Backlighting 1-8
    Contrast          con     $52             ' Contrast 1-50
    
    SEROUT2 LCD,84, [Prefix,CursorPS,0, "Print Text Here"]
    pause 2000
    Serout2 LCD, 84, [Prefix,LcdCLS]'Clears screen
    Last edited by Tobias; - 28th February 2012 at 05:09.

  3. #3
    Join Date
    May 2011
    Posts
    42


    Did you find this post helpful? Yes | No

    Default Re: Commands for serial LCD

    Thank you for the help. The issue was with me doing something I should have known not to do. I was using the internal osc at 8 Mhz to run it. I switched to and EC and everything is fine. I thought because of all the text that was showing up fine that everything was good. Another easy lesson learned the hard way. Thanks again for the help.

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