Hi, I recently bought a new parallel LCD, its specs are here:
http://www.hantronix.com/down/16216l5.pdf
I cannot get it to work. All I can get to work is the backlight, no characters show up at all.
I've worked with LCDs before using the program below without any problems. I have it wired exactly as is in the pbp manual under LCDOUT except with E on RB0 and RS on RB1. I treated the VL pin on the LCD as the contrast pin. I copied the initialize sequence from a parallax lcd manual. I've also tried running it on my BS2 and I can't get it to work on that either. My only solution is that the LCD is defective. Maybe something weird happened when I soldered on the wires. Anything wrong with the specs? It's got the right controller, right? HD44780
Any ideas would be appreciated.
Symbol trisb = 134
Symbol trisa = 133
Symbol portb = 6
Symbol porta = 5
Poke trisb, 0
Poke trisa, 0
Symbol E = 0
Symbol RS = 1
Symbol inst = B0
Symbol char = inst
Symbol temp = B1
Symbol counter = B2
Symbol count = B3
counter = 0
count = 0
EEPROM 0, ("Hello, Richard. It is very nice to see you.^")
start:
GoSub initialize
main:
Read counter, char
IF char = "^" Then quit
GoSub send_text
counter = counter +1
count = count +1
IF count = 16 Then next_line
IF count = 32 Then clear_screen
GoTo main
initialize:
Pause 200
Poke porta, %1100
PulsOut E, 1
Pause 10
PulsOut E, 1
Pause 10
PulsOut E, 1
Pause 10
Poke porta, %0010
PulsOut E, 1
inst = %00101000
GoSub send_inst
inst = %00001110
GoSub send_inst
inst = %00000110
GoSub send_inst
inst = %00000001
GoSub send_inst
Return
send_inst:
Low RS
bit8 = bit4
bit9 = bit5
bit10 = bit6
bit11 = bit7
bit13 = 0
Poke porta, temp
PulsOut E, 1
Pause 10
bit8 = bit0
bit9 = bit1
bit10 = bit2
bit11 = bit3
bit13 = 0
Poke porta, temp
PulsOut E, 1
Pause 100
Return
send_text:
High RS
bit8 = bit4
bit9 = bit5
bit10 = bit6
bit11 = bit7
bit13 = 1
Poke porta, temp
PulsOut E, 1
Pause 10
bit8 = bit0
bit9 = bit1
bit10 = bit2
bit11 = bit3
bit13 = 1
Poke porta, temp
PulsOut E, 1
Pause 100
Return
next_line:
inst = %11000000
GoSub send_inst
GoTo main
clear_screen:
Pause 1000
inst = %00000001
GoSub send_inst
inst = %10000000
GoSub send_inst
count = 0
GoTo main
quit:
End
Thanks
Bookmarks