Serial LCD


Closed Thread
Results 1 to 4 of 4

Thread: Serial LCD

  1. #1

    Default Serial LCD

    First off, I got my ICSP sorted out. Much thanks to the forum. While looking for a few components, I found a serial LCD from my STAMP days. I tried to attach a ZIP file of the spec sheet but it is over the attachment size limit. I thought to myself that this would be pretty handy to debug a new board and/or code. I can insert a few lines of code into my program, solder one wire to a free pin, provide the LCD with 5v and ground, then be sorting out a new program much quicker using this display.

    So I am testing this on a PIC18F4523. I looked up the SerOut command and came up with the following code. I also set the serial LCD up for a baud rate of 9600 using the DIP switches on the back of its housing.
    -----------------------------------------------
    include "bs2defs.bas"
    define OSC 40
    ADCON1 = 7 ' Set PORTA and PORTE to digital
    LCD var PortA.2
    high LCD

    SEROUT LCD,N9600, ["Grace",10 ] ' Display "Grace"
    ------------------------------------------------

    The results of the code is just an underscore in the first space on the the first line. I think the underscore is like a default when no data is received though.

    I know one variable is if I am getting the 'mode' correct in the SEROUT command. I have tried the other three X9600 with the same results.

    I would have imagined this would be a pretty easy crossover from STAMP to PIC with this serial LCD. Please clue me in on what I am missing.

    Thanks
    Last edited by Tobias; - 14th November 2007 at 05:22.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Code:
    include "modedefs.bas"
    
    I     con 254 'instruction
    CLR   con 1  'clear screen
    L1  con 128 'line 1
    L2  con 192 'line 2
    L3  con 144 'line 3
    L4  con 208 'line4
    
    Serout2 LCD,16468,[I,CLR]
    PAUSE   1
    Serout2 LCD,16468,[I,L1,"MACKRACKIT"]
    Code:
    include "bs2defs.bas"  'DO NOT NEED
    define OSC 40
    ADCON1 = 7 ' Set PORTA and PORTE to digital
    LCD var PortA.2
    high LCD                     'DO NOT DO THIS
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Code:
    include "bs2defs.bas"  'DO NOT NEED
    			--- Yes needed unless he manually define 
    			    the value of N9600
    define OSC 40
    ADCON1 = 7 ' Set PORTA and PORTE to digital
    LCD var PortA.2
    high LCD                     'DO NOT DO THIS
    		             --- Yes do it for true mode unless 
    			        the first character might be screwed up.  
    			        with N9600, use LOW instead.  Not
                                    a bad idea to add a few mSec delay after
    And you ADCON1 setting is false, the way you have set it gives...
    AN<12:8> digital
    AN<7:0> analog

    so you want to open the datasheet section 19.0, register 19-2, pdf page 230 and use
    ADCON1=$0F
    <hr>
    In case it doesn't work, there's some missing information here... configuration fuses, crystal speed etc etc (yeah i know 40Mhz is the end results... but PLL or not etc etc).... you know all annoying stuff to post but how much useful for us
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The code I gave works for running the LCD. The things I said are not needed or do not do is if you use the code for the LCD as I gave.

    Sorry for any confusion.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. LCD serial backpacks
    By Archangel in forum Serial
    Replies: 67
    Last Post: - 30th December 2010, 04:51
  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. Please help with EDE702 - Serial to LCD interface
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th October 2008, 02:48
  4. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07

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