Go to Post I see all these people complaining about the FIRST game having perverse penalties for playing defense...then we play without defense, and still people complain. - MrForbes [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 05-03-2007, 13:59
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
RS 232 and Dashboard

Well, with our season over, it's time to start thinking about next year. One thing we want to start working on within the next couple weeks is a test RC system; basically a fully functional robot with only the electronics. With it w can test motors and other such things, but mainly we want it to be able to develop code for the camera, gyro, and other sensors, both in and out of the season. In addition to this, we think it would be really cool if we could build a physical, rather than digital, dashboard, utilizing the RS 232 dashboard port, a set of LEDs and numerical displays that works just like the dashboard program and built into our test system.

Obviously, the biggest obstacle to overcome is building a circuit to receive and process the RS 232 data, which the other students and I don't know much about at all. Our mentors would likely know a lot, but we'd like to find out as much as we can on our own first If anyone here can point us to some good RS 232 documentation, has any other comments or suggestions, or has done something like this themselves, we'd really appreciate it if you could tell us about it. If it hasn't been done before, or at least not to such an extent, we'll document it as much as possible once we build it.

Thanks in advance.
__________________
Code:
void function(void)
 {
  function();
 }
  #2   Spotlight this post!  
Unread 05-03-2007, 14:12
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: RS 232 and Dashboard

You probably don't really want documentation on the RS-232 standard. It's just a definition of what voltages represent which logic state, and how quickly those voltages change. You also probably don't want to design a circuit to process it; the voltage level circuitry is available in chip form (MAX232, for example) and the timing circuitry is built in to just about every microcontroller sold (it's called a UAR/T).

What you probably really want is documentation on the Dashboard data format. That can be found here: http://www.ifirobotics.com/dashboard_viewer.shtml
  #3   Spotlight this post!  
Unread 05-03-2007, 14:39
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: RS 232 and Dashboard

Oh, I have the Dashboard documentation. What I don't know is how I would take the RS 232 signals and translate them back into numeric values, so I could then trigger LEDs and display PWM values and the like.
__________________
Code:
void function(void)
 {
  function();
 }
  #4   Spotlight this post!  
Unread 05-03-2007, 21:46
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: RS 232 and Dashboard

To turn RS-232 serial data into numbers, I suppose you could design some sort of state machine out of discrete logic...but you really ought to be using a programmable computer with a serial port. Although building your own UAR/T might be a fun challenge, it's much easier and much less expensive to use what's already built in to most microcontrollers.

Bottom line: don't try to turn serial data into numbers yourself. Let the available hardware do it for you. Connect the receive pin to the incoming data, program the UAR/T for the proper bit rate, and read the incoming bytes as they arrive. Your first task should probably be to decide what kind of processor you have the ability to program, and then either to design a computer around it, or use an existing design like a BASIC Stamp or Gumstix system.
  #5   Spotlight this post!  
Unread 06-03-2007, 17:32
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: RS 232 and Dashboard

If you install the Labview you got this year, there is a Dashboard utility that comes with it. You will, with some effort learning Labview and staring at the Block Diagram, be able to figure out how to convert the data stream.

At the http://www.ifirobotics.com/dashboard_viewer.shtml Alan gave you, is a link to the "Dashboard Viewer 2005" - which is a ZIP file containing both the Dashboard program and PDF documents describing the byte-level protocol.
  #6   Spotlight this post!  
Unread 06-03-2007, 17:48
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: RS 232 and Dashboard

Or maybe you are looking for hints on how to get started coding?

First, capture some actual data into a file to see what it looks like. To do this:

- connect the OI Dashboard port to your computer, and set up the serial port to 115200 baud/etc as instructed in the Dashboard Specification.
- run the Dashboard Viewer program and make sure you are getting data from the robot. Stop the Dashboard Viewer.
- capture or copy whatever is coming into the computer serial port to a file. This will be "binary data" not human-readable (yet).
- fiddle around with your robot controls, to make sure PWM changes/etc are transmitted to the OI in Dashboard data packets
- stop the capture after a 30 seconds or so - you should have lots of data to look at

Find a utility containing a hex viewer such as Winhex or FileZilla. This will show you the binary data, expressed as "hexadecimal" equivalent characters. Using these, compare the data in the file with the Dashboard Specification.

Armed with this information, you can start writing some C or Visual Basic code on your computer. The code will open the serial port and read the live incoming Dashboard data stream from it. I suggest you start by opening an output disk file and copying the data to it. This will prove you have valid data (you can look at the file with the hex viewer).

Now you can start adding recognizer code to your program, looking for the start-of-packet bytes (FF, FF), then copying the remaining 24 bytes of the data packet frame into a data structure in memory. Once you have it there, it should be fairly easy to pick out the fields you are interested in (the PWM values, for example) and use them for the kind of output you would like from your program.
  #7   Spotlight this post!  
Unread 06-03-2007, 17:52
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: RS 232 and Dashboard

Well, for the most part, this whole project is intended to be a challenge and a learning experience, but I'll agree that we don't want to go that far, if there's equipment already available that can do most of the work, especially considering that just using a microprocessor other than the FRC goes beyond the scope of anything our team has done before.

But I would imagine it follows the same basic idea as the PIC, excpt in a much more simplified version. I can also forsee us using a lot of assembly code.

And I'm no stranger to working with raw binary data. I spent a lot of time last summer learning assembly by doing a little ROM hacking for the GBA. A very educational experience.
__________________
Code:
void function(void)
 {
  function();
 }

Last edited by Jake M : 06-03-2007 at 18:07.
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
Labview Dashboard and updated IFI dashboard spec Joe Ross LabView and Data Acquisition 1 04-04-2006 02:04
RS-232 Programming port as an active interface Goose Programming 1 03-04-2005 15:40
TTL -> RS-232 Board won't stay on! Mr. Lim Control System 5 16-02-2005 11:29
TTL -> RS-232 Board won't stay on! Mr. Lim Electrical 5 16-02-2005 11:29
RS-232 TTL Board? Sidney San Martín Electrical 8 08-01-2005 22:46


All times are GMT -5. The time now is 03:37.

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