PDA

View Full Version : LCD Problems



gtx15
- 27th September 2007, 16:58
Im having problems writing to line 2 of a 22X2 lcd. I want it to say.
" hello " 1st line
" world " 2nd line

The 1st listing works ( by looping from 1st line)
But why dosnt the 2nd listing work? I get my blinking curser where it should be. but only blank spaces on 2nd line!

DEFINE OSC 32
DEFINE LCD_DREG PORTE
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTH
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTH
DEFINE LCD_RWREG PORTH
DEFINE LCD_RWBIT 2
DEFINE LCD_EBIT 0
DEFINE LCD_BITS 8
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
LCDOUT $FE,$0F
LCDOUT " hello "
LCDOUT " WORLD" '
HI: GOTO HI



Listing 2;
DEFINE OSC 32
DEFINE LCD_DREG PORTE
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTH
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTH
DEFINE LCD_RWREG PORTH
DEFINE LCD_RWBIT 2
DEFINE LCD_EBIT 0
DEFINE LCD_BITS 8
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
LCDOUT $FE,$0F
LCDOUT " hello "
LCDOUT $FE,$C0, " WORLD" '
HI: GOTO HI

Any Help?

mackrackit
- 27th September 2007, 17:20
Try this.
From the manual:


LCDOUT $FE,1,“Hello” ‘ Clear display and show“Hello”
LCDOUT $FE,$C0,“World” ‘ Jump to second lineand show “World”

Kamikaze47
- 27th September 2007, 19:19
I would also add in a $FE,$80 to make sure you are at the first position of the 1st line.

i.e.

LCDOUT $FE,1 'Clear the screen
LCDOUT $FE,$80,"HELLO"
LCDOUT $FE,$C0,"WORLD"

Archangel
- 27th September 2007, 19:22
Someone else needs a bigger monitor ;)

Kamikaze47
- 27th September 2007, 19:24
Someone else needs a bigger monitor ;)

I dont get it

locko
- 27th September 2007, 21:41
Just think of your LCD as a battle ship game grid.
You have to say where you want your 'character/s' to land.

I always plan my LCD displays/Menus on a spread sheet that has the position address for each character.

Not sure how to display pictures in a reply yet so I have attached a bmp to show what I mean.

Just edit your code as already suggested and it should work....

Paul

Archangel
- 29th September 2007, 03:04
I dont get it
Error : The eyestrain is all mine, sorry.