Shop OBEX P1 Docs P2 Docs Learn Events
LCD 1 Line 16 char PARALLEL.. how to set it to work ? — Parallax Forums

LCD 1 Line 16 char PARALLEL.. how to set it to work ?

AmaralAmaral Posts: 176
edited 2005-07-26 20:41 in BASIC Stamp
Hello all.
·
I got an LCD from a machine (the machine·was broken but not the LCD), and this is an 16 char·1 line parallel.
I tried to connect this using the example from parallax of 2x16 Parallel LCD, naturally it did not work properly, but I was able to see that all the characters are working.
·
Where can I find examples codes or explanations about LCD, information like how does that initializes?·
I don't know anything about LCD, actually never used. I was thinking in buy one , but·I would choose a serial one because don't get so many pins of my BS2 ...· but now I got this one that comes for free·so I want to use it !
·
Please anyone, any information is valid
·
I'm using a BS2 , the LCD is " MC1601a-SYR "
·
Thanks in advance
·
Ricardo Amaral
·

Comments

  • YanroyYanroy Posts: 96
    edited 2005-07-25 16:01
    Here's a link to my favorite LCD setup tutorial: http://coen.boisestate.edu/ssmith/ee533/overheads/LCD.pdf.· It's a powerpoint presentation from some college somewhere... I just found it through google.· If you google the HD44780 LCD controller, you'll find plenty of websites that tell you how to use it (that's the one that's in most standard parallel LCDs).· Also, you may not be aware of this: you can set up LCD's with this controller to operate using only 4 data pins, which could make it more bearable to use with a stamp.· I believe then it requires 7 pins total.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-25 16:55
    Hello,

    Tracking the datasheet down on the LCD will also help you determine if it's even got a Hitachi compatible chipset on it, and if typical code and schematics will work with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • ShortShort Posts: 26
    edited 2005-07-25 18:51
    ······ If your LCD has pin numbers or at lest a pin 1· see if it looks like my drawing. if you wire your LCD pin for pin to my drawing it should display TIME.



    '{$STAMP BS2}

    '{$PORT COM2}





    E CON 7

    RS CON 8

    Char VAR BYTE

    DA VAR BYTE

    MAIN:

    pause 1000

    GOSUB LCD_ini

    DIS:

    Char = 12

    GOSUB LCDcmd

    Char = 133

    GOSUB LCDcmd

    Char = 69

    GOSUB LCDda

    Char = 77

    GOSUB LCDda

    Char = 73

    GOSUB LCDda

    Char = 84

    GOSUB LCDda

    STOP





    LCD_ini:

    LOW 9

    'PAUSE 1000

    Char = 48 ' 8-bit mode

    GOSUB LCDcmd

    PULSOUT E, 1

    PAUSE 10

    Char = 48 ' 8-bit mode

    GOSUB LCDcmd

    PULSOUT E, 1

    PAUSE 1

    Char = 48 ' 8-bit mode

    GOSUB LCDcmd

    PULSOUT E, 1

    PAUSE 1

    PAUSE 5

    PULSOUT E, 1

    PULSOUT E, 1

    Char = 32 ' 4-bit mode

    GOSUB LCDcmd

    PULSOUT E, 1

    Char = 40 ' Set for 2 line operation

    GOSUB LCDcmd

    Char = 12 ' Shift cursor right

    GOSUB LCDcmd

    Char = 6 ' Increment DDRAM after write

    GOSUB LCDcmd

    Char = 1 ' Clear LCD screen

    GOSUB LCDcmd

    Char = 4

    GOSUB LCDcmd

    RETURN





    LCDcmd:

    LOW RS





    LCDwr:

    DA = Char.HIGHNIB

    GOSUB CONV

    PULSOUT E, 1

    DA = Char.LOWNIB

    GOSUB CONV

    PULSOUT E, 1

    HIGH RS

    RETURN



    LCDda:

    HIGH RS



    LCDwrD:

    DA = Char.HIGHNIB

    GOSUB CONV

    PULSOUT E, 1

    DA = Char.LOWNIB

    GOSUB CONV

    PULSOUT E, 1

    LOW RS

    RETURN



    CONV:

    OUTPUT 3

    OUT3 = DA.BIT3

    OUTPUT 4

    OUT4 = DA.BIT2

    OUTPUT 5

    OUT5 = DA.BIT1

    OUTPUT 6

    OUT6 = DA.BIT0

    RETURNhop.gif With this code
    640 x 480 - 42K
    dra.JPG 42.1K
  • AmaralAmaral Posts: 176
    edited 2005-07-26 20:41
    Thanks all of you guys .
    it is an hd44780 controled LCD.

    I made it work fine , got some help from google at http://home.iae.nl/users/pouweha/lcd/lcd.shtml

    Ricardo Amaral
Sign In or Register to comment.