Lynxmotion Tech Support

www.lynxmotion.com
Join the Accelerator Program
It is currently Thu Apr 24, 2014 4:23 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: BBII with 4x20 LCD
PostPosted: Fri Sep 09, 2011 4:23 pm 
Offline
Roboteer

Joined: Wed Dec 06, 2006 3:24 pm
Posts: 213
Location: Tucson AZ
Hi,
I have a 4X20 LCD that I would to use with my BBII. I just keep getting jibberish on the screen. Any one have any luck with this LCD?

This is what I tried
Code:
SEROUT 8, i19200,  [254,12 , 2, 1, "HELLOS"] '[$FE,$0C,2,1]


They had some sample code for a basic stamp

Code:
   'Brightness/Contrast
'Parameter     Length   Description
'[brightness]  1 Byte   Set backlight brightness (0 – 250)      $FE, $03
'[contrast]    1 byte   Set LCD contrast (0 – 100)              $FE, 04

'Set Cursor Position  $FE $0C [col] [row]  (0-3) AND col (0-19)
'Example:   SEROUT 1, 84, 25, [$FE, $0C, 2, 1, "text"]
'= transmit On PIN1, 9600 Baud, 25 type speed, row 3, col 2, LCD shows "text" On screen

'Clear Screen $FE $14
'Example: SEROUT 1, 84, [$FE $14]   where 1 is the pin and 84 is the baud rate

'<<<<<<<<<<<<<<<<< BEGIN TEXT CODE >>>>>>>>>>>>>>>>>>>>>>
PAUSE 2000    'I like to give the LCD 2 seconds to initialize
SEROUT 1, 84, [$FE, $0A]   'Ensures that the display is on
PAUSE 100
SEROUT 1, 84, [$FE, $14]    'Ensures that the screen is cleared
PAUSE 100
SEROUT 1, 84, [$FE, $03, 150] 'Sets the brightness (0-250)  *currently at 150
PAUSE 200
SEROUT 1, 84, 85, ["Hello World!"]    'Some text sent to the LCD, defaults to row 0, col 0
PAUSE 1500
SEROUT 1, 84, 25, [$FE, $0C, 1, 0, "This LCD is awesome"]  'Moves the cursor to row 2, col 1
PAUSE 1000
SEROUT 1, 84, 25, [$FE, $0C, 3, 1, "and easy to use"]      'Moves the cursor to row 4, col 2
PAUSE 1500        'waits 1.5 seconds
SEROUT 1, 84, [$FE, $14]  'Clears the screen
SEROUT 1, 84, 95, [$FE, $0C, 1, 2, "SLOW TEXT HERE"]     'the "95" is the type speed  (higher value = slower)
PAUSE 4000        'waits 4 seconds
SEROUT 1, 84, [$FE, $14]  'Clears the screen
PAUSE 200
'<<<<<<<<<<<<<<<<< END TEXT CODE >>>>>>>>>>>>>>>>>>>>>>


Top
 Profile  
 
 Post subject: Re: BBII with 4x20 LCD
PostPosted: Fri Sep 09, 2011 5:06 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 2:42 pm
Posts: 4755
Might help to know which LCD.

Also would help to know what else is running on the processor... Things like HSERVO, HSERIAL, or any other interrupts... I would suspect things like this if you say you sometimes get OK output and other times not.

I know that different processors and the like have a different idea what inverted versus non-inverted is. So if nothing is coming up correct, I would probably also try N19200 as well as I19200.

Kurt


Top
 Profile  
 
 Post subject: Re: BBII with 4x20 LCD
PostPosted: Fri Sep 09, 2011 5:23 pm 
Offline
Roboteer

Joined: Wed Dec 06, 2006 3:24 pm
Posts: 213
Location: Tucson AZ
Kurte,
on power up I get a quick "web4robot" splash screen, then i get scrolling characthers.
In not sure of the LCD. I purchased it looking at the serial controller. this is the link to the LCD http://web4robot.com/SerialLCD.html and the controller http://web4robot.com/LCDCtrl.html
I'm just jusing it on a empty BBII with BASIC Atom Pro . I wanted to just do a plain "Hello" screen to see if it works. Then exchange the 2x16 with it.
I'll try using N19200 when i get home tonight

Thanks
Phil


Last edited by Philtkp on Fri Sep 09, 2011 10:46 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: BBII with 4x20 LCD
PostPosted: Fri Sep 09, 2011 6:17 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 2:42 pm
Posts: 4755
Taking a quick look through their manual, it looks like the LCD defaults to 9600 baud rate. Can not tell from my quick look through the manual, that when you change the baud rate, it saves the new one away or if you always need to do so... But anyway try 9600 and see if you have any better luck. (Both Normal and Inverted)

Kurt


Top
 Profile  
 
 Post subject: Re: BBII with 4x20 LCD
PostPosted: Fri Sep 09, 2011 10:54 pm 
Offline
Roboteer

Joined: Wed Dec 06, 2006 3:24 pm
Posts: 213
Location: Tucson AZ
Kurte
I was finally able to get it working. You were correct, I needed to first connect at 9600 baud. Then I was able to change the baudrate to 19200.
It seems to be running fine

here's my test code

Code:
serout 8, i9600, [254, 10] 'Turn on display
serout 8, i9600, [254, 20] 'clear screen
pause 200

serout 8, i9600, [254, 2, 4] 'change baud rate to 19200
pause 200                    ' 1 = 2400
                             ' 2 = 4800
                             ' 3 = 9600
                             ' 4 = 19200
Main

serout 8, i19200, [254, 20] 'clear screen
pause 200
serout 8, i19200, [254, 7]  'Display Baudrate
pause 2000
serout 8, i19200, [254, 20] 'clear screen
pause 200
'serout 8, i19200, [$FE, $0C, 0, 0, "Coloum 0 Row 0"] 'position cursor ,col, row "FORMAT WORKS"
'serout 8, i19200, [0xFE, 0x0C, 0, 0, "Coloum 0 Row 0"] 'position cursor ,col, row "FORMAT WORKS"
serout 8, i19200, [254, 12, 0, 0, "Coloum 0 Row 0"] 'position cursor ,col, row "FORMAT WORKS"
pause 2000
serout 8, i19200, [254, 12, 1, 1, "Coloum 1 Row 1"]
pause 2000
serout 8, i19200, [254, 12, 2, 2, "Coloum 2 Row 2"]
pause 2000
serout 8, i19200, [254, 12, 3, 3, "Coloum 3 Row 3"]
pause 2000
Goto Main

Thanks for the help
Phil


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© 2014 RobotShop Distribution inc. All rights reserved.
Powered by phpBB® Forum Software © phpBB Group