LCD for RN1

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
62 postsPage 2 of 51, 2, 3, 4, 5
62 postsPage 2 of 51, 2, 3, 4, 5

Post by Entrastic » Wed Jan 02, 2008 9:11 pm

Post by Entrastic
Wed Jan 02, 2008 9:11 pm

NovaOne wrote:but part of me would advise you use the LCD port ie the spark fun device.


Is there any particular reason why the I2C LCD is not the better solution?
So how do I code the LCD if i am using ports 15 and 16 ( for example). Meanwhile my PWM0 and PWM1 is being used up by SP03. Is it really complicated??

And how do I code it if I am using the Sparkfun one to store the settings in EEPROM

NovaOne wrote:Choices, choices...?

If it all comes down to cost the cheapest solution is to do what i do.....don't use and LCD at all. Instead use a lead with a RS232 to TTL converter from the LCD port, to your PC and run Hyper-terminal or similar program.


I am using the LCD because I am currently working on a school project on Robonova and CMUcam and my supervisor wants to make it as interesting and interactive as possible. The robot will be showcased in an exhibition. And there is quite a delay caused by sending in commands to initiate the camera. During this time, I would like to display commands like " Initiating Camera. Please Wait' :)
NovaOne wrote:but part of me would advise you use the LCD port ie the spark fun device.


Is there any particular reason why the I2C LCD is not the better solution?
So how do I code the LCD if i am using ports 15 and 16 ( for example). Meanwhile my PWM0 and PWM1 is being used up by SP03. Is it really complicated??

And how do I code it if I am using the Sparkfun one to store the settings in EEPROM

NovaOne wrote:Choices, choices...?

If it all comes down to cost the cheapest solution is to do what i do.....don't use and LCD at all. Instead use a lead with a RS232 to TTL converter from the LCD port, to your PC and run Hyper-terminal or similar program.


I am using the LCD because I am currently working on a school project on Robonova and CMUcam and my supervisor wants to make it as interesting and interactive as possible. The robot will be showcased in an exhibition. And there is quite a delay caused by sending in commands to initiate the camera. During this time, I would like to display commands like " Initiating Camera. Please Wait' :)
Entrastic offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Fri Oct 05, 2007 7:43 am

Post by Gort » Wed Jan 02, 2008 9:20 pm

Post by Gort
Wed Jan 02, 2008 9:20 pm

The LCD EEPROM. Set it using the ERX/ETX port.
The LCD EEPROM. Set it using the ERX/ETX port.
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Entrastic » Wed Jan 02, 2008 9:32 pm

Post by Entrastic
Wed Jan 02, 2008 9:32 pm

Ok..I think I am pretty clear abt the sparkfun LCD.

Just couple of more questions though.
1) Cant I do the initial setting of the baud rates and the rest using a hyperterminal with a max232 level shifter?

2) Can i use the print statement in robobasic to print ASCII characters on screen. In other words, how do I use the LCD after i initialize it and plug it into the LCD port
Ok..I think I am pretty clear abt the sparkfun LCD.

Just couple of more questions though.
1) Cant I do the initial setting of the baud rates and the rest using a hyperterminal with a max232 level shifter?

2) Can i use the print statement in robobasic to print ASCII characters on screen. In other words, how do I use the LCD after i initialize it and plug it into the LCD port
Entrastic offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Fri Oct 05, 2007 7:43 am

Post by NovaOne » Wed Jan 02, 2008 9:42 pm

Post by NovaOne
Wed Jan 02, 2008 9:42 pm

I see...
Is there any particular reason why the I2C LCD is not the better solution?


I use an I2C Bus to add extra peripherals, sensors etc because the c3024 has a limited number of Inputs and Outputs (I/O). My bit-banged code is slow (although probably fast enough for your application). The Hitec LCD port is fit for purpose and print command simple to use.

The spark fun SerLCD looks like the simplest solution for you.

