16x2 parallel LCD help
Ok, my issue is: I have a 16x2 parallel LCD module. I have is wired like so:
(where as the left side is the BS2 pins and the right side is the LCD pins)
Ok, I am using the following code (example from www.weethet.nl/english/basicstamp2_lcdcontrol.php)
So, my problem is, the first line displays "Basic Stamp 2 LC" and does not continue the remaining "D in action" in the next line. Is there anyone here who is experienced at all with LCD's who can help me?
the exact LCD I'm using is this one
thank you very much,
Justin
Vss (GND)---------------------1 (GND), 3 (Vee), 5 (R/W) Vdd (+5V)---------------------2 (+5V) pin 0-------------------------11 (DB4) pin 1-------------------------12 (DB5) pin 2-------------------------13 (DB6) pin 3-------------------------14 (DB7) pin 4-------------------------4 (RS) pin 5-------------------------6 (E)
(where as the left side is the BS2 pins and the right side is the LCD pins)
Ok, I am using the following code (example from www.weethet.nl/english/basicstamp2_lcdcontrol.php)
'{$STAMP BS2}
'{$PBASIC 2.5}
' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
' Ports used
RS CON 4 ' Register Select (1 = char)
E CON 5 ' LCD Enable pin (1 = enabled)
' 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
DDRam CON $80 ' Display Data RAM control
' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
'
char VAR Byte ' character sent to LCD
index VAR Byte ' loop counter
' -----[noparse][[/noparse] EEPROM Data ]-----------------------------------------------------
'
Msg DATA "BASIC Stamp 2 LCD in action" ' preload message
' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
'
Init: DirL = %00111111 ' set pins 0-5 as outputs
Outs = $0000 ' clear the pins
' Initialize the LCD (Hitachi HD44780 controller)
'
LCDinit: pause 500 ' Wait for LCD init
' =================================
' STANDARD HITACHI 44780 4-BIT INIT
' =================================
char=%00000011 ' Set 8-bit mode (1)
GOSUB LCDcmd
char=%00000011 ' Set 8-bit mode (2)
GOSUB LCDcmd
char=%00000011 ' Set 8-bit mode (3)
GOSUB LCDcmd
char=%00000010 ' Set 4-bit mode
GOSUB LCDcmd
char=%00101111 ' Set duty cycle 11xx = 5x11 matrix
GOSUB LCDcmd ' 10xx = 5x8 matric
char=%00000000 ' Display control mode
GOSUB LCDcmd
char=%00001000 ' Set display OFF, cursor OFF, blink OFF
GOSUB LCDcmd
char=%00000000 ' Display control mode
GOSUB LCDcmd
char=%00001111 ' Set display ON, cursor ON, blink ON
GOSUB LCDcmd ' 11CB -> C=1 cursor on, B=1 blink on
char=%00000000 ' Entry control mode
GOSUB LCDcmd
char=%00000110 ' Set cursor right, no display shift
GOSUB LCDcmd ' 01IS -> I=1 cursor right, S=1 shift display
char = ClrLCD ' Clear LCD
GOSUB LCDcmd
' -----[noparse][[/noparse] Main Code ]-------------------------------------------------------
'
Start:
FOR index = 0 TO 39
READ Msg + index, char ' get character from memory
GOSUB LCDwr ' write it to the LCD
NEXT
PAUSE 1000 ' wait 2 seconds
char = ClrLCD ' clear the LCD
GOSUB LCDcmd
PAUSE 500
GOTO Start ' do it all over
' -----[noparse][[/noparse] Subroutines ]-----------------------------------------------------
'
' Send command to the LCD
'
LCDcmd: LOW RS ' enter command mode
'
' Write ASCII char to LCD
'
LCDwr:
OutA = char.HIGHNIB ' output high nibble
PULSOUT E, 1 ' strobe the Enable line
OutA = char.LOWNIB ' output low nibble
PULSOUT E, 1
HIGH RS ' return to character mode
RETURN
So, my problem is, the first line displays "Basic Stamp 2 LC" and does not continue the remaining "D in action" in the next line. Is there anyone here who is experienced at all with LCD's who can help me?
the exact LCD I'm using is this one
thank you very much,
Justin

Comments
I noticed some differences in your circuit and program, but I don't know if they're significant. Pins 7, 8, 9 and 10 on the LCD are all connected to ground on issue #31. Secondly, the initialization code is different - specifically there's a PAUSE 5 command in the middle of the 8-bit initialization routine.
Why is it looping for 40 iterations (0 to 39) when there's only 27 characters in the string?
[noparse][[/noparse]edit] oh yeah, the reason it's looping for 40 iterations is because that's the demo code, the person was working with a larger display. In my modification of has code, I actually did change it. [noparse][[/noparse]/edit]
Post Edited (Whelzorn) : 2/5/2005 3:12:34 PM GMT