Go to Post Free time? You mean the time it takes the code to build? - axiomofdarkness [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-03-2007, 23:41
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: How to Hook up LCD

Hey Dave thanks for the message. Just to clear up, I want to use this LCD for OI so the drivers can view the heading angle of the robot etc. So, how can I connect? Like its not clear. Using the adapter which sparkfun has already attached to LCD there are only 3 holes I see, 1) 5V 2) GND 3) RX. I have looked at many codes infact kevin has written one as well but what I understand so far is that these codes are written so that the LCD can be mounted onto the robot not on Operator Interface. Please let me know Dave if I misunderstood something. I really appreciate your input.
  #2   Spotlight this post!  
Unread 04-03-2007, 00:00
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: How to Hook up LCD

The Backpack handles the serial communication and can be hooked up directly to the TTL port on the RC (gnd-to-gnd, 5v-to-5v, Backpack/Rx-to-RC/Tx). I do have example code that uses a digital output instead to communicate through, but the TTL port is the easiest way to do so and has the advantage of using more efficent dedicated hardware. Kevin's example is very clear too.

The OI does not have a serial port that you can control well enough to allow you to hook your LCD up directly to it. You'd need something to take input from the OI's Dashboard port, decipher the format, extract the data you wish to display, then issue the appropriate sequence of LCD commands.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 04-03-2007 at 14:07. Reason: different word, but no change
  #3   Spotlight this post!  
Unread 04-03-2007, 00:06
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: How to Hook up LCD

Thanks Mark for clearing up. So with the help of "Backpack" I don't have to do anything, absolutely no wiring but simply attach that LCD to the serial port. Also for the coding I can simply use Mr. Kevin's code for serial driver.

What if I am also using a camera? How do I manage to use serial driver than?
  #4   Spotlight this post!  
Unread 04-03-2007, 00:09
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: How to Hook up LCD

Also mark as you stated that we can use digital input/output pins to use the LCD. Is it possible you can share that example code with us so we can probably elaborate on it? Please let me know thanks.
  #5   Spotlight this post!  
Unread 04-03-2007, 00:15
Binome's Avatar
Binome Binome is offline
Programmer/Electronics/CAD
AKA: Patrick
FRC #2273 (SHIM)
Team Role: Leadership
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Surrey,BC
Posts: 105
Binome is a glorious beacon of lightBinome is a glorious beacon of lightBinome is a glorious beacon of lightBinome is a glorious beacon of lightBinome is a glorious beacon of light
Re: How to Hook up LCD

It sounds like you are trying to set up a system that connects to the OI dashboard, parses the data, and then prints it out onto a LCD.
If you are looking at just doing the current angle, why don't you use the 3 number display already on it?
if you still want to do the LCD, I would suggest using a 16f628 and decoding the dashboard data. The specs on the data packets are on IFI's website.
  #6   Spotlight this post!  
Unread 04-03-2007, 08:33
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: How to Hook up LCD

Quote:
Originally Posted by magical hands View Post
What if I am also using a camera? How do I manage to use serial driver then?
There are two native serial ports on the RC. The TTL port could be used for the LCD and the programming port can plug right into the camera. Kevin's camera code is setup to handle that for you with one change. You'd have to swap the programming port plug to download new programs, or you might be able to make a splitter cable to share the port, then you'd just have to turn the camera off long enough to download program changes.

Quote:
Originally Posted by magical hands View Post
Also mark as you stated that we can use digital input/output pins to use the LCD. Is it possible you can share that example code with us so we can probably elaborate on it?
The example code is here. It isn't as nicely commented as Kevin's code. It's real purpose was to support training on the use of timers and some programming concepts.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #7   Spotlight this post!  
Unread 04-03-2007, 11:43
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: How to Hook up LCD