However if you do decide to run with the I2C option:
So how do I code the LCD if i am using ports 15 and 16 ( for example). Meanwhile my PWM0 and PWM1 is being used up by SP03. Is it really complicated??

No its not complicated just use PWM0 and PWM1 ie ports 46 and 47 for SDA and SCL.;
i2c compatible LCD....... you can connect it to the same pins as the sp03 and any other I2C Bus compatible slave devices, as long as you have one set of pull up resistors on the lines somewhere.

The Adress for the Devantech module is I2cAddr = &Hc6
The command and text (byte) input register are 0, that is I2cReg =0
Numbers (bytes) placed in the command register from 0-27 are decoded as commands in the table shown in the link, and numbers (bytes) 32-255 and decoded as ASCII and displayed as characters on the screen. eg
Code: Select all
'send the character "A"
I2cAddr = &Hc6
I2cReg =0
I2cData = 65
Gosub I2cByteWrite


This compares to: Print "A" for an LCD connected to the LCD port. (assuming your port is set up to 4800 first) :shock:

All the information you should need is here:
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm

Good luck with your studies

Edited for spelling and formatting
I see...
Is there any particular reason why the I2C LCD is not the better solution?


I use an I2C Bus to add extra peripherals, sensors etc because the c3024 has a limited number of Inputs and Outputs (I/O). My bit-banged code is slow (although probably fast enough for your application). The Hitec LCD port is fit for purpose and print command simple to use.

The spark fun SerLCD looks like the simplest solution for you.

However if you do decide to run with the I2C option:
So how do I code the LCD if i am using ports 15 and 16 ( for example). Meanwhile my PWM0 and PWM1 is being used up by SP03. Is it really complicated??

No its not complicated just use PWM0 and PWM1 ie ports 46 and 47 for SDA and SCL.;
i2c compatible LCD....... you can connect it to the same pins as the sp03 and any other I2C Bus compatible slave devices, as long as you have one set of pull up resistors on the lines somewhere.

The Adress for the Devantech module is I2cAddr = &Hc6
The command and text (byte) input register are 0, that is I2cReg =0
Numbers (bytes) placed in the command register from 0-27 are decoded as commands in the table shown in the link, and numbers (bytes) 32-255 and decoded as ASCII and displayed as characters on the screen. eg
Code: Select all
'send the character "A"
I2cAddr = &Hc6
I2cReg =0
I2cData = 65
Gosub I2cByteWrite


This compares to: Print "A" for an LCD connected to the LCD port. (assuming your port is set up to 4800 first) :shock:

All the information you should need is here:
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm

Good luck with your studies

Edited for spelling and formatting
Last edited by NovaOne on Thu Jan 03, 2008 7:04 am, edited 2 times in total.
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by i-Bot » Wed Jan 02, 2008 10:48 pm

Post by i-Bot
Wed Jan 02, 2008 10:48 pm

If you or anyone else choose the SerLCD then use:
Code: Select all
' Change speed from 9600 to 4800
ETX 9600, &HFE
ETX 9600, &H01
ETX 9600, 57
ETX 9600, 54
ETX 9600, 48
ETX 9600, 48
ETX 9600, 45
ETX 9600, 62
ETX 9600, 124
ETX 9600, 12
DELAY 10
ETX 4800, 52
ETX 4800, 56
ETX 4800, 48
ETX 4800, 48

With the LCD on the ERX Pins to set 4800 or:
Code: Select all
' Change speed from 4800 to 9600
ETX 4800, &HFE
ETX 4800, &H01
ETX 4800, 52
ETX 4800, 56
ETX 4800, 48
ETX 4800, 48
ETX 4800, 45
ETX 4800, 62
ETX 4800, 124
ETX 4800, 13
DELAY 10
ETX 9600, 57
ETX 9600, 54
ETX 9600, 48
ETX 9600, 48

To change back to 9600

Test with:
Code: Select all
' Test LCD at 4800
PRINT &HFE,&H01 ' Clear LCD Screen
PRINT "Test LCD at 4800"

with the LCD on the LCD pins.

