My lcd dont work
BasicStamped
Posts: 12
Hi, i have Parallax experiment kit i want to connect my lcd but when i connect it and write a program it wont work plese help!!
Comments
Can you provide more details on this LCD display.
1) 2x16 Serial or 4x20 Serial displays have three pin header on the back of the display. This header provides RX (serial), +5VDC, GND (ground) which matches a standard servo cable
2) The 2x16 Parallel LCD displays uses a 6-inch ribbon cable with 14-pin connector to provide the communication via 4-bit or 8-bit parallel interface and the +5VDC for power. This display goes well with the Parallax Professional Development Board (#28138), because it plugs directly into it. But, can be used with the other boards such as Parallax Board of Education or Parallax Homework board. This means that you have to use jumper wires to match the pins on the display to pins on the microcontroller using the prototyping board.
These displays can be found here http://www.parallax.com/Store/Accessories/DisplayVideo/tabid/159/CategoryID/34/List/0/Level/a/SortField/0/Default.aspx which has links to the documents and demo code.
The common problems with serial displays is plugging the servo cable into the 3 pin header wrong and this causes the display not to work. What happens is, when you do this it puts the RX (serial) on the GND (ground), which grounds out the serial pin or you can put 5VDC on the wrong pin which this can damage "blue smoke" the display.
A common problem with Parallel displays is, when you don't match the pins on the display to the pins on the microcontroller and what can happen is you can have the pins on display like the power pin switched with a data line pin the display and it won't work at all or you can damage "blue smoke" the display itself or the microcontroller itself.
Another problem with both type of displays Parallel and Serial is the contrast adjustment which can make it seam that the display isn't working at all.
The best way for me to help you is to take a picture of Parallax experiment kit so I can see what you are talking about or tell us what the model number of this kit is. If, this Parallax experiment kit is Parallax Board of Education or Parallax Homework board then I will need to know the make and model of your LCD display you are working with.
BTW, have a Happy New Year.
If that's the case I can't imagine any reason why it wouldn't work, since the kit includes a power adapter and a pre-wired LCD cable with a polarized connector that will only plug in the correct way. Possibly the breadboard wiring is not been done correctly between the Basic Stamp header and the LCD header, or maybe there is a typo or some other error in the code.
Without additional details, we would just be speculating.
The Stampworks kit makes since to me now and thanks for posting. But, we haven't had another reply back from Basic Stamped. So, we will have to wait for answer before we can continue on.
Parallax experiment kit contains lcd http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/329/List/1/Default.aspx?SortField=UnitCost,ProductName or this error in code.
The code is fine. I just checked it out on my StampWorks board.
Make sure the CONTRAST knob under the X2 connector is turned fully ClockWise, (to the right when viewed from above).
Not having the contrast adjusted correctly is a normal problem with LCD displays.
Anyways thanks for help
Any chance you could provide a picture of your setup? That would help immensely.
Do you have any part numbers or pictures of your setup? If you have a Professional Development board, there should be a part number in the lower left, (28138)
The LCD you are using should be a parallel interface if you got it with the kit.
Please provide a picture and the code that you are using.
' =========================================================================
'
' File....... SW20-EX11-LCD_Demo.BS2
' Purpose.... Essential LCD control
' Author..... (C) 2000 - 2005, Parallax, Inc.
' E-mail..... support@parallax.com
' Started....
' Updated.... 01 SEP 2005
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
'
[ Program Description ]
'
' This program demonstrates essential character LCD control.
'
' The connections for this program conform to the BS2p-family LCDCMD,
' LCDIN, and LCDOUT instructions. Use this program for the BS2, BS2e,
' or BS2sx. There is a separate program for the BS2p, BS2pe, and BS2px.
'
[ I/O Definitions ]
E PIN 1 ' Enable pin
RW PIN 2 ' Read/Write
RS CON 3 ' Register Select
LcdBus VAR OUTB ' 4-bit LCD data bus
'
[ Constants ]
LcdCls CON $01 ' clear the LCD
LcdHome CON $02 ' move cursor home
LcdCrsrL CON $10 ' move cursor left
LcdCrsrR CON $14 ' move cursor right
LcdDispL CON $18 ' shift chars left
LcdDispR CON $1C ' shift chars right
LcdDDRam CON $80 ' Display Data RAM control
LcdCGRam CON $40 ' Character Generator RAM
LcdLine1 CON $80 ' DDRAM address of line 1
LcdLine2 CON $C0 ' DDRAM address of line 2
#DEFINE _LcdReady = ($STAMP >= BS2P)
'
[ Variables ]
char VAR Byte ' character sent to LCD
idx VAR Byte ' loop counter
'
[ EEPROM Data ]
Msg DATA "The BASIC STAMP!", 0 ' store message
'
[ Initialization ]
Check_Stamp:
#IF (_LcdReady) #THEN
#ERROR "Please use BS2p version: SW20-EX11-LCD_Demo.BSP"
#ENDIF
DIRL = %11111110 ' setup pins for LCD
PAUSE 100 ' let the LCD settle
Lcd_Setup:
LcdBus = %0011 ' 8-bit mode
PULSOUT E, 3
PAUSE 5
PULSOUT E, 3
PULSOUT E, 3
LcdBus = %0010 ' 4-bit mode
PULSOUT E, 1
char = %00001100 ' on, no crsr, no blink
GOSUB LCD_Cmd
char = %00000110 ' inc crsr, no disp shift
GOSUB LCD_Cmd
'
[ Program Code ]
Main:
char = LcdCls ' clear the LCD
GOSUB LCD_Cmd
PAUSE 500
idx = Msg ' get EE address of message
Write_Message:
DO
READ idx, char ' get character from EE
IF (char = 0) THEN EXIT ' if 0, message is complete
GOSUB LCD_Out ' write the character
idx = idx + 1 ' point to next character
LOOP
PAUSE 2000 ' wait 2 seconds
Cursor_Demo:
char = LcdHome ' move the cursor home
GOSUB LCD_Cmd
char = %00001110 ' turn the cursor on
GOSUB LCD_Cmd
PAUSE 500
char = LcdCrsrR
FOR idx = 1 TO 15 ' move cursor l-to-r
GOSUB LCD_Cmd
PAUSE 150
NEXT
FOR idx = 14 TO 0 ' move cursor r-to-l by
char = LcdDDRam + idx ' moving to a specific
GOSUB LCD_Cmd ' column
PAUSE 150
NEXT
char = %00001101 ' cursor off, blink on
GOSUB LCD_Cmd
PAUSE 2000
char = %00001100 ' blink off
GOSUB LCD_Cmd
Flash_Demo:
FOR idx = 1 TO 10 ' flash display
char = char ^ %00000100 ' toggle display bit
GOSUB LCD_Cmd
PAUSE 250
NEXT
PAUSE 1000
Shift_Demo:
FOR idx = 1 TO 16 ' shift display
char = LcdDispR
GOSUB LCD_Cmd
PAUSE 100
NEXT
PAUSE 1000
FOR idx = 1 TO 16 ' shift display back
char = LcdDispL
GOSUB LCD_Cmd
PAUSE 100
NEXT
PAUSE 1000
GOTO Main ' do it all over
'
[ Subroutines ]
LCD_Cmd:
LOW RS ' enter command mode
LCD_Out:
LcdBus = char.HIGHNIB ' output high nibble
PULSOUT E, 3 ' strobe the Enable line
LcdBus = char.LOWNIB ' output low nibble
PULSOUT E, 3
HIGH RS ' return to character mode
RETURN
This is where the connectors are:
Pay close attention to wiring as Rick pointed out above. The right and left sockets are not the same.
Try my code in post #8 as see if that works with a BS2.
[IMG]file:///C:/Users/One/Pictures/ss.gif[/IMG]
This resistor is built on the the Development Board, as are the 220 ohm resistors shown in the picture.
And lcd after and before same result.
As noted, the 220 ohms resistors, and 47K resistor, shown in the picture, are already soldered on the the board, the tiny black Surface Mount chips just to the left of the LCD connector, (X1).
A suggestion at this point. You may have a broken wire, (and can not see the break), or a wire is too short to make contact in the socket. I would pull out all the wiring, and re-wire using new wires. It's a simple seven wire connection and should work. The display on the your LCD shows up as if it doesn't have the correct inputs. I pulled the data line wires and it displayed as in your pictures.
Is you BS2 working properly? Can you test it by blinking LED's on P1-P7 to see if the outputs are functional? Use SW21-EX01-Flash LED.BS2 and change the program to run P1, the P2, etc. This will verify if you BS2 is working properly.
I think we have exhausted all possible problems here.
If you can provide one or two more photos with better resolution, that would help.
Other than that, it's time to call Parallax Support. After all, that'ts what they are there for.