LCD displays text msgs but not numerical value


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    13

    Default LCD displays text msgs but not numerical value

    Hi all,

    I have hooked up a LCD (HD44780 controller - 16X2) with PIC18F4525.

    The LCD is now displaying text messages, but when I try to display a numerical value of a variable or a constant, it doesn't show anything and the screen remains blank.

    Please Help !!


    Here is the code-


    DEFINE OSC 8

    '******Setting up the LCD display******

    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 1
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50


    @_CONFIG_CONFIG1H_OSC_INTIO67_1H

    TRISB=0 'Set Port B as output

    a VAR BIT
    LET a=10

    PAUSE 5000

    LCDOUT $FE, 1
    LCDOUT "PIC - LCD Test "

    PASUE 5000

    LCDOUT $FE, 2
    LCDOUT " A = ", #a

    STOP

    END

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink Rtfm !

    MANUAL !!!

    << If a pound sign (#) precedes an Item, the ASCII representation for each
    digit is sent to the LCD. >>

    sooooooo, Try DEC A ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Defining 'a' as a BIT and then trying to stuff a value of 10 into it doesn't help!

    LCDOUT $FE,2 isn't great in this situation either - the result will be a bit of a displayed mess...

Similar Threads

  1. Replies: 2
    Last Post: - 5th November 2009, 17:07
  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 issue with EasyPIC5
    By manwolf in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 15th June 2008, 09:17
  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 : 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