View Full Version : LCD Confusion
09-14-2008, 09:22 PM
Hello again fellas,
I'm playing around with serial LCD and·I cant seem to get it to work.
I have tryed to use the code that Parallax gives and all·I get is Solid blocks
I·looked at the data sheet for the LCD controller and setup my INT.
but from there it gets fuzzy
sending the information to the lcd
I'm looking for a tutorial or a good explination to what exactly is going on.
in the parallax sample code it talks about sending high and low nibbles
this is what im getting lost by
any direction of help would be much apreciated
09-14-2008, 10:06 PM
First thing to check is the LCD contrast - which is controlled with a potentiometer on the back of the Parallax Serial LCD.
09-14-2008, 10:22 PM
its not that already checked that
09-14-2008, 11:01 PM
The serial LCD should work like a debug terminal your high and low nibbles you are sending are what? look here
09-14-2008, 11:05 PM
Hi, can you attach the sample code you are using, and say which·model# LCD you are using. The Parallax serial LCD accepts bytes not nibbles its possible you have the wrong code sample.
09-14-2008, 11:07 PM
Have you tried the code here? www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/SerialLCDCode-RevE.zip (http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/SerialLCDCode-RevE.zip) If this doesn't work you need to check the connections and read the setup info.
09-15-2008, 12:46 AM
Ok My fault didn't explain to you guys
I did not buy the lcd kit from parallax
I have two types of lcds and both do the exact same thing
DV-16100 (Backlight, 2 Line, KS0066U Driver)
TM161ADA (No BackLight, 1 line, HD44780 Driver)
Now I did find a site that has a simulator for the HD44780 driver chip
I can get that to work so I step by step did the same thing as the simulator to the real thing
and I get the same result.
my Pin outs INCLUDE:
I think The LCD is not getting out of INT.
Post Edited By Moderator (Chris Savage (Parallax)) : 9/15/2008 9:13:15 PM GMT
09-15-2008, 12:51 AM
In your first post you said it was a serial LCD, but what you're describing now sounds like a parallel LCD (multiple data lines, etc.).
No offense, but you know that makes a difference, right? If you're using the Serial code (SEROUT LCDpin, LCDbaud, ("This is a test", CR) with a parallel LCD, you're not going to get much.
Edit: Okay, looked at your code, and it's not the serial code. Sorry.
Post Edited (sylvie369) : 9/14/2008 5:37:32 PM GMT
09-15-2008, 01:02 AM
to tell you the truth from reading the data sheet it sounds like you can use either and im using 8 bit mode cause it seems to make more sence then 4 bit
IF I am not making any sence what so ever its because Im lost like a blind man on a bus
I do understand the diff between serial and parallel ( Pretty Sure)
09-15-2008, 01:13 AM
You can communicate in with a Parallel LCD in either 8 bit or 4 bit mode. Many folks use the 4-bit mode because it's a simpler hookup (4 less wires).
You should check out the Parallel LCD info in the StampWorks manual - which shows a hookup diagram and BS2 program examples.
Download it here www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/Level/a/ProductID/144/Default.aspx?SortField=ProductName%2cProductName (http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/Level/a/ProductID/144/Default.aspx?SortField=ProductName%2cProductName)
09-15-2008, 02:43 AM
alright cool it does work BUT
it only displays half of the text
In the example code
' -----[ Variables ]-------------------------------------------------------
char VAR Byte ' character sent to LCD
idx VAR Byte ' loop counter
' -----[ EEPROM Data ]-----------------------------------------------------
Msg DATA "The BASIC STAMP!", 0 ' store message
my LCD only displays The BASI
so I thought that the variable was not large enough for the text and changed the char from byte to word and now it's alll Crazy pixels all over
Where is it going wrong....
PS Thank you Forrest This is just what i was looking for
09-15-2008, 03:28 AM
It looks like it's displaying the 1st 8 characters then. You'll need to go through whatever documentation you have available on these displays. There may be some kind of mode setting. Perhaps there are two fonts, one for a 1 x 8 display and one for a 1 x 16 display. Perhaps the display memory is split into two sections with the first 8 characters at one location and the next 8 characters at another location. It's impossible to tell without more documentation. At least you got the basic Stamp to display communications working.
This is why you should buy your equipment from a vendor that supports it. If you really know what you're doing and become familiar with the existing documentation for the other products you're interested in, then buying from some other supplier makes sense. Good luck.
09-15-2008, 03:41 AM
But since my work scrapped out 100 of both of the displays I went and took a crap load
and its pretty close to the one in the kit.
I get all my stuff from there cause its free and they just throw it away since its cheaper then sending it back
I'll look more closely to the data sheet
09-15-2008, 04:48 AM
ok so after searching the net for answers and reading the datasheet
it seems that the problem lies in the busy flag check
and also its electricaly a 2 x 8 line display but physically a 1 x 16 line
so i need to check the BF which is on data line 7 so my question is where would i do the check after this
' -----[ Subroutines ]-----------------------------------------------------
LOW RS ' enter command mode
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
<===================[Insert BF Check]
and if my understanding is correct that would just be a IF THEN like
If IN14 = 0 then
else pause 200
09-15-2008, 04:54 AM
You may indeed need to check the busy flag, but you also have to reposition the cursor after the 8th character because these displays often have line 2 stored in a different portion of the display buffer than line 1 and you have to skip over the stuff in-between. The datasheet will usually have that information.
In checking for the busy flag, you may be better off sitting in a loop waiting for busy to become false. It would be something like:
IF IN14 = 1 THEN LCD_Loop