20x4 LCD Driver?

Discussion in 'The Projects Forum' started by MicroSprynter, Jan 7, 2013.

  1. MicroSprynter

    Thread Starter New Member

    Jan 16, 2012
    11
    0
    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
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Usually, the 20x4 LCD uses the same controller as the 16x2 LCD.
    The driver remains the same.
     
  3. MicroSprynter

    Thread Starter New Member

    Jan 16, 2012
    11
    0
    Thanks so much. I have got a driver for a 16x2 LCD, so I test that out... Thanks for the quick reply btw. :D
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    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:

    Code ( (Unknown Language)):
    1. #define LINE_1        0x80            // home first line
    2. #define LINE_2        0xC0            // home second line
    3. #define LINE_3        0x94            // home third line
    4. #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.)
     
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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.
     
  6. MicroSprynter

    Thread Starter New Member

    Jan 16, 2012
    11
    0
    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.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Have you looked at the manual here around page 38
    http://www.picaxe.com/docs/picaxe_manual3.pdf
     
  8. MicroSprynter

    Thread Starter New Member

    Jan 16, 2012
    11
    0
    Thanks a lot... I must have just looked straight past that. :D
     
  9. MicroSprynter

    Thread Starter New Member

    Jan 16, 2012
    11
    0
    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...
     
  10. MicroSprynter

    Thread Starter New Member

    Jan 16, 2012
    11
    0
  11. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    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.
     
Loading...