PDA

View Full Version : LCD displays text msgs but not numerical value



aggie007
- 6th November 2007, 15:39
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

Acetronics2
- 6th November 2007, 15:45
MANUAL !!!

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

sooooooo, Try DEC A ...

Alain

Melanie
- 6th November 2007, 16:29
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...