PDA

View Full Version : problems with parallel LCD



Brown
- 9th June 2008, 23:45
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

Darrel Taylor
- 10th June 2008, 00:13
Since you're using PORTA. You probably just need to disable the analog functions (A/D and Comparators).

Which PIC are you using?
<br>

Brown
- 10th June 2008, 20:06
I'm using the 16F628.
I tried adding:
Symbol cmcon = $1F
Poke cmcon, 7
(is this what you were talking about?)
and nothing changed. Yeah, I don't really know what else to do.

Thanks

skimask
- 10th June 2008, 20:14
I'm using the 16F628.
I tried adding:
Symbol cmcon = $1F
Poke cmcon, 7
(is this what you were talking about?)
and nothing changed. Yeah, I don't really know what else to do.
Thanks

Something I always do...no matter how sure of myself I am...
I connect a heartbeat LED. Just set aside a pin to do nothing more than flash an LED.
The absolute first thing I do. You can verify and check sooooo many things with just that little bitty LED.
Also, you might want to increase that pause 200 to pause 1000 or 2000 and see what happens.

Archangel
- 11th June 2008, 02:27
Hello Mr. Brown,
I know PBP and PB are somewhat different, in PBP the statement would be just<br>CMCON = 7

Brown
- 11th June 2008, 05:22
Hi, I tried your suggestions and unfortunately my LCD still isn't working. I think I'll just order another one sometime and test it out. If anyone has an idea let me know.

Thanks

skimask
- 11th June 2008, 14:08
Are you seeing any blocks on the screen or anything at all? Remember to try viewing the LCD at various angles...

Brown
- 12th June 2008, 03:27
Yeah, I'm not seeing anything at all. I remember now that it's a transreflective LCD, so maybe something's getting messed up with its light adjustment stuff. Anyways, just a thought...

skimask
- 12th June 2008, 03:32
Yeah, I'm not seeing anything at all. I remember now that it's a transreflective LCD, so maybe something's getting messed up with its light adjustment stuff. Anyways, just a thought...

How about the LED as mentioned/suggested in post #4?

And one more thing...
Are you using PicBasic or PicBasicPro?
I know it looks like PicBasic, but you mentioned looking at the PBP manual...Which is it? What does the front of the manual say?

And if you looked in the manual under LCDOUT for guidance on how to connect the LCD, why aren't you just using the LCDOUT command?
Only two reasons I can think of off the top of my head...

Brown
- 12th June 2008, 04:12
Yeah I tried hooking up an LED and it lit up as it was supposed to. I'm using PicBasic. I used the LCDOUT schematic just because I thought it was the right way to hook up a parallel LCD and so that you guys could have a reference to my wiring.

skimask
- 12th June 2008, 04:22
Yeah I tried hooking up an LED and it lit up as it was supposed to. I'm using PicBasic. I used the LCDOUT schematic just because I thought it was the right way to hook up a parallel LCD and so that you guys could have a reference to my wiring.

But there's no LCDOUT in the PBC manual!

Brown
- 12th June 2008, 04:37
Hahaha sorry, I looked online at the PBP manual.