LCD display not working properly


Results 1 to 15 of 15

Threaded View

  1. #1
    Join Date
    Nov 2007
    Posts
    5

    Question LCD display not working properly

    I am trying to write a simple code to enable password entry. I am using 16F877a and two line LCD module for display. I have written following code which gets compiled successfully however when I key in four digits they are not displayed on the LCD module.

    OPTION_REG.7 = 0 ' PORTB Pullups.
    TrisA = 0 ' PORTA, all outputs
    PortA = 16 ' Turn off Buzer
    TrisB = %11110000 ' PORTB.0-3 outputs, 4-7 inputs
    PortB = 0
    Define LCD_DREG PORTC
    Define LCD_DBIT 0
    Define LCD_RSREG PORTC
    Define LCD_RSBIT 4
    Define LCD_EREG PORTC
    Define LCD_EBIT 5

    LD1 var PortA.2
    RL1 var PortA.3
    BUZ var portA.4
    cnt var byte
    cnt2 var word

    key var byte
    col var byte
    row var byte
    keycnt var byte
    pwOK var bit

    keybuf var byte[15]
    pwbuf var byte[4]
    Pause 100 ' Wait for LCD to start

    Lcdout $fe, 1, " HELLO " ' Display sign on message
    Lcdout $fe, 1, " WORLD " ' Display sign on message

    Pause 500 ' Wait for LCD to start

    Lcdout $fe, 1, "Enter pasaward " ' Display sign on message

    loop: Gosub Chk_KEYPAD: ' Get a key from the keypad
    Lcdout $fe, $c0+1,1,$0f, #key ' Display ASCII key number
    Gosub Chk_KEYPAD: ' Get a key from the keypad
    Lcdout $fe, $c0+2,1,$0f, #key ' Display ASCII key number
    Gosub Chk_KEYPAD: ' Get a key from the keypad
    Lcdout $fe, $c0+3,1,$0f, #key ' Display ASCII key number
    Gosub Chk_KEYPAD: ' Get a key from the keypad
    Lcdout $fe, $c0+4,1,$0f, #key ' Display ASCII key number

    Goto loop ' Do it forever
    Last edited by dilpkan; - 22nd January 2008 at 03:02. Reason: slight change

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. LCD Display
    By lambert in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th January 2010, 22:18
  3. Simple LCD code not working!...WHY?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th November 2009, 19:48
  4. My LCD code is not working...
    By kvrajasekar in forum mel PIC BASIC
    Replies: 2
    Last Post: - 7th December 2008, 05:41
  5. LCD Display not working - PIC heating...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 24th September 2006, 07:35

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