PIC controlled serial LCD


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default PIC controlled serial LCD

    Does anyone have some PBP-code
    to Display data from a serial port on a character LCD? (HD44780)

    Ideally it would support control codes similar to the ones available with the PBP LCDOUT statement (i.e. CLEAR Display, move Cursor, etc.)

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Include "Modedefs.bas"

    i con 254 ' Control command byte
    clr con 1 ' Clear the display

    rcvbyte var byte ' First byte received

    trisa = 0 ' Set porta to output
    trisb = 0 ' Set portb to output

    pause 500 ' Wait for LCD to start

    lcdout i,clr ' Issue LCD command + clear screen

    start:
    serin2 portb.1,16780,[rcvbyte]
    if rcvbyte = 254 then lcdcmd
    lcdout rcvbyte
    goto start

    lcdcmd:
    serin2 portb.1,16780,[rcvbyte]
    lcdout i,rcvbyte
    goto start
    end

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    @ CocaColaKid

    Thanks for your reply !

    This code is almost the same as what I have tried before I started the thread.
    I'm receiving the bytes at 4800 Baud (Mode $BC)

    It works fine for just receiving characters (no control bytes) and displaying them bytewise.

    If a control code like $FE,1 (clear display) is received and data is received right after the control bytes the display is cleared but the next 1 or 2 characters to be displayed get lost.

    The CLEAR command takes too much time for the display to handle characters send right after the command.

    btw. you don't need to include modedefs.bas if you are not using modes defined there.

    regards

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hmm, when I use this code I don't seem to drop any characters. That might be because of the lower baud rate though.

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. 2 PIC, serial communication
    By lightgreen in forum Serial
    Replies: 6
    Last Post: - 21st November 2009, 15:20
  3. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  4. How many serial ports can 1 PIC handle?
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd March 2005, 04:34
  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