LCD Interfacing for 16F877A


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2007
    Location
    Malaysia
    Posts
    20

    Default LCD Interfacing for 16F877A

    Hi, I am new to PIC and was working on a school project. The problem is, I am unable to make my LCD work. My LCD model is RT1602C. Below is my codes. Can any expert out there to let me know what is wrong?

    Define LCD_DREG PORTB
    Define LCD_DBIT 0
    Define LCD_RSREG PORTE
    Define LCD_RSBIT 0
    Define LCD_EREG PORTE
    Define LCD_EBIT 2
    Define LCD_BITS 8
    Define LCD_LINES 2
    Define LCD_COMMANDUS 2000
    Define LCD_DATAUS 50

    LCDOUT $FE, 1, "Hello"
    LCDOUT $FE, $C0, "World"

    end

    Thanks in advance!

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi sycluap,

    Define LCD_DREG PORTB
    Define LCD_DBIT 0
    Define LCD_RSREG PORTE
    Define LCD_RSBIT 0
    Define LCD_EREG PORTE
    Define LCD_EBIT 2
    Define LCD_BITS 8
    Define LCD_LINES 2
    Define LCD_COMMANDUS 2000
    Define LCD_DATAUS 50

    ADCON1 = 7 ; Set analog pins to Digital
    PAUSE 500 : LCDOUT $FE, 1 : PAUSE 250
    ; Initialize LCD

    LCDOUT $FE, 1, "Hello"
    LCDOUT $FE, $C0, "World"

    end<hr>
    For more info ...

    PortA Doesn't Work / Parts of PortE do not work (Melanie)
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    DT

  3. #3
    Join Date
    Dec 2007
    Location
    Malaysia
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    No matter how I try before this, it just can't work, with a few additional line of codes provided by you, everything happen perfectly, it's miracle! Meaning that the cause of the failure is I didn't set the analog pins to digital? I will take note of that from now on.

    Thank you very much DT! You save my day!

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Wooho, and I'll pass that on to Melanie.

    I think the first time I ever heard it was from her about 10 years ago on the old PicBasic-L mailing list.

    Dang she was smart for only 10 years old then.
    <br>
    DT

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 will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

Members who have read this thread : 0

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