JHD162A LCD Initialization
Shalini
Posts: 59
[h=2] Hi everyone![/h]
I'm using parallax propeller P8X3A-D40 with propeller tool software 1.3.2 to initialize the JHD162A LCD. I'm a beginner to SPIN language. I'm unable to write a SPIN code to initialize the lcd. Here are my pin connections from lcd to propeller:
LCD
P8X32A-D40
Vss
GND
Vcc
+5V
Vee (CONTRAST)
to middle pin of potentiometer (10k)
RS
P24
R/W
P25
E
P26
DB0
P16
DB1
P17
DB2
P18
DB3
P19
DB4
P20
DB5
P21
DB6
P22
DB7
P23
I know that for 8-bit mode (5x10 font style)
- Function Set is 0x3C
- Display Switch is 0x0F (which issues Display,Cursor, and Blink as ON)
- Input Set is 0x06
- Screen Clear is 0x01
- DDRAM AD set to reposition the cursor at Home at anytime is 0x80.
But I'm I don't know where to put what in the code. Can somebody please help me out on how to do the SPIN code for this lcd. I'm really in urge to make my project work....
Your help is greatly appreciated!!!
Thanks in advance
LCD
P8X32A-D40
Vss
GND
Vcc
+5V
Vee (CONTRAST)
to middle pin of potentiometer (10k)
RS
P24
R/W
P25
E
P26
DB0
P16
DB1
P17
DB2
P18
DB3
P19
DB4
P20
DB5
P21
DB6
P22
DB7
P23
I know that for 8-bit mode (5x10 font style)
- Function Set is 0x3C
- Display Switch is 0x0F (which issues Display,Cursor, and Blink as ON)
- Input Set is 0x06
- Screen Clear is 0x01
- DDRAM AD set to reposition the cursor at Home at anytime is 0x80.
But I'm I don't know where to put what in the code. Can somebody please help me out on how to do the SPIN code for this lcd. I'm really in urge to make my project work....
Your help is greatly appreciated!!!
Thanks in advance
Comments
There are many examples in the OBEX and elsewhere, however....
Have a look at the function LCDINIT at the end of my CHARLCD.fh document to see the sequence and you will notice that although I use $38 because I have a 4-line LCD that you still need to observe the sequence and delays.
BTW, save yourself a lot of bother and tie the R/W low and simply write to the LCD. Also the LCD really needs to operate from 5V even if they say it can run from 3.3V as the Vlcd (pin 3) needs to be around 4.5V <less than> the supply voltage which means if you do run 3.3V supply then Vlcd needs to be a negative voltage otherwise.
Here's the snippet from my code, you should be able to follow it and bear in mind that LCDCMD is just a blind write to the control register so that $38 LCDCMD means "Write $38 to the LCD control register".
Make sure to post all of your code if you really want some useful answers.
Are you sure that this is a sign for not beeing initialized?
A problem with the contrast-setting could do this also?