All done, SerLCD is now 4800 and will remain at 4800 until changed back, since baud rate is stored in EEPROM
If you or anyone else choose the SerLCD then use:
Code: Select all
' Change speed from 9600 to 4800
ETX 9600, &HFE
ETX 9600, &H01
ETX 9600, 57
ETX 9600, 54
ETX 9600, 48
ETX 9600, 48
ETX 9600, 45
ETX 9600, 62
ETX 9600, 124
ETX 9600, 12
DELAY 10
ETX 4800, 52
ETX 4800, 56
ETX 4800, 48
ETX 4800, 48

With the LCD on the ERX Pins to set 4800 or:
Code: Select all
' Change speed from 4800 to 9600
ETX 4800, &HFE
ETX 4800, &H01
ETX 4800, 52
ETX 4800, 56
ETX 4800, 48
ETX 4800, 48
ETX 4800, 45
ETX 4800, 62
ETX 4800, 124
ETX 4800, 13
DELAY 10
ETX 9600, 57
ETX 9600, 54
ETX 9600, 48
ETX 9600, 48

To change back to 9600

Test with:
Code: Select all
' Test LCD at 4800
PRINT &HFE,&H01 ' Clear LCD Screen
PRINT "Test LCD at 4800"

with the LCD on the LCD pins.

All done, SerLCD is now 4800 and will remain at 4800 until changed back, since baud rate is stored in EEPROM
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Gort » Thu Jan 03, 2008 2:46 am

Post by Gort
Thu Jan 03, 2008 2:46 am

When I use the built in Robobasic LCD print commands I get garbage characters on the LCD display. I then did what I-Bot posted and I am still getting the same garbage characters. I do not think that the SparkFun LCD is playing well with the c3024’s LCD port.
When I use the built in Robobasic LCD print commands I get garbage characters on the LCD display. I then did what I-Bot posted and I am still getting the same garbage characters. I do not think that the SparkFun LCD is playing well with the c3024’s LCD port.
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by NovaOne » Thu Jan 03, 2008 7:26 am

Post by NovaOne
Thu Jan 03, 2008 7:26 am

Is there any particular reason why the I2C LCD is not the better solution?

Regarding the I2C display, obviously displaying text strings would be convoluted, but variables would be a real headache...unless someone knows simple a method?
In comparison, the Format command for the LCD makes it easy to view Decimal,Hex or Binary variables.

As a side note, to make the choice more difficult:
It looks very straight forward to add your own custom symbols/characters using i2c. I sure this should be possible with the SerLCD as well. ie if you persevere you could display simple "graphic" animations. (these will be slow using my i2c code)
Is there any particular reason why the I2C LCD is not the better solution?

Regarding the I2C display, obviously displaying text strings would be convoluted, but variables would be a real headache...unless someone knows simple a method?
In comparison, the Format command for the LCD makes it easy to view Decimal,Hex or Binary variables.

As a side note, to make the choice more difficult:
It looks very straight forward to add your own custom symbols/characters using i2c. I sure this should be possible with the SerLCD as well. ie if you persevere you could display simple "graphic" animations. (these will be slow using my i2c code)
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by Entrastic » Thu Jan 03, 2008 8:31 am

Post by Entrastic
Thu Jan 03, 2008 8:31 am

Gort wrote:When I use the built in Robobasic LCD print commands I get garbage characters on the LCD display. I then did what I-Bot posted and I am still getting the same garbage characters. I do not think that the SparkFun LCD is playing well with the c3024’s LCD port.


Hmm...I was almost about to order the SerLCD. Now I am back to square one :) please let me know if you managed to fix the error.
Gort wrote:When I use the built in Robobasic LCD print commands I get garbage characters on the LCD display. I then did what I-Bot posted and I am still getting the same garbage characters. I do not think that the SparkFun LCD is playing well with the c3024’s LCD port.


Hmm...I was almost about to order the SerLCD. Now I am back to square one :) please let me know if you managed to fix the error.
Entrastic offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Fri Oct 05, 2007 7:43 am

