I am having a horrible time trying to get an optrex LCD (DMC 16433) to spit out anything. I have a PIC 18F458 that works fine on a LAB-X1 LCD board, yet when I try to hook it up with a 4 line optrex, I get two solid bars on the first and third line. I think I have it set right, I just can't figure out what is wrong about it.
DEFINE LCD_LINES 4
DEFINE LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTE
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 1
DEFINE OSC 40 '40 MHz clock
ADCON1 = 7 ' Set PORTA and PORTE to digital
'Low PORTE.2 ' LCD R/W line low (W)
TRISD = 0 ' Set PORTD (LEDs) to all output
PORTD = 0 ' All LEDs off
INTCON2.7 = 0 ' Enable internal pullups on PORTB
TRISB=%11110000 ' =1 makes B port input and =0 makes B port output
PORTB = 0 ' PORTB lines low to read buttons
Pause 100 ' Wait for LCD to startup '
LCDOut $fe, 1 ' Clear screen
loop:
Pause 500
LCDOut $fe, $80, "Hello"
LCDOut $fe, $c0, "World"
Pause 500
LCDOut $fe, 1 ' Clear screen
GoTo loop ' Do it forever
End
If you have any thoughts I would love to hear them.
Bookmarks