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.
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).
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 )
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…
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…
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.
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:
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 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?