Thank you very much everyone. This post has been really helpful to me. Thanks Mark for sharing your code. The purpose of this LCD is to check the flow of current in our robot, check robot's current angle and distance travelled which is monitored by Gear Tooth Sensor and Gyro. However, the LCD adds the cool factor to the control system. Since its difficult to attach this LCD to the Operator Interface. Now we are planning on attaching a tablet to the OI and have it setup up so the drivers can see all motor values, gyro value, gear tooth value and infact they can precisely control the robot by looking at these values. Also, it helps in troubleshooting our autonomous after every game because we will have record of what went wrong where. So ya!

Is it possible I can change between the two codes in my robot? for example a default code and camera code in robot without downloading back and forth? So I can have control over which code will be used during each game just by flicking some switches on and off?
  #8   Spotlight this post!  
Unread 04-03-2007, 11:47
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: How to Hook up LCD

Hey Dave thanks for sharing that info its really amazing. Thats exactly what I am planning on doing with my Tablet, I don't want to use the IFI's Dashboard. or infact use it but have more features to it example it shows ur gyro angle and GTS tooth count, camera values etc. So Dave would the process be still the same for tablet? the fact that I would have to create a cross platform between what Dashboard recevies and what info shows up on my tablet? and what programming language do you prefer this platform to be made in? V.B? C? C++?
  #9   Spotlight this post!  
Unread 04-03-2007, 12:53
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: How to Hook up LCD

Quote:
Originally Posted by magical hands View Post
Hey Dave thanks for sharing that info its really amazing. Thats exactly what I am planning on doing with my Tablet, I don't want to use the IFI's Dashboard. or infact use it but have more features to it example it shows ur gyro angle and GTS tooth count, camera values etc. So Dave would the process be still the same for tablet? the fact that I would have to create a cross platform between what Dashboard recevies and what info shows up on my tablet? and what programming language do you prefer this platform to be made in? V.B? C? C++?
If you search a little here on CD you'll find previous discussions and pointers on dealing with the dashboard data. Included with IFI's dashboard download you should find their documentation on the serial protocol.

In short, each frame consists of 26 bytes, with the start of the frame consisting of 0xff 0xff. There are three frame types, and you need to look at bits within control bytes to figure out which frame of data you've just received.

The 'dashboard' port is simply the raw data from either the RC->OI OR the OI->RC, the shunt near the connector controls which half of the conversation you are monitoring. The bit rate is 19200.

Remember, this is the raw, unchecked data passing between the OI and RC. There are two "checksum" bytes in the middle of the packet that the RC and OI use to determine whether the packet was good or whether it was corrupted.

For some odd reason, IFI won't document the "checksum" works, and I guess once you know how it works, we aren't supposed to reveal their "secret".

I suppose for just displaying data, data from an errored packet will be quickly replaced by good data and any resulting 'glitch' will probably go un-noticed by the end user. If you use the 'user' bytes to multiplex more data at a slower speed, then understanding how the "checksum" works becomes more important.


As far as the language choice, VB, C, C++, Delphi, will all work fine. It is more a matter of which platform and compiler you are most comfortable and experienced working with.
__________________
--Dave
  #10   Spotlight this post!  
Unread 04-03-2007, 13:18
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: How to Hook up LCD

Thanks Dave that was really helpful! I hope I succeed in my mission.
  #11   Spotlight this post!  
Unread 04-03-2007, 12:28
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: How to Hook up LCD

Quote:
Originally Posted by magical hands View Post
Thank you very much everyone. This post has been really helpful to me. Thanks Mark for sharing your code. The purpose of this LCD is to check the flow of current in our robot, check robot's current angle and distance travelled which is monitored by Gear Tooth Sensor and Gyro. However, the LCD adds the cool factor to the control system. Since its difficult to attach this LCD to the Operator Interface. Now we are planning on attaching a tablet to the OI and have it setup up so the drivers can see all motor values, gyro value, gear tooth value and infact they can precisely control the robot by looking at these values. Also, it helps in troubleshooting our autonomous after every game because we will have record of what went wrong where. So ya!

