Parallel LCD program
Archiver
Posts: 46,084
I have an LCD from a HP printer. It has a Hitachi (?) chip HD44780S on the
back and 14 pins on the left edge. I would like to write a program for my
Stamp to convert this to a serial LCD. Does anyone have such a program?
It looks like it is a 2 x 20.
Thanks
Sid Weaver
[noparse][[/noparse]Non-text portions of this message have been removed]
back and 14 pins on the left edge. I would like to write a program for my
Stamp to convert this to a serial LCD. Does anyone have such a program?
It looks like it is a 2 x 20.
Thanks
Sid Weaver
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
klausdejong@x... writes:
> Below you find (part of) the code I use for my Hitachi 2X8 and 2x16
> displays. It is designed for 4 bit data transfer and 3 bit control
> for the display. I normaly use pins 9, 10, 11 for the control and
> 12,13,14,15 for the data.
>
>
Thanks, Klaus. I'll see if I can puzzle out the code. One question, where
do I connect the 14 pins on the LCD. They must go to the Stamp somewhere.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
Below you find (part of) the code I use for my Hitachi 2X8 and 2x16
displays. It is designed for 4 bit data transfer and 3 bit control
for the display. I normaly use pins 9, 10, 11 for the control and
12,13,14,15 for the data.
I hope this helps,
Klaus
A substantial part of the code below is "borrowed" from Jon
Williams :-)
>>>>>>>>>>>>>>>>>>>>>>>Example of sendtext
'DISPLAY
' FOR idx = 2 TO 1
' char = Ts DIG idx + 48
' GOSUB SENDTEXT
' NEXT
' char = "."
' GOSUB SENDTEXT
' char = ts DIG 0 + 48
'' GOSUB NEXT_LINE
>>>>>>>>>>>>>>>>>>> initializing Display
RS CON 9
RW CON 10
E CON 11
CHAR VAR Byte
INST VAR CHAR
'INDEX VAR Word
TEMP VAR Byte
idx VAR Byte
LOW RW
OUTH = %00000000
DIRH = %11111111
GOSUB INITLCD
'Einde Display initialisatie
>>>>>>>>>>>>>>>>>>>>>>>>>Display numbers and characters
Some Subroutine:
GOSUB CLEARSCREEN
FOR idx = 2 TO 1
char = Temperatuur DIG idx + 48
GOSUB SENDTEXT
NEXT
char = "."
GOSUB SENDTEXT
char = Temperatuur DIG 0 + 48
GOSUB SENDTEXT
char = 223
GOSUB SENDTEXT
char = "C"
GOSUB SENDTEXT
FOR idx = 1 TO 0
char = Wind DIG idx + 48
GOSUB SENDTEXT
NEXT
char = "B"
GOSUB SENDTEXT
char = "f"
GOSUB SENDTEXT
GOSUB NEXT_LINE
Return
>>>>>>>>>>>>>>>>>>>>>>>> Routine for Hitachi
INITLCD:
PAUSE 200
LOW RS
LOW RW
OUTH = %00110000
PULSOUT E,1 'INITIALISATIE DISPLAY
PAUSE 10
PULSOUT E,1
PAUSE 1
PULSOUT E,1
PAUSE 1
OUTH = %00100000
PULSOUT E,1 'KIES 4-BIT TRANSFER
INST = %00101000
GOSUB SENDINST 'DISPLAY AAN, KIES 2 REGEL DISPLAY
INST = %00001110
GOSUB SENDINST 'CURSOR AAN
INST = %00000001
GOSUB SENDINST 'DISPLAY WISSEN
INST = %00000110
GOSUB SENDINST 'ENTRYMODE AUTOINCREMENT
INST = 14
GOSUB SENDINST 'CURSOR UNDERLINE
RETURN
CLEARSCREEN:
INST = %00000001
GOSUB SENDINST 'DISPLAY WISSEN
RETURN
SENDINST:
PAUSE 1
LOW RS
OUTD=INST.HIGHNIB
PULSOUT E,1
OUTD=INST.LOWNIB
PULSOUT E,1
HIGH RS
RETURN
SENDTEXT:
HIGH RS
OUTD=CHAR.HIGHNIB
PULSOUT E,1
OUTD=CHAR.LOWNIB
PULSOUT E,1
RETURN
NEXT_LINE:
INST = 128+64
GOSUB SENDINST
RETURN
Original Message
From: <Newzed@a...>
To: <basicstamps@yahoogroups.com>
Sent: Thursday, May 06, 2004 4:22 PM
Subject: [noparse][[/noparse]basicstamps] Parallel LCD program
> I have an LCD from a HP printer. It has a Hitachi (?) chip
HD44780S on
the
> back and 14 pins on the left edge. I would like to write a program
for my
> Stamp to convert this to a serial LCD. Does anyone have such a
program?
> It looks like it is a 2 x 20.
>
> Thanks
>
> Sid Weaver
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
In fact you can use only a nibble for the data and shift them into
the LCD in two passes, that is pins 11,12,13,14 on the LCD. Pins
4,5,6 on the LCD are for control tasks. Then pin 1 == GND, 2 == VDD
and 3 == contrast. So pins 7,8,9,10 on the LCD are not used saving
you 4 pins on the Stamp. This way you use only 7 instead of 11
expensive I/O on your Stamp.
Tip: search the web for HD44780 or KS0066
Regards,
Klaus
PS it's a nice puzzle to get this working :-).
--- In basicstamps@yahoogroups.com, Newzed@a... wrote:
> In a message dated 5/6/2004 2:10:10 PM Eastern Daylight Time,
> klausdejong@x... writes:
>
>
> > Below you find (part of) the code I use for my Hitachi 2X8 and
2x16
> > displays. It is designed for 4 bit data transfer and 3 bit
control
> > for the display. I normaly use pins 9, 10, 11 for the control and
> > 12,13,14,15 for the data.
> >
> >
>
> Thanks, Klaus. I'll see if I can puzzle out the code. One
question, where
> do I connect the 14 pins on the LCD. They must go to the Stamp
somewhere.
>
> Sid
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]