Post by i-Bot » Thu Jan 03, 2008 11:35 am

Post by i-Bot
Thu Jan 03, 2008 11:35 am

Hmm. It worked for me.

Let me go a bit slower. The C3024 LCD port is 4800 and cannot be changed. So the SerLCD (must be latest version 2.5) must be changed to 4800 from the default 9600.

The LCD is connected to the ERX pins of the C3024, and the first Robobasic program run to change the SerLCD speed from 9600 to 4800. The ERX port can work at multiple speeds, so that is why it is use temporarily. The display should show "9600 ->4800".

The dispay is now at 4800 default and can be moved to the LCD pins. The test LCD code can then be run.

Print and format work fine. The control mode such as clear screen do not work and must be substituted by the SerLCD code, as I did for the clear screen in the print test.

I did test this and it worked OK for me. Let me know what you see on the screen when you run the first 9600 to 4800 program.

The second program is just to turn it back to 9600 if you ever need it. I jst used it for testing.
Hmm. It worked for me.

Let me go a bit slower. The C3024 LCD port is 4800 and cannot be changed. So the SerLCD (must be latest version 2.5) must be changed to 4800 from the default 9600.

The LCD is connected to the ERX pins of the C3024, and the first Robobasic program run to change the SerLCD speed from 9600 to 4800. The ERX port can work at multiple speeds, so that is why it is use temporarily. The display should show "9600 ->4800".

The dispay is now at 4800 default and can be moved to the LCD pins. The test LCD code can then be run.

Print and format work fine. The control mode such as clear screen do not work and must be substituted by the SerLCD code, as I did for the clear screen in the print test.

I did test this and it worked OK for me. Let me know what you see on the screen when you run the first 9600 to 4800 program.

The second program is just to turn it back to 9600 if you ever need it. I jst used it for testing.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

LCD

Post by JavaRN » Fri Jan 04, 2008 9:52 pm

Post by JavaRN
Fri Jan 04, 2008 9:52 pm

I am waiting for a NetMedia LCD display which operates at 9600 or 2400 baud. I am not interested in using the PRINT robobasic command, but I need the display only to display messages sent from the laptop via bluetooth, so it's just displaying a stream of characters. Can I use the ETX command to send character by character to the LCD at 9600? If yes how can I do it? (I hope I can :oops: :oops: )


By the way I have the MC3024 patch (which includes 9600 data transfer to the LCD port) by i-bot already installed.

Charles
I am waiting for a NetMedia LCD display which operates at 9600 or 2400 baud. I am not interested in using the PRINT robobasic command, but I need the display only to display messages sent from the laptop via bluetooth, so it's just displaying a stream of characters. Can I use the ETX command to send character by character to the LCD at 9600? If yes how can I do it? (I hope I can :oops: :oops: )


By the way I have the MC3024 patch (which includes 9600 data transfer to the LCD port) by i-bot already installed.

Charles
F'dan il-passatemp ghandek bzonn zewg affarijiet - FLUS u HIN. Zewg affarijiet li huma skarsi hafna u li jien minnhom ghandi vera ftit!
JavaRN offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 282
Joined: Fri Mar 02, 2007 11:01 pm

Post by Gort » Sat Jan 05, 2008 5:24 am

Post by Gort
Sat Jan 05, 2008 5:24 am

This is the message I got after I followed I-bots instructions with it plugged into the ERX port.

Image

This is it plugged into the LCD port with the test message.

Image
[/img]

When it is plugged into the ERX port it displays no text.
This is the message I got after I followed I-bots instructions with it plugged into the ERX port.

Image

This is it plugged into the LCD port with the test message.

Image
[/img]

When it is plugged into the ERX port it displays no text.
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Entrastic » Sat Jan 05, 2008 4:50 pm

Post by Entrastic
Sat Jan 05, 2008 4:50 pm

wow..thats weird.. hopefully u can fix it..so that i can go ahead and purchase one for my own :)