Is it possible I can change between the two codes in my robot? for example a default code and camera code in robot without downloading back and forth? So I can have control over which code will be used during each game just by flicking some switches on and off?
If you have some unused Digital I/O inputs, configure one or more of them to control which 'code' runs.

Code:
unsigned char whichone = 0;

     if (rc_dig_in 14)  whichone |= 1;
     if (rc_dig_in 15)  whichone |= 2;
     if (rc_dig_in 16)  whichone |= 4;

     switch (whichone) {
         case 0:  {
              // run this code
         }

         case 1:  {
             // or run this code
         }

         case 2: {
            // and so on...
         }

         default: {
            // just in case...
         }
     } // switch
On the digital inputs just make up some jumpers, or install some switches between the digital input and ground. You might want to avoid using miniture switches that might be jarred during competition.
__________________
--Dave
  #12   Spotlight this post!  
Unread 04-03-2007, 00:36
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: How to Hook up LCD

Quote:
Originally Posted by magical hands View Post
Thanks Mark for clearing up. So with the help of "Backpack" I don't have to do anything, absolutely no wiring but simply attach that LCD to the serial port. Also for the coding I can simply use Mr. Kevin's code for serial driver.

What if I am also using a camera? How do I manage to use serial driver than?
The serial driver should take care of everything in the background. Just set where you want to send the data and go for it. The problem is not so much the serial driver (everything is done in printf's, there is no need to recieve or parse any data), but rather the code to drive the LCD itself. Serial is the established protocol for the LCD screen and you have something to stick to that protocol, but you still need to write code to make the LCD work.

What exactly do you plan to use this LCD for?
  #13   Spotlight this post!  
Unread 04-03-2007, 11:33
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: How to Hook up LCD

Quote:
Originally Posted by magical hands View Post
Hey Dave thanks for the message. Just to clear up, I want to use this LCD for OI so the drivers can view the heading angle of the robot etc. So, how can I connect? Like its not clear. Using the adapter which sparkfun has already attached to LCD there are only 3 holes I see, 1) 5V 2) GND 3) RX. I have looked at many codes infact kevin has written one as well but what I understand so far is that these codes are written so that the LCD can be mounted onto the robot not on Operator Interface. Please let me know Dave if I misunderstood something. I really appreciate your input.
It looks like many of the other responses you are getting in this thread may have missed your desire to have this on the Operator Interface.

As Mark corrected pointed out, the 'backpack' will need something in between the dashboard port and the backpack's serial port.

Also keep in mind that the 'dashboard' port has RS-232 levels on it, whereas the backpack is expecting a TTL level signal.

The Backpack uses a PIC16 CPU that is FLASH based, and the programming header at JC1 could be used to reprogram the PIC with your own custom software. This would allow the display to work directly from the dashboard data, but for that you not only need to write the display drivers (which I've already provided pointers to) but also the serial port parsing code to interpret the dashboard data and turn it into something meaningful on your display.

You will also need an in-circuit programmer. Microchip's ICD2 is about $160, but if you search around you'll find clones for less and information on how to homebrew them.

The PIC16F688 only has 7K of program memory, which might be a little small if you want to write the new program in "C", so unless you can avoid doing anything that requires one of the "C" libraries to be linked in, you might end up needing to write the new program in assembler.


Writing new code would be the cleanest way to do it, but certainly inserting a small microcontroller with two serial ports in series would be another way to do it.
__________________
--Dave
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to hook up a Police light on the Robot?? xur2007 Technical Discussion 4 13-11-2006 18:27
how to mount a lcd display onto a robot mechanicalbrain Electrical 9 07-09-2005 20:57
How do you hook up the camera? SpeakerSilenced Programming 18 16-02-2005 15:00
How do u hook up the digital input to the sensor's wires Fares Technical Discussion 2 14-02-2003 16:41
how do u hook up things through the fuse panel? chrisw Technical Discussion 9 12-01-2002 19:51


All times are GMT -5. The time now is 00:23.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi