LCD 1 Line 16 char PARALLEL.. how to set it to work ?
Amaral
Posts: 176
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
·
·
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
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
'{$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
RETURN With this code
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