LCD
Archiver
Posts: 46,084
Go to any surplus store, allcorp.com, jameco.com, mpj.com, etc. You can get
a one line, 16 character LCD using an Hitachi 44780 chip which has tons of
support for the stamp usually for under $5.
Original Message
From: Jesse Babich [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=e4IeAJRQ8jgwyZ9lK2wMbgulE3FPyO-VC8vZmAQhuO8iuqx6nLeIOM9Q-kWxy6vPWTKEVytshqz0aDEEypA]jbabich@p...[/url
Sent: Monday, March 13, 2000 10:58 AM
To: basicstamps@egroups.com
Subject: [noparse][[/noparse]basicstamps] LCD
Does anyone know of a good general purpose LCD that would not require to
much work to attach to a Stamp. The LCD would need to display a two
digit number, and maybe a sentence.
thanks
-- Check out your group's private Chat room
-- http://www.egroups.com/ChatPage?listName=basicstamps&m=1
a one line, 16 character LCD using an Hitachi 44780 chip which has tons of
support for the stamp usually for under $5.
Original Message
From: Jesse Babich [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=e4IeAJRQ8jgwyZ9lK2wMbgulE3FPyO-VC8vZmAQhuO8iuqx6nLeIOM9Q-kWxy6vPWTKEVytshqz0aDEEypA]jbabich@p...[/url
Sent: Monday, March 13, 2000 10:58 AM
To: basicstamps@egroups.com
Subject: [noparse][[/noparse]basicstamps] LCD
Does anyone know of a good general purpose LCD that would not require to
much work to attach to a Stamp. The LCD would need to display a two
digit number, and maybe a sentence.
thanks
-- Check out your group's private Chat room
-- http://www.egroups.com/ChatPage?listName=basicstamps&m=1
Comments
one I/O pin to work.
The "serout" command is used to send data and text to the display at either 2400
or 9600 bps.
They are relatively inexpensive and make a great addition to any stamp project.
Does anyone know of a good general purpose LCD that would not require to
much work to attach to a Stamp. The LCD would need to display a two
digit number, and maybe a sentence.
thanks
-- Check out your group's private Chat room
-- http://www.egroups.com/ChatPage?listName=basicstamps&m=1
much work to attach to a Stamp. The LCD would need to display a two
digit number, and maybe a sentence.
thanks
project this month uses an Edward's LCD so you might want to look at it for
ideas: www.al-williams.com/awce/som.htm
The Edward's LCDs are almost too easy to use. Just one wire and a SEROUT and
you are in business. You can directly drive cheap LCDs (I show you how in my
Microcontroller Projects with Basic Stamps Book) but then you need many more
lines (4 data plus several control lines). If you have the I/O space (and
the program space for the code to drive the LCD) that's OK, but the Seetron
units are still much easier.
Regards,
Al Williams
AWC
*Expand your Stamp I/O with a PAK-IV I/O coprocessor.
http://www.al-williams.com/awce/pak3.htm
>
Original Message
> From: Jesse Babich [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Fof7379FapCAHfoMfmT7_HKb22Vet2Bb26MrGzdsFuRPbOBWOtCoi8a2ZA9D1nKeIYV2tXv4VIqo0GVQVKGs1_Bv]jbabich@p...[/url
> Sent: Monday, March 13, 2000 12:58 PM
> To: basicstamps@egroups.com
> Subject: [noparse][[/noparse]basicstamps] LCD
>
>
> Does anyone know of a good general purpose LCD that would not require to
> much work to attach to a Stamp. The LCD would need to display a two
> digit number, and maybe a sentence.
> thanks
>
>
>
> -- Check out your group's private Chat room
> -- http://www.egroups.com/ChatPage?listName=basicstamps&m=1
>
for the BS1 and BS2 (among others). I think you'll find what
you're looking for.
http://www.hth.com/filelibrary/00INDEX.TXT
http://www.hth.com/filelibrary/BS1-IC/
http://www.hth.com/filelibrary/BS2-IC/
Cheers,
Steve
<< has anyone example code for a 16*2 lcd display? the display is not!
serial,
but has 8 parallel lines (14 pins in total, hitachi compliant). >>
code
that I wrote whilst learning how to use it.
'=====================================================================
=====*
' Liquid Crystal Display and RTC routine
*
'
*
'=====================================================================
=====*
' BS2-IC Connections:
'
' Pin 0 LCD.11 |
' Pin 1 LCD.12 |-- OutA
' Pin 2 LCD.13 |
' Pin 3 LCD.14 |
' Pin 4 LCD.4
' Pin 5 LCD.6
' Pin 6 DS275 Serin
' Pin 7 DS275 Serout
' Pin 8 LTC1298 (CS\)
' Pin 9 LP2951 (SHD\)
' Pin 10 NJU6355 (I/O)
' Pin 11 NJU6355 (CE)
' Pin 12 X25128 U2 (CS\) EEPROM 0
' Pin 13 X25128 U3 (CS\) EEPROM 1
' Pin 14 DATA I/O for serial peripherals
' Pin 15 CLK for serial peripherals
'
[noparse][[/noparse] Constants
]
'
True CON 1
False CON 0
' LCD control pins
'
E CON 5 ' LCD enable pin (1 = enabled)
RS CON 4 ' Register Select (0 =
instruction)
' RTC control pin
'
CE CON 11 ' Chip Enable pin
CLK CON 15 ' Clocking pin
D_ata CON 14 ' Data I/O pin
IO CON 10 ' Read / Write control pin
' LCD control characters
'
ClrLCD CON $01 ' clear the LCD
CrsrHm CON $02 ' move cursor to home position
CrsrLf CON $10 ' move cursor left
CrsrRt CON $14 ' move cursor right
DispLf CON $18 ' shift displayed chars left
DispRt CON $1C ' shift displayed chars right
'
[noparse][[/noparse] Variables
]
'
' LCD variables
'
char VAR Byte ' char sent to LCD
loop1 VAR Byte ' loop counter
'
' RTC variables
time VAR Byte(7) ' 7 Byte Array for holding
the
time
temps VAR Byte ' Working variable
temp2 VAR Byte ' Working variable
index VAR Nib ' Index counter
serData VAR Byte ' Byte Received in 10 byte
Array
sum VAR Byte ' Expermient ing with maths
and debug
remand VAR Byte
'
[noparse][[/noparse] LCD 2 Line Data
]
'
' Customise Display characters
'
Line1 DATA
$48,$65,$6C,$6C,$6F,$20,$41,$6C,$65,$78,$20,$26,$20,$20,$20,$20
'
' T i m e sp sp bl sp bl bl : bl bl
:
bl bl
'
'
Line2 DATA
$41,$6E,$64,$79,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20
'
'
'
' bl bl sp bl bl sp 1 9 bl bl
sum = 9/6
remand = 9//6
debug ?(sum),?(remand)
'
[noparse][[/noparse] Initialization
]
'
Init: DirL = %11111111 ' LCD pins
DirH = %11111111 ' Upper 8 pins
Outs = $0000 ' all outputs off to start
GOSUB I_LCD ' Initialise LCD
'
[noparse][[/noparse] Subroutines
]
'
' Initialize the LCD (Hitatchi HD44780 controller)
'
I_LCD:
OutA = %0011 ' Function set 8-bit mode
PULSOUT E, 1
PAUSE 5
PULSOUT E, 1
PULSOUT E, 1
OutA = %0010 ' Function set 4-bit mode
PULSOUT E, 1
char = %00101000 ' Function set: 4-bit mode, 2
line Display
GOSUB WrLCD
char = %00001100 ' Display :1 D C B;disp on,
crsr off, blink off
GOSUB WrLCD
char = %00000110 ' Entry mode: inc crsr, no
disp shift
GOSUB WrLCD
char = %00000001 ' clear LCD
GOSUB WrLCD
HIGH RS ' LCD to character mode
' download Line1 to LCD
'
char = $80 ' Start location for Logo
GOSUB LCDcmd ' prepare to write CG data
FOR loop1 = 0 TO 15 ' build 8 custom chars
READ Line1 + loop1, char ' get byte from Line1 Data
GOSUB WrLCD ' put into LCD CG RAM
NEXT
' download Line2 to LCD
'
char = $C0 ' Start location for Logo
GOSUB LCDcmd ' prepare to write CG data
FOR loop1 = 0 TO 15 ' build 8 custom chars
READ Line2 + loop1, char ' get byte from Line2 Data
GOSUB WrLCD ' put into LCD CG RAM
NEXT
Char = CrsrHm
GOSUB LCDcmd
RETURN
' send command byte to LCD
'
LCDcmd: LOW RS ' RS low = command
GOSUB WrLCD ' send the byte
HIGH RS ' return to character mode
RETURN
' Write ASCII char to LCD
'
WrLCD:
OutA = char >> 4 ' output high nibble
PULSOUT E, 1 ' strobe the Enable line
OutA = char ' output low nibble
PULSOUT E, 1
RETURN
' Writing Keypad Value to LCD
'
LCD: DIRS =%00111111
GOSUB WrLCD
debug char
RETURN
' More then 16 Chracters on LCD, then back to location 1
'
c_Home:
Char = CrsrHm ' Cursor back to location 1 on
line 1
GOSUB LCDcmd
RETURN
RTN. www.nollet.com.au
Original Message
From: Pieter-Jan van Diepen <diepenpj@h...>
To: <basicstamps@egroups.com>
Sent: Wednesday, October 11, 2000 6:54 PM
Subject: [noparse][[/noparse]basicstamps] lcd
> has anyone example code for a 16*2 lcd display? the display is not!
serial,
> but has 8 parallel lines (14 pins in total, hitachi compliant).
>
> The ic can run in 4 or 8 bits mode.
>
> thanks!!
>
> pjeetje
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
>
but has 8 parallel lines (14 pins in total, hitachi compliant).
The ic can run in 4 or 8 bits mode.
thanks!!
pjeetje
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
but i don't know the way to do it.
Terminal functio are :
Vss, Vdd, Cs, Sid,CLk,Sod
I read the book from christian Tavernier but it's not ok
I need the connections and programm
If you could help me it will be grate
I apologize for my english
I would like to be able to use it with my BS1 but im not quite sure
how to start.
The LCD pins are as follows:
1 FGND Frame Ground (connected to metal bezel)
2 GND Ground (signal)
3 V DD Power Supply for logic (5V)
4 V Power Supply for LCD Drive
5 WR Data Write
6 RD Data Read
7 CE Chip Enable
8 C/D
WR = "L", C/D = "H": Command Write
WR = "L", C/D = "L": Data Write
RD = "L", C/D = "H": Status Read
RD = "L", C/D = "L": Data Read
10 RESET Controller Reset
11 D0 Data Input/Output
12 D1 Data Input/Output
13 D2 Data Input/Output
14 D3 Data Input/Output
15 D4 Data Input/Output
16 D5 Data Input/Output
17 D6 Data Input/Output
18 D7 Data Input/Output
I do not know which pins I should hook up to the stamp since there
are more pins on the LCD than on the stamp. Also, if anyone has any
code for initializing or running this LCD, please share it with me.
Thanks
I just had a quick look at the specs on the BS1 and the only way I can
think of is to use a shift register.
The basic idea is to wire d0-d7 to the BS1 and shift out the byte to the
display and then toggle the correct read/write/cd lines. The WR & RD lines
are always opposite of each other so you could tie both WR & RD to one BS1
pin and use an inverter on one line so thats one less BS1 pin to worry
about. Also from memory, the CE line can be enabled all the time
The T6963C is quite easy to talk to after you read the data sheet a few
hundred times. :-)
Regards
Jean-Michel.
>I have an AND1013ST-EO LCD display with a Toshiba T6963C controller.
>I would like to be able to use it with my BS1 but im not quite sure
>how to start.
>The LCD pins are as follows:
>1 FGND Frame Ground (connected to metal bezel)
>2 GND Ground (signal)
>3 V DD Power Supply for logic (5V)
>4 V Power Supply for LCD Drive
>5 WR Data Write
>6 RD Data Read
>7 CE Chip Enable
>8 C/D
> WR = "L", C/D = "H": Command Write
> WR = "L", C/D = "L": Data Write
> RD = "L", C/D = "H": Status Read
> RD = "L", C/D = "L": Data Read
>10 RESET Controller Reset
>11 D0 Data Input/Output
>12 D1 Data Input/Output
>13 D2 Data Input/Output
>14 D3 Data Input/Output
>15 D4 Data Input/Output
>16 D5 Data Input/Output
>17 D6 Data Input/Output
>18 D7 Data Input/Output
>
>I do not know which pins I should hook up to the stamp since there
>are more pins on the LCD than on the stamp. Also, if anyone has any
>code for initializing or running this LCD, please share it with me.
>
>Thanks
>
>
>
shift out the byte to the shift register from the BS1.
>Hi Joel,
>
>I just had a quick look at the specs on the BS1 and the only way I can
>think of is to use a shift register.
>
>The basic idea is to wire d0-d7 to the BS1 and shift out the byte to the
>display and then toggle the correct read/write/cd lines. The WR & RD lines
>are always opposite of each other so you could tie both WR & RD to one BS1
>pin and use an inverter on one line so thats one less BS1 pin to worry
>about. Also from memory, the CE line can be enabled all the time
>
>The T6963C is quite easy to talk to after you read the data sheet a few
>hundred times. :-)
>
>Regards
>Jean-Michel.
>
>
> >I have an AND1013ST-EO LCD display with a Toshiba T6963C controller.
> >I would like to be able to use it with my BS1 but im not quite sure
> >how to start.
> >The LCD pins are as follows:
> >1 FGND Frame Ground (connected to metal bezel)
> >2 GND Ground (signal)
> >3 V DD Power Supply for logic (5V)
> >4 V Power Supply for LCD Drive
> >5 WR Data Write
> >6 RD Data Read
> >7 CE Chip Enable
> >8 C/D
> > WR = "L", C/D = "H": Command Write
> > WR = "L", C/D = "L": Data Write
> > RD = "L", C/D = "H": Status Read
> > RD = "L", C/D = "L": Data Read
> >10 RESET Controller Reset
> >11 D0 Data Input/Output
> >12 D1 Data Input/Output
> >13 D2 Data Input/Output
> >14 D3 Data Input/Output
> >15 D4 Data Input/Output
> >16 D5 Data Input/Output
> >17 D6 Data Input/Output
> >18 D7 Data Input/Output
> >
> >I do not know which pins I should hook up to the stamp since there
> >are more pins on the LCD than on the stamp. Also, if anyone has any
> >code for initializing or running this LCD, please share it with me.
> >
> >Thanks
> >
> >
> >
>
>
>
like to know how to connect it to the BS2.
Another thing,, does anyone know how to connect a pc
keyboard to a Basic Stamp?
Thanks
Alex
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
Stamp. It is extremely simple, requires no modifications of any kind to your
serial cable, and for me works perfectly. If you want the info contact me
off line.
Sid
Newzed@a...
Does anyone know if a hitachi GB1494V-0S LCD Display can be connected
to a stamp2sx?
I pulled one from a HP LaserjetIII printer and was wondering if I can
use it.
TIA.
Doug
However, for the keyboard check out:
http://www.al-williams.com/awce/pak6.htm
Al Williams
AWC
* Coming soon.... the PAK-IX (A/D + floating point math in one package).
http://www.al-williams.com/awce
>
Original Message
> From: Alejandro Vazquez [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=bn2Rs6vEZrDf5H7-c-dD38l9o5zBxHG6_HIhWA_bnvt7e-o2a6UMHisumNFWd3HS93-vnOWr3xHaCV4]alexvazquez@y...[/url
> Sent: Sunday, April 01, 2001 1:16 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] LCD
>
>
> I bought the LM 211 LCD 480 x 64 from BGMICRO, I would
> like to know how to connect it to the BS2.
>
> Another thing,, does anyone know how to connect a pc
> keyboard to a Basic Stamp?
>
> Thanks
> Alex
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/?.refer=text
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
·········Does anybody knows where I can find a serial display at a resonable
price.....[/font]
LCD from Marlin P Jones -- I've been mucking with this thing for several
hours and still can't display an english character.
Original Message
> Does anybody knows where I can find a serial display at a
resonable
> price.....
>
stock... Let me know if ·you figure it out.... ·····[/font]
Chris
Original Message
From: ARTICALEX@AOL.COM
To: basicstamps@yahoogroups.com
Sent: Sunday, June 10, 2001 10:25 AM
Subject: [noparse][[/noparse]basicstamps] Lcd
[font=arial,helvetica]Hi guys,
·········Does anybody knows where I can find a serial display at a resonable
price.....
To UNSUBSCRIBE, just send mail to:
· basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed with.· Text in the Subject and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[/font]
Hans Luyten
Webmaster http://www.weethet.nl
Original Message
From: ARTICALEX@AOL.COM [noparse][[/noparse]mailto:ARTICALEX@AOL.COM]
Sent: zondag 10 juni 2001 4:25
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Lcd
[font=arial,helvetica]Hi guys,
·········Does anybody knows where I can find a serial display at a resonable
price.....
To UNSUBSCRIBE, just send mail to:
· basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed with.· Text in the Subject and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[/font]
> Does anybody knows where I can find a serial display at a resonable
> price.....
>
Have a look at our Econo LCD Kit. The kit is a small board you solder
together that converts any 2x16, 2x20, 2x40 or 4x20 LCD into a serial LCD
that you can connect directly to a Stamp or other micro.
As for 'cheap', we prefer 'inexpensive' -the kit is just $23.95 US
see: http://www.hvwtech.com/econo-lcd.htm
Mark Hillier, VE6HVW
President, HVW Technologies Inc.
Canadian Distributors of Parallax Products and other Neat Stuff
Tel: (403)-730-8603 Fax: (403)-730-8903
See our NEW BASIC Stamp Prototyping tools !
http://www.hvwtech.com/stampstack.htm
I have a Truly 128x64 graphical LCD, model MG-12864-1. Which has a
Samsung KS107B controller and 2 KS108B drivers. Like I said in my
previous email I'm not sure how to interface the display and make the
stamp control it. I guess I didn't provide enough info in the
previous email, so here is more info:
KS107B:
http://www.usa.samsungsemi.com/products/prodspec/graflcd/ks0107b.pdf
KS108B:
http://www.usa.samsungsemi.com/products/prodspec/graflcd/ks0108b.pdf
General Specs on the LCD:
http://www.truly.net/lcd/dt12864-1.htm
Like I said before I do have the complete specs sheet for it in pdf
format.
Any help is appreciated.
Thanks,
Chris Shuster
This oughta work. I tried to make minimal changes to the original
BS1 program.
Steve
'{$STAMP BS2sx}
' PROGRAM: Terminal.bsx
' The Stamp serves as a user-interface terminal. It accepts text via RS-232 from
a
' host, and provides a way for the user to respond to queries via four
pushbuttons.
S_in CON 7 ' Serial data input pin
S_out CON 6 ' Serial data output pin
E CON 5 ' Enable pin, 1 = enabled
RS CON 4 ' Register select pin, 0 = instruction
keys VAR BYTE ' Variable holding # of key pressed.
char VAR BYTE ' Character sent to LCD.
Sw_0 VAR IN0 ' User input switches
Sw_1 VAR IN1 ' multiplexed w/LCD data lines.
Sw_2 VAR IN2
Sw_3 VAR IN3
' Set up the Stamp's I/O lines and initialize the LCD.
begin:
OUTL = 0 ' Clear the output lines
DIRL = %01111111 ' One input, 7 outputs.
pause 200 ' Wait 200 ms for LCD to reset.
' Initialize the LCD in accordance with Hitachi's instructions for 4-bit
interface.
i_LCD:
OUTL = %00000011 ' Set to 8-bit operation.
pulsout E,1 ' Send data three times
pause 10 ' to initialize LCD.
pulsout E,1
pause 10
pulsout E,1
pause 10
OUTL = %00000010 ' Set to 4-bit operation.
pulsout E,1 ' Send above data three times.
pulsout E,1
pulsout E,1
char = 14 ' Set up LCD in accordance with
gosub wr_LCD ' Hitachi instruction manual.
char = 6 ' Turn on cursor and enable
gosub wr_LCD ' left-to-right printing.
char = 1 ' Clear the display.
gosub wr_LCD
high RS ' Prepare to send characters.
' Main program loop: receive data, check for backspace, and display data on LCD.
main:
serin S_in,17405,[noparse][[/noparse]char] ' Main terminal loop.
goto backspace
out: gosub wr_LCD
goto main
' Write the ASCII character in b3 to LCD.
wr_LCD:
OUTA = char/16 ' Put high nibble of char into pins
pulsout E,1 ' Blip enable pin.
OUTA = char ' Put low nibble of char into pins
pulsout E,1 ' Blip enable.
return
' Backspace, rub out character by printing a blank.
backspace:
if char > 13 then out ' Not a bksp or cr? Output character.
if char = 3 then clear ' Ctl-C clears LCD screen.
if char = 13 then cret ' Carriage return.
if char <> 8 then main ' Reject other non-printables.
gosub back
char = 32 ' Send a blank to display
gosub wr_LCD
gosub back ' Back up to counter LCD's auto-increment.
goto main ' Get ready for another transmission.
back:
low RS ' Change to instruction register.
char = 16 ' Move cursor left.
gosub wr_LCD ' Write instruction to LCD.
high RS ' Put RS back in character mode.
return
clear:
low RS ' Change to instruction register.
char = 1 ' Clear the display.
gosub wr_LCD ' Write instruction to LCD.
high RS ' Put RS back in character mode.
goto main
' If a carriage return is received, wait for switch input from the user. The
host
' program (on the other computer) should cooperate by waiting for a reply before
' sending more data.
cret:
DIRL = %01110000 ' Change LCD data lines to input.
loop:
keys = 0
if Sw_0 = 1 then xmit ' Add one for each skipped key.
keys = keys + 1
if Sw_1 = 1 then xmit
keys = keys + 1
if Sw_2 = 1 then xmit
keys = keys + 1
if Sw_3 = 1 then xmit
goto loop
xmit:
serout S_out,17405,[noparse][[/noparse]DEC keys,10,13]
DIRL = %01111111 ' Restore I/O pins to original state.
goto main
In the Stamp M1nual 1.9, on page 71, it describes how to use an
LCD display with the Hitachi 44780 controller. I have a display of
the type and I have a Stamp2SX and want to use this display with
it. I have been unable to modify the program that came with the
Stamp2SX on the Parallax CD to drive this display. The program is
written for a Stamp I and won't download to the Stamp2SX.
Can anyone help me with this?
Thanks.
Doug Simpson
veewee77@a... writes:
> In the Stamp M1nual 1.9, on page 71, it describes how to use an
> LCD display with the Hitachi 44780 controller. I have a display of
> the type and I have a Stamp2SX and want to use this display with
> it. I have been unable to modify the program that came with the
> Stamp2SX on the Parallax CD to drive this display. The program is
> written for a Stamp I and won't download to the Stamp2SX.
>
>
Go to the Parallax web site and download the StampWorks experiments (#s 11,
12 & 13) for LCDs. There is BS2sx source code available for downloading on
the StampWorks product page.
http://www.parallaxinc.com/html_files/resources/stampworks_experiments.htm
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
Try this, it's about as stripped down as I can get it. You should
see a blank display with blinking cursor for about 5 seconds, then
the letter 'A' should appear. Works fine with my BS2SX and 4x20
Optrex LCD. Add complexity when you get this working.
Regarding your module pin numbering, look closely (on both sides)
for a '1' or '14' at either end of the row of pins. If that doesn't
pan out, try to follow the PCB traces from what you suspect are pins
9 through 14--they should go to consecutive pins located along the
top edge of your HD44780, as viewed looking at the (correctly oriented)
printing on the top of the chip. Connector pins 4 thru 7 go to
consecutive HD44780 pins along the right edge of the chip.
Make sure your Stamp's and module's grounds are connected. You can
simply connect module pin 3 to ground to get max contrast and do
away with the pot. Make sure module pins 1 and 5 are also connected to
ground, and pin 2 is connected to +5V. The RS and E connections are
as shown below.
I hope that helps get you going.
Regards,
Steve
'{$STAMP BS2sx}
' __________
' SER TX <-| 1 24 |-- PWR
' SER RX ->| 2 23 |-- GND
' SER ATN ->| 3 22 |-- RESET
' SER GND --| 4 21 |-- +5V
' lcd d4 I/O 0 <-| 5 20 |--
' lcd d5 I/O 1 <-| 6 19 |--
' lcd d6 I/O 2 <-| 7 18 |--
' lcd d7 I/O 3 <-| 8 17 |--
' RS I/O 4 <-| 9 16 |--
' E I/O 5 <-| 10 15 |--
' I/O 6 --| 11 14 |--
' I/O 7 --| 12 13 |--
' |__________|
'
' BS2-IC
OUTS = %0000000000100000
DIRS = %0000000000111111
lcd_rs CON 4
lcd_en CON 5
PAUSE 100
OUTA = %0011
PULSOUT lcd_en,1: PAUSE 2
PULSOUT lcd_en,1: PAUSE 2
PULSOUT lcd_en,1: PAUSE 2
OUTA = %0010 : PULSOUT lcd_en,1: PAUSE 2 '4-bit mode
OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'display on, visible+blinking cursor
OUTA = %1111 : PULSOUT lcd_en,1: PAUSE 2
OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'cursor adv right, shift not
OUTA = %0110 : PULSOUT lcd_en,1: PAUSE 2
OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'clear screen, allow extra time to
complete
OUTA = %0001 : PULSOUT lcd_en,1: PAUSE 5
HIGH lcd_rs ' subsequent data will be characters
main:
PAUSE 5000
OUTA = "A" >> 4: PULSOUT lcd_en, 1
OUTA = "A": PULSOUT lcd_en, 1
STOP
Find answer hereafter:
'{$STAMP BS2SX}
'BS2sx to HD44780 LCD, using 4+2 pins
'BS2sx to LCD
'bit0 pin11 = bit4
'bit1 pin12 = bit5
'bit2 pin13 = bit6
'bit3 pin14 = bit7
'bit4 pin04 = select
'bit5 pin06 = enable
' pin05 = R/W = Vss
' pin01 = Vss
' pin02 = Vdd
' pin03 = contrast
char var byte 'character to write
indx var nib
Msg DATA " PARALLAX BS2sx " 'message
init:
DIRL = %00111111 '6 LSB = outputs
pause 500
OUTL = %000011 'Initialize by
pulsout 5,50 'sending this pattern
pause 5 '3 times for 40 µS
pulsout 5,50
pulsout 5,60
OUTL = %0010 'Function set:4bits
pulsout 5,50
char = %00101000 '2 lines
gosub comm
char = %00001110 'disp on,cursor on,blink off
'char = %00001101 'disp on,cursor off,blink on
gosub comm
char = %00000110 'set increment,no shift
gosub comm
outmsg:
char = %00000010 'cursor home 1st block
gosub comm
for indx = 0 to 15 'get message from EEPROM
read (Msg + indx),char 'read a character
gosub writ 'write it
if indx <> 7 then nxtc
char = %11000000 'cursor home 2nd block
gosub comm
nxtc:
next
pause 1000
clear:
char = %00000001 'clear the display
gosub comm
loop:
char = %00000010 'cursor home 1st block
gosub comm
for indx = 0 to 15
serin 16,240,[noparse][[/noparse]char] 'get a character from PC
if char=$0D then clear 'if CR then clear screen
gosub writ 'write it on LCD
if indx <> 7 then nxtcc
char = %11000000 'cursor home 2nd block
gosub comm
nxtcc:
next
goto loop 'redo
comm:
OUT4 = 0 'select instructions
writ:
OUTA = char.highnib 'put high nibble in output
pulsout 5,50 'enable for 40µS
OUTA = char.lownib 'put low nibble in output
pulsout 5,50 'enable for 40µS
OUT4 = 1 'select characters
return
Original Message
From: <veewee77@a...>
To: <basicstamps@yahoogroups.com>
Sent: Sunday, September 02, 2001 4:17 AM
Subject: [noparse][[/noparse]basicstamps] LCD
> Hi all!
> In the Stamp M1nual 1.9, on page 71, it describes how to use an
> LCD display with the Hitachi 44780 controller. I have a display of
> the type and I have a Stamp2SX and want to use this display with
> it. I have been unable to modify the program that came with the
> Stamp2SX on the Parallax CD to drive this display. The program is
> written for a Stamp I and won't download to the Stamp2SX.
>
> Can anyone help me with this?
>
> Thanks.
>
> Doug Simpson
deeply into the documentation for your particular LCD. Or maybe find
some and then dig into it. They don't all work exactly alike,
despite having the HD44780 controller in common.
To clear your display, use again the "clear screen" code shown at
the bottom of the initialization. Note you must send the command as
a command vice character, by manipulating the RS pin. Your
documentation should be useful to make further sense out of all this
and the other commands available to you.
I don't see why you are running into an 8-character barrier. Maybe
something specific to your LCD (8 positions wide?).
If you have trouble finding a data sheet or whatever for your LCD
module, perhaps others can help if you post a detailed description
(manufacturer, model #, etc.). You may also find this site useful:
http://home.iae.nl/users/pouweha/lcd/lcd.shtml
Lots and lots of generic HD44780 info and code examples.
Regards,
Steve
This code doesn't wotk. Downloads fine but no display.
Actually I just need to be able to pull data from memory and dislay
it. But I can't get the display to show anything at all. Have tried
two different display modules to no avail.
Any ideas? Could it be a wiring problem? I have followed the
diagram on page 71 of the stamp manual 1.9 and checked and re-
checked it.
Is pin 1 of the display the one closest to the end of the module?
Thanks for all your help.
On 2 Sep 2001, at 9:16, ECO wrote:
> Doug
>
> Find answer hereafter:
>
> '{$STAMP BS2SX}
> 'BS2sx to HD44780 LCD, using 4+2 pins
>
> 'BS2sx to LCD
> 'bit0 pin11 = bit4
> 'bit1 pin12 = bit5
> 'bit2 pin13 = bit6
> 'bit3 pin14 = bit7
> 'bit4 pin04 = select
> 'bit5 pin06 = enable
> ' pin05 = R/W = Vss
> ' pin01 = Vss
> ' pin02 = Vdd
> ' pin03 = contrast
>
> char var byte 'character to write
> indx var nib
>
> Msg DATA " PARALLAX BS2sx " 'message
>
> init:
> DIRL = %00111111 '6 LSB = outputs
> pause 500
> OUTL = %000011 'Initialize by
> pulsout 5,50 'sending this pattern
> pause 5 '3 times for 40 µS
> pulsout 5,50
> pulsout 5,60
> OUTL = %0010 'Function set:4bits
> pulsout 5,50
> char = %00101000 '2 lines
> gosub comm
> char = %00001110 'disp on,cursor on,blink off
> 'char = %00001101 'disp on,cursor off,blink on
> gosub comm
> char = %00000110 'set increment,no shift
> gosub comm
>
> outmsg:
> char = %00000010 'cursor home 1st block
> gosub comm
> for indx = 0 to 15 'get message from EEPROM
> read (Msg + indx),char 'read a character
> gosub writ 'write it
> if indx <> 7 then nxtc
> char = %11000000 'cursor home 2nd block
> gosub comm
> nxtc:
> next
> pause 1000
>
> clear:
> char = %00000001 'clear the display
> gosub comm
>
> loop:
> char = %00000010 'cursor home 1st block
> gosub comm
> for indx = 0 to 15
> serin 16,240,[noparse][[/noparse]char] 'get a character from PC
> if char=$0D then clear 'if CR then clear screen
> gosub writ 'write it on LCD
> if indx <> 7 then nxtcc
> char = %11000000 'cursor home 2nd block
> gosub comm
> nxtcc:
> next
> goto loop 'redo
>
> comm:
> OUT4 = 0 'select instructions
> writ:
> OUTA = char.highnib 'put high nibble in output
> pulsout 5,50 'enable for 40µS
> OUTA = char.lownib 'put low nibble in output
> pulsout 5,50 'enable for 40µS
> OUT4 = 1 'select characters
> return
>
>
>
Original Message
> From: <veewee77@a...>
> To: <basicstamps@yahoogroups.com>
> Sent: Sunday, September 02, 2001 4:17 AM
> Subject: [noparse][[/noparse]basicstamps] LCD
>
>
> > Hi all!
> > In the Stamp M1nual 1.9, on page 71, it describes how to use an LCD
> > display with the Hitachi 44780 controller. I have a display of the
> > type and I have a Stamp2SX and want to use this display with it. I
> > have been unable to modify the program that came with the Stamp2SX
> > on the Parallax CD to drive this display. The program is written
> > for a Stamp I and won't download to the Stamp2SX.
> >
> > Can anyone help me with this?
> >
> > Thanks.
> >
> > Doug Simpson
>
>
>
> 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.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
(and others)
Here is some code. I can get the display to show 8 characters and
no more. What is the 'key' to making the display usable?
The code I gave you displays the word "Parallax". I can get
spaces, and several other characters to display.
How can I clear the screen and display another set of characters.
And how can I get more than 8 characters displayed at a time?
Thank you for all your help.
Doug
************************
Code Follows
************************
'{$STAMP BS2sx}
' __________
' SER TX <-| 1 24 |-- PWR
' SER RX ->| 2 23 |-- GND
' SER ATN ->| 3 22 |-- RESET
' SER GND --| 4 21 |-- +5V
' lcd d4 I/O 0 <-| 5 20 |--
' lcd d5 I/O 1 <-| 6 19 |--
' lcd d6 I/O 2 <-| 7 18 |--
' lcd d7 I/O 3 <-| 8 17 |--
' RS I/O 4 <-| 9 16 |--
' E I/O 5 <-| 10 15 |--
' I/O 6 --| 11 14 |--
' I/O 7 --| 12 13 |--
' |__________|
'
' BS2-IC
OUTS = %0000000000100000
DIRS = %0000000000111111
lcd_rs CON 4
lcd_en CON 5
PAUSE 100
OUTA = %0011
PULSOUT lcd_en,1: PAUSE 2
PULSOUT lcd_en,1: PAUSE 2
PULSOUT lcd_en,1: PAUSE 2
OUTA = %0010 : PULSOUT lcd_en,1: PAUSE 2 '4-bit mode
OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'display on,
visible+blinking cursor
OUTA = %1111 : PULSOUT lcd_en,1: PAUSE 2
OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'cursor adv right,
shift not
OUTA = %0110 : PULSOUT lcd_en,1: PAUSE 2
OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'clear screen,
allow extra time to complete
OUTA = %0001 : PULSOUT lcd_en,1: PAUSE 5
HIGH lcd_rs ' subsequent data will be characters
main:
PAUSE 1000
OUTA = "P" >> 4: PULSOUT lcd_en, 1
OUTA = "P": PULSOUT lcd_en, 1
OUTA = "a" >> 4: PULSOUT lcd_en, 1
OUTA = "a": PULSOUT lcd_en, 1
OUTA = "r" >> 4: PULSOUT lcd_en, 1
OUTA = "r": PULSOUT lcd_en, 1
OUTA = "a" >> 4: PULSOUT lcd_en, 1
OUTA = "a": PULSOUT lcd_en, 1
OUTA = "l" >> 4: PULSOUT lcd_en, 1
OUTA = "l": PULSOUT lcd_en, 1
OUTA = "l" >> 4: PULSOUT lcd_en, 1
OUTA = "l": PULSOUT lcd_en, 1
OUTA = "a" >> 4: PULSOUT lcd_en, 1
OUTA = "a": PULSOUT lcd_en, 1
OUTA = "x" >> 4: PULSOUT lcd_en, 1
OUTA = "x": PULSOUT lcd_en, 1
STOP