In the mean time I am using the LCD port for debugging by connecting it to my computer. Is there any way we can output a variable thru the LCD port? I want to noe what are the values dumped into the Robonova by one of my sensors. Is it possible that i store the output from my sensor in a variable and then send it to my computer thru the LCD port?
wow..thats weird.. hopefully u can fix it..so that i can go ahead and purchase one for my own :)

In the mean time I am using the LCD port for debugging by connecting it to my computer. Is there any way we can output a variable thru the LCD port? I want to noe what are the values dumped into the Robonova by one of my sensors. Is it possible that i store the output from my sensor in a variable and then send it to my computer thru the LCD port?
Entrastic offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Fri Oct 05, 2007 7:43 am

Post by i-Bot » Sun Jan 06, 2008 3:11 pm

Post by i-Bot
Sun Jan 06, 2008 3:11 pm

The choice betwen using PRINT on the LCD port or ETX depends on what you want to view or to send.

PRINT on the LCD port allows characters and character strings to be easily sent to the display. Also with the FORMAT command then variables can be displayed in a dec or hex format. This is difficult with the ETX command, which does not even seem to allow character constants to be used.

The PRINT command does not take variables directly, so if you want to send a variable as a single byte, then ETX is better.

For the SerLCD I am confused. I tried mine again. Like Gort I see the display of 9600->4800. Since the 4800 is sent at 4800 baud then the speed must have changed. However mine seems to be saved to EEPROM and that of Gort is not. My test LCD program shows "Test LCD at 4800". My SerLCD is V2.5. I wondered if there was a problem with low voltage stopping the EEPROM write, but the datasheet shows this should work right down to 2V. The code for V2.5 does not appear to be shared by Sparkfun. I did have to add the delay you see in the program for the speed change to work, you might try making it longer. I will try to get some help on the Sparkfun forum.
The choice betwen using PRINT on the LCD port or ETX depends on what you want to view or to send.

PRINT on the LCD port allows characters and character strings to be easily sent to the display. Also with the FORMAT command then variables can be displayed in a dec or hex format. This is difficult with the ETX command, which does not even seem to allow character constants to be used.

The PRINT command does not take variables directly, so if you want to send a variable as a single byte, then ETX is better.

For the SerLCD I am confused. I tried mine again. Like Gort I see the display of 9600->4800. Since the 4800 is sent at 4800 baud then the speed must have changed. However mine seems to be saved to EEPROM and that of Gort is not. My test LCD program shows "Test LCD at 4800". My SerLCD is V2.5. I wondered if there was a problem with low voltage stopping the EEPROM write, but the datasheet shows this should work right down to 2V. The code for V2.5 does not appear to be shared by Sparkfun. I did have to add the delay you see in the program for the speed change to work, you might try making it longer. I will try to get some help on the Sparkfun forum.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Gort » Tue Jan 08, 2008 6:57 pm

Post by Gort
Tue Jan 08, 2008 6:57 pm

I agree it is not writing to the EEPROM. I am just not sure way? It is not a low voltage problem.
I agree it is not writing to the EEPROM. I am just not sure way? It is not a low voltage problem.
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Entrastic » Wed Jan 23, 2008 5:08 pm

Post by Entrastic
Wed Jan 23, 2008 5:08 pm

My Sparkfun LCD arrived today morning. I just tested it out and I got the same problem as you. It showed the 9600->4800 message. But when plugged into the LCD port, it gave me a lot of garbage output.

Were you able to figure out what went wrong? Please help me.
My Sparkfun LCD arrived today morning. I just tested it out and I got the same problem as you. It showed the 9600->4800 message. But when plugged into the LCD port, it gave me a lot of garbage output.

Were you able to figure out what went wrong? Please help me.
Entrastic offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Fri Oct 05, 2007 7:43 am

PreviousNext
PreviousNext
62 postsPage 2 of 51, 2, 3, 4, 5
62 postsPage 2 of 51, 2, 3, 4, 5
cron