PDA

View Full Version : JHD 204A LCD Display help



microcnc05
- 17th March 2010, 20:19
Hi I'm having a little trouble with a LCD display. I've used melabs serial LCD's before and they work great but I'm trying a JHD 204A display it's a Hitachi based display and I believe it's compatible with picbasic pro. I was trying to get it to work on a board I made for a pic16f877a but with no luck I started bread boarding it with a pic16f84a just trying to get hello world. I know the pic is sending something to it because it's a 4 line display and you can clearly see when it fires up the LCD goes from 2 lines to 4 lines as defined in the DEFINES section of the code. But I'm unable to get any thing to print. Now I"ll include my setup here and code and see if you can help me.

LCD Display:
PIN

1 = Vss
2 = Vdd
3 = Vo
4 = RS
5 = R/W
6 = E
7 = DB0
8 = DB1
9 = DB2
10 = DB3
11 = DB4
12 = DB5
13 = DB6
14 = DB7
15 = A led backlight +5v
16 = k led backlight GND

I have my pic16f84a hooked up as follows:

RB4 to RB7 as the Data bits hooked up to pin 10 though 14 on the LCD

RA2 TO PIN 4 (RS)
RA4 TO PIN 6 (E)
AND PIN 5 (R/W) IS TO GNG
I also have RB0 hook to an LED for visual perposes


Here is my program code.

CLEAR ;
TRISB = %00001110
TRISA = %11101011
DEFINE OSC 4 ;
DEFINE LCD_DREG PORTB ; Define LCD connections
DEFINE LCD_DBIT 4 ;
DEFINE LCD_RSREG PORTA ;
DEFINE LCD_RSBIT 2 ;
DEFINE LCD_EREG PORTA ;
DEFINE LCD_EBIT 4 ;
DEFINE LCD_BITS 4
DEFINE LCD_LINES 4
DEFINE LCD_COMMANDUS 1500
DEFINE LCD_DATAUS 44


PORTB.0 = 1
PAUSE 1000


LCDOUT $FE,$1
LCDOUT $FE,$80,"HELLO WORLD"
END


Any help with getting this display to work would be great. I already have hardware built to use this display and so you can see my interest in getting it to work. thanks

Archangel
- 18th March 2010, 00:26
Hello microcnc05,
First off 4 line LCDs are really 2 line Lcds which are laid out thusly
Line 1 & Line 3 are line 1
Line 2 & line 4 are line 2. Just FYI

Try moving the E bit off PortA.4 I believe that is the MCLR pin with open collector see if that works, quick test anyway.
If so you might be able to use it with a pull up. I always ground pins 3 & 5 unless you really want to hassle using a contrast control or really need to read what is on the display.
Edit: I do not see any config statements, so you undoubtedly are using the default configs, do you know what they are ? Do you know how they are set as default ? Do you know where they are ? If the answer to any of those questions is no then goto this link: http://www.picbasic.co.uk/forum/showthread.php?t=543

Heckler
- 19th March 2010, 18:49
I have my pic16f84a hooked up as follows:

RB4 to RB7 as the Data bits hooked up to pin 10 though 14 on the LCD



10 through 14 is 5 bits...

I think it should be 11-14 (DB4-7) connected to PORTB.0-3, NOT PORTB.4-7.

Look at the schematic example in the book.

Good Luck
Dwight