I found similar problems here with an Optrex but not an Optrex with a 16F84A. I don't have the experience to transfer the advice to my PIC (believe me I tried many times). I cannot get the LCD to display text. It only displays solid lines on line 1 and 3 or all 4 lines. Here is my set-up and code. Any comments are welcome and thanks in advance.

'LCD connections (Optrex DMC-20481NY-LY-AGE), to 16F84A pins, to power
'Vdd, Pin 14, +5V
'Vss, Pin 5, Gnd
'Ve (VO), +5V
'RS, Pin 3 (RA4), 5k pull-up Resistor to +5V
'RW, None, Gnd
'E, Pin 9 (RB3)
'DB0 to DB3, No connections
'DB4, Pin 17 (RA0)
'DB5, Pin 18 (RA1)
'DB6, Pin 1 (RA2)
'DB7, Pin 2 (RA3)
'LED Anode, switched to +5V
'LED Cathode, Gnd

'Additional 16F84A connections
'Pin 4 (MCLR), 10k Resistor to +5V
'Pins 15 and 16, 4 MHz with 22pf, Gnd

'Code
DEFINE LCD_BITS 4 ' Set 4-bit data bus width
DEFINE LCD_LINES 4 ' LCD is a 4 line display
DEFINE LCD_DREG PORTA ' LCD RA to LCD data port
DEFINE LCD_DBIT 0 ' Starting data bit on A0 & last on A3
DEFINE LCD_RSREG PORTA ' Set LCD register select port to A
DEFINE LCD_RSBIT 4 ' Set A4 to register select pin
DEFINE LCD_EREG PORTB ' Set LCD enable to port B
DEFINE LCD_EBIT 3 ' Set B3 to LCD enable pin
DEFINE OSC 4
DEFINE LCD_COMMANDUS 2000 ' Set LCD command delay time in uS
DEFINE LCD_DATAUS 50 ' Set LCD data delay time in uS
Pause 2000
Start:
LCDOUT 254, 1 ' Clear screen
Pause 1000
LCDOUT " Hello"
LCDOUT 254, 192, " World"
LCDOUT 254, 148, " Isn't"
LCDOUT 254, 212, " Displaying"
Pause 1000
Goto Start
End