LCD and driver recommandations

Hello, I’m looking at purchasing a LCD for my robot and what some recommandations on the fairest one to buy. I’m using the BotBoard II with Basic Atom 28 pin. I was reading the BasicMicro handbook 3.0.0.2 about how to make a program for an LCD and they recommand using the Hitachi 44780 controller or equivalent.

What I need help on is finding a LCD (standard size 18x2 or whatever) and a driver for it.

Thanks, bane

robotshop.ca/home/products/robot-parts/electronique-lcd/sfe-16x2-parallel-lcd-black-green.html

Hows this one? It says that its based on the HD44780 chipset

Bane

That looks fine, so long as its got the 44780 running the show, you’ll be fine.

The Hitachi is a fairly common controller for parallel LCDs. You might also want to check some of the electronic surplus places - they often have inexpensive ones (and other nifty parts for robots).

goldmine-elec-products.com/prodinfo.asp?number=G16717
Spec sheet

allelectronics.com/make-a-store/item/LCD-117/16-CHARACTER-X-2-LINE-LCD/-/1.html

There’s a good list of surplus places in the latest Servo magazine as well.

Where do i buy the 447800 though? All I can find is the data sheets, which will come in hand when i get it :slight_smile: .

Man, that goldmine store is totally awesome! You can buy a laptop touch mouse for 1.00!

Bane

I think i’m getting confused here. The 447800 is the driver on the back of the LCD, so this one doesn’t need a driver.

All I have to do is connect it correctly to my Atom.

Right?

Bane

Exactly so. The LCD has the Hitachi control module in it already, so it’s set to connect to the Atom.

OK, now if i hook it stright to the Atom it will take alot of pins.
But I’ve got some schematics where it uses an PCF857A and it only uses 4 Atom pins.
(I would post the schematics if i coud being that there on my desktop :confused: )

Bane

I prefer using serial LCDs as they usually only require 1 or 2 IO lines. Some of them also support I2C. The downside is that the built in LCD commands of the Atom don’t work, but you simply have to do serouts to them to make them work. Another downside is sometimes the bit bang serial commands don’t work reliably at 9600 when other things like HSERVO or you have interrupt processing…

Kurt

Do you have any LCDs you’d recommend? All I want is something to display text with my Atom.

Bane

My Rover has a Seetron 2x16 that Lynxmotion was selling for awhile and my Brat has a Scott Edwards Electronics 216. jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=150990

Both work fine. I have also used one by Sparkfun, which has been far more tempermental. I also have a Matrix Orbital graphics one that on a previous robot I had working with I2C (most of the time). It did have a tendancy to hang the I2C bus out to dry if it did not like something.

I would start of with something simple like the SEE216…

Heres the schematics,lennard.net.nz/electronics/lcd.html

second image

Bane

I’m already going to purchase some items off of RobotShop, so do you think this one is equivilent or will work just like the one on Jameco? The data sheet and pins look simular.
robotshop.ca/home/products/robot-parts/electronique-lcd/netmedia-2x16-rohs-lcd-green.html

Bane

Looks like the command set may be a bit different, but looks like it would be easy to play with. As how well it works? That I don’t know, but most of them work well.

Check out Sparkfun, they have 2 and 4 line Serial LCDs cheap

4 line: sparkfun.com/commerce/produc … cts_id=462

2 line: sparkfun.com/commerce/produc … cts_id=812

That’s just a sample. They also have some serial controller graphic LCDs but it sounds like you don’t need that. I don’t know the addressing particulars but I’m sure it can’t be too difficult.

I have used the text and graphic serial LCD controllers at Kronos:

kronosrobotics.com/downloads … Deluxe.pdf

kronosrobotics.com/Anotes/Se … cLCD.shtml

The Kronos stuff works flawlessly.

Hey thanks russ, I really like this one;
sparkfun.com/commerce/product_info.php?products_id=461
All I need is for my biped to display his feelings :wink: with some sort of text.

Have you one of those ^ type with the Atom before? If so, do you have to use the serout commands or can you use the LCD commands?

Bane

As I mentioned in an earlier post here, I also do have one of the Sparkfun ones (actually the one you mentioned). As I mentioned in the post it has been a bit tempermental. When I first purchased it, it was to run on a RoboNova and I had a difficult time of it not always resetting the baud rate at boot time. I found out the problem in their code that if they receive any inputs (Not just the input the describe in their manual) during some time during power up it would reset the LCD to its defaults. This happened on the RoboNova at power up the IO pin would change and trigger this.

I was able to use it OK with the ABB/Atom Pro, but it became flakey. Sometimes it would work and sometimes not. It might just be mine has a problem with it. Possibly something I caused when I had it bouncing around on a few different robots or in a drawer… I later purchased the Seetron as Lynxmotion was selling it… Have had no problems with this one…

You use the Serout commands with the Sparkfun one.

Sparkfun’s products are very solid, you shouldn’t have troubles with the serial LCD.

I just saw that Sparkfun are now carrying the 4DSolutions uOLED displays - I’m actually using a (much) earlier version of the 4D Solutions 160x128 uOLED in my biped. It is also quite easy to use, but the display itself is a little more expensive. I think it looks great, though…


Looks like we were posting at the same time, Kurte, I missed your comment. I’ve had several Sparkfun devices (gyro, accel, LCDs, etc) and they’ve all been quite reliable. I have not used them in a Robonova, but I’ve had no troubles with them at all (except the one the cat stole). You may have just been unlucky with your one - or I might have been lucky with mine.

I’ve just order this on from spark fun.
sparkfun.com/commerce/product_info.php?products_id=462

Nice, I’ll probably do something simular once I’ve learned a standard one.

Could you guys give me a few programming tips or test code then my LCD comes in?

Thanks for all the advice BTW :smiley: (I’ve always wanted mess around with a LCD)

Bane

I wrote up some simple helper functions, that I call to display text… They are not fancy, but they worked for my purposes… This is from an older copy of my Brat code…

Your millage may vary…


; define which LCD I am using...
LCDPIN	con p0
LCD_BAUD	con i2400

; variables for LCD... Not sure how to pass an array to a gosub so.
LCD_String var byte(17)

...
gosub LCD_Init

...
; to output a string to line 1...
LCD_String = "Hello Brat|"
gosub LCD_Print[1, 0]

; to output a number. - like wRange...
gosub LCDConvertNumToString[wRange]
gosub LCD_Print[2,1]


...

;
; Serial LCD functions added by Kurt
;

LCD_Init
	; make sure SerLCD has a chance to finish initializing after power-up
	; Reset to 9600 and powerup... - Uncomment if having problems with LCD.
;	serout LCDPIN, I9600, [0x12]
	Pause(1000)
	
	; Now lets try setting it to 2400 baud.  - uncomment if having problems
;	Serout LCDPIN, I9600, [0x7c]	; 124, <control k>
;	pause 2
;	Serout LCDPIN, I9600, [11]	; 124, <control k>

	; Output the clear screen command
	gosub LCD_WriteCommand[1] ;	// Clear the screen
	Pause(5)
	
	return

;
; Main LCD output function
;
line var sbyte
fPad var byte
LCD_Print[line, fPad]
;	DISABLE WKPINT_3 
;	DISABLE TIMERAINT 

	if line = 1 then
		gosub LCD_WriteCommand[0x80]
	elseif line = 2		
		gosub LCD_WriteCommand[0xC0]
	endif
			
	Pause(1)

	for line = 0 to 14	; try now to write to last position as it appears to autoscroll...
		if fPad <> 2 and LCD_String(line) > 0  and LCD_String(line) <> "|" then
			serout LCDPIN, LCD_BAUD, [LCD_String(line)]
		else
			if fPad = 0 then
				goto LCDP_Enable
			endif
			fPad = 2
			serout LCDPIN, LCD_BAUD, " "]
		endif
		Pause(1)
	next
LCDP_Enable						
;	ENABLE WKPINT_3 
;	ENABLE TIMERAINT 
	
	return

;
;DISPLAY DATA RAM ADDRESSES
;CHARACTER 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
;       + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
;LINE 1 | 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
;LINE 2 | C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
;
ich var byte
iline var byte
LCD_SetPos[ich, iline]
	if iline = 1 then
		gosub LCD_WriteCommand[0x80+ich]
	else
		gosub LCD_WriteCommand[0xC0+ich]
	endif
	
	pause 10
	return			

; clears the display and resets the current location to the upper left */
LCD_ClearAndReturn

	gosub LCD_WriteCommand[1] ;		// clear display
	Pause(100)
	
	return

fRight var byte
ichShift var byte
LCD_ShiftDisplay[fRight, ichShift]
	
	if fRight <> 0 then
		fRight = 0x1c
	else
		fRight = 0x18
	endif		
	while (ichShift > 0)
		gosub LCD_WriteCommand[fRight]
		ichShift = ichShift -1
	wend
	return

; Send a command to the LCD, first send a command prefix character and then then command
cmd var byte
LCD_WriteCommand[cmd]
	serout LCDPIN, LCD_BAUD, [0xfe]
	pause 1
	serout LCDPIN, LCD_BAUD, [cmd]
	return

LCDConvertNumToString[iOut]
	if iOut < 0 then
		LCD_String(0) = "-"
		iOut = -iOut
		iCnt1 = 1
		iCnt2 = 1
	else
		iCnt1 = 0	
		iCnt2 = 0	
	endif
	
	do 
		iOutLast = iOut
		LCD_String(iCnt1) = "0" + iOut // 10
		iOut = iOut / 10
		iCnt1 = iCnt1 + 1
	while (iOutLast >= 10)
	
	LCD_String(iCnt1) = 0
	iCnt1 = iCnt1 - 1
		
	while (iCnt1 > iCnt2)
		;swap LCD_String(iCnt1), LCD_String(iCnt2)
		tb = LCD_String(iCnt1)
		LCD_String(iCnt1) = LCD_String(iCnt2)
		LCD_String(iCnt2) = tb
		iCnt1 = iCnt1 - 1
		iCnt2 = iCnt2 + 1
	wend
	return

thanks, I forgot to ask; I ordered a 4 line LCD, can i add two more lines to this code (and anywere else needed) or do you know if theres something else needed?

Bane