20x4 LCD Driver?

Thread Starter

MicroSprynter

Joined Jan 16, 2012
11
Ok, so I am building an electronic product which uses an alphanumeric LCD to display the data. The LCD (as said in the title), is 20x4. I am sending the information to the LCD using a PICAXE chip (which will hold the logic for the product). This means that I cannot use my current driver (which is 16x2). My question is... How can I drive the LCD using the serout command on the picaxe? Is there a good and easy to use driver which I can connect between the LCD and the PICAXE chip?
This is the LCD I bought:

http://www.rapidonline.com/Electronic-Components/20-x-4-Alphanumeric-LCD-Displays-500164
 

ErnieM

Joined Apr 24, 2011
8,377
The main difference between different size displays is where in the memory each line is stored. I'm currently using a 20x4 display and the lines start here:

Rich (BB code):
#define LINE_1        0x80            // home first line
#define LINE_2        0xC0            // home second line
#define LINE_3        0x94            // home third line
#define LINE_4        0xD4            // home fourth line
Yours should do the same, so use those numbers for the starting address when writing to those display lines.

DO NOTE they are not in the order one would expect, so when you wrap around the first line it appears on the third line, then 2nd line, and finally the 4th line. (I see that when debugging and I've written too much at one time.)
 

t06afre

Joined May 11, 2009
5,934
The main difference between different size displays is where in the memory each line is stored. I'm currently using a 20x4 display and the lines start here:

Rich (BB code):
#define LINE_1        0x80            // home first line
#define LINE_2        0xC0            // home second line
#define LINE_3        0x94            // home third line
#define LINE_4        0xD4            // home fourth line
Yours should do the same, so use those numbers for the starting address when writing to those display lines.

DO NOTE they are not in the order one would expect, so when you wrap around the first line it appears on the third line, then 2nd line, and finally the 4th line. (I see that when debugging and I've written too much at one time.)
Those numbers are kind of wrong I think. But they will be correct if used as goto commands(RS=0). As the goto command(Set DDRAM Address) is DDRAM cell address+0x80.
 

Thread Starter

MicroSprynter

Joined Jan 16, 2012
11
Thanks for all the help. I am completely new to BASIC, and so I am having to learn the very basics for this project. Would you mind writing a very simple program so I can see how to use these commands and definitions. For example:
Print "Hello" on the first line, and then print "World" on the second line. That would help me out a lot, and make this whole process easier for me. Thanks again.
 

t06afre

Joined May 11, 2009
5,934
Thanks for all the help. I am completely new to BASIC, and so I am having to learn the very basics for this project. Would you mind writing a very simple program so I can see how to use these commands and definitions. For example:
Print "Hello" on the first line, and then print "World" on the second line. That would help me out a lot, and make this whole process easier for me. Thanks again.
Have you looked at the manual here around page 38
http://www.picaxe.com/docs/picaxe_manual3.pdf
 

Thread Starter

MicroSprynter

Joined Jan 16, 2012
11
Ok, so I have tried the LCD driver with no luck... I have tried programming it with PIC Logicator (using the flowcharts), and also in BASIC. I'm really confused... I think I might try one more driver. Can any of you point me in the right direction, or tell me a particular one I should try. Thanks...
 

ErnieM

Joined Apr 24, 2011
8,377
Well... poop! The link on that page to the data sheet is dead. Can you attach that pdf itself so we can have a look?

One thing commonly done with serial interfaces (meaning I've done it too) is the transmit on one end goes to the receive on the other, not transmit to transmit.
 
Top