Go to Post Developing new "classes" of super-competition would totally defeat the concepts of info-sharing, partnerships, alliances, etc and create an elitist society within FIRST. - dhitchco [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 26-05-2003, 16:52
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Communications via the Programming Port

Anticipating more autonomous stuff next year, I thought now would be a good time to develop the basics for an off-board processor.

In 2003 we used the PWM out and Analog inputs to communicate between the processor and the basic stamp. Decoding the PWM values to get an ~8 bit value and setting a hardware PWM to perform and DAC function to send ~8 bits back.

This year I would like to use the Programming port for two way communications. The question: Has anyone done that? And how/what was your algorithm? What processor did you use, etc.

Thanks.
  #2   Spotlight this post!  
Unread 26-05-2003, 17:05
rbayer's Avatar Unsung FIRST Hero
Happy Birthday! rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
I've done it to talk to a PC, but never another uP. If you're interested in that, check out RoboCon at my website (www.robbayer.com). The included bsx file may be useful in writing the PBASIC side of things...
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #3   Spotlight this post!  
Unread 27-05-2003, 10:57
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
With the number of bytes you are passing with RoboCon, 37, your main loop takes well over the 26ms between radio packets. You also put in a bunch of bytes for headers, etc. I like the use of control bytes to cover the 0xFF and 0x00 cases. I do something similar in as much as I serout/serin with timeout. I do not use a header or 0x00/0xFF checking as the micro doesn't care and the link seems pretty reliable.

One area I am having trouble with is every so often the basic stamp loses one (or more, there is no way to tell) charactors and times out of the serin. I am struggling to figure that one out. One packet every couple seconds probably isn't worth too much effort, but I do want to understand why. Re-synching is't a problem as the co-processor is already waiting for the next packet when the basic stamp times out. So far the co-processor always gets it's packet w/o error.

Cheers!
  #4   Spotlight this post!  
Unread 27-05-2003, 11:35
JLambert's Avatar
JLambert JLambert is offline
Registered User
#0151 (Wild Cards)
 
Join Date: Jan 2003
Location: Nashua, NH
Posts: 49
JLambert is an unknown quantity at this point
Send a message via ICQ to JLambert Send a message via AIM to JLambert Send a message via Yahoo to JLambert
Our robot from this year had an external circuit using a Microchip microcontroller. The microcontroller collected wheel rotational data, and the robot controller would send a request every loop to the circuit. Upon the request, the circuit would send data collected so far.

The chip was programmed in C, so it's not excessively complicated. We primarily had trouble just getting the two to talk at the same baud rate. I'm honestly not sure of how exactly it was done, because I was more involved with the primary programming of the robot, but I'll find out more later.
__________________
Justin Lambert
02-03: Programmer Team #151
  #5   Spotlight this post!  
Unread 27-05-2003, 12:03
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Quote:
Originally posted by JLambert
Our robot from this year had an external circuit using a Microchip microcontroller. The microcontroller collected wheel rotational data, and the robot controller would send a request every loop to the circuit. Upon the request, the circuit would send data collected so far.

The chip was programmed in C, so it's not excessively complicated. We primarily had trouble just getting the two to talk at the same baud rate. I'm honestly not sure of how exactly it was done, because I was more involved with the primary programming of the robot, but I'll find out more later.

What compiler did u use? What was your experience with it? I have been looking for a C compiler for Pics. Also what Pic did you use?
__________________
1139 Alumni
  #6   Spotlight this post!  
Unread 27-05-2003, 15:29
JLambert's Avatar
JLambert JLambert is offline
Registered User
#0151 (Wild Cards)
 
Join Date: Jan 2003
Location: Nashua, NH
Posts: 49
JLambert is an unknown quantity at this point
Send a message via ICQ to JLambert Send a message via AIM to JLambert Send a message via Yahoo to JLambert
Quote:
Originally posted by Rickertsen2
What compiler did u use? What was your experience with it? I have been looking for a C compiler for Pics. Also what Pic did you use?
We used a compiler called C2C, I'm not familiar with where we got it from, but it was a basic C compiler, but we had to have another program to load the assembled code to the PIC.

I honestly did not use it very much myself. As I said, I was more focused on the main PBASIC code of the robot, and did not deal a whole lot with the PIC coding.

I know it was a 16 series, I have it written down somewhere, I'll let you know when I find it.
__________________
Justin Lambert
02-03: Programmer Team #151
  #7   Spotlight this post!  
Unread 02-06-2003, 09:32
Matt Reiland's Avatar
Matt Reiland Matt Reiland is offline
'The' drive behind the drive
None #0226 (TEC CReW Hammerheads)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1999
Location: Troy Michigan
Posts: 712
Matt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond repute
Cool Deal JLambert

I am experimenting right now with a PIC and was looking for some code snipets to get it talking with the Robot Controller. Any help on the C portion of the code and the request in PBasic would be a great help to all of the teams.

Hint, Hint This would be a great White Paper!
__________________
Robonaut Next Generation Control System Development

2003 GLR Champions (302,67,226)
2003 Buckeye Semi-Finalists(902,494,226)
2002 Nationals QuarterFinalists
2001 West MI QuarterFinalists
2000 GLR Semi-Finalists
  #8   Spotlight this post!  
Unread 10-06-2003, 18:29
JLambert's Avatar
JLambert JLambert is offline
Registered User
#0151 (Wild Cards)
 
Join Date: Jan 2003
Location: Nashua, NH
Posts: 49
JLambert is an unknown quantity at this point
Send a message via ICQ to JLambert Send a message via AIM to JLambert Send a message via Yahoo to JLambert
Quote:
Originally posted by Matt Reiland
Cool Deal JLambert

I am experimenting right now with a PIC and was looking for some code snipets to get it talking with the Robot Controller. Any help on the C portion of the code and the request in PBasic would be a great help to all of the teams.

Hint, Hint This would be a great White Paper!
Well, I'm by no means any expert on the matter. I'm just learning a lot of it myself from the couple of mentors on my team who really knew what they were doing. The C stuff is all basics. If you learn C, which is fairly easy compared to a couple other languages out there, all you really need to know is how to integrate it with your application. My only real suggestion is to FIRST learn a language (wether C or another that can be used) and find out all the info you can from the manufacturer. I know Microchip has lots of PDF Docs on every single chip they make. Make sure you read these all over very thouroughly before hand so you know exactly what your chip can/can't do.
Once I learn a little bit more, I'll be more than happy to post a white paper and help anyone with problems that I may be able to solve.
__________________
Justin Lambert
02-03: Programmer Team #151
  #9   Spotlight this post!  
Unread 10-06-2003, 18:31
JLambert's Avatar
JLambert JLambert is offline
Registered User
#0151 (Wild Cards)
 
Join Date: Jan 2003
Location: Nashua, NH
Posts: 49
JLambert is an unknown quantity at this point
Send a message via ICQ to JLambert Send a message via AIM to JLambert Send a message via Yahoo to JLambert
Post

Quote:
Originally posted by JLambert
We used a compiler called C2C, I'm not familiar with where we got it from, but it was a basic C compiler, but we had to have another program to load the assembled code to the PIC.

I honestly did not use it very much myself. As I said, I was more focused on the main PBASIC code of the robot, and did not deal a whole lot with the PIC coding.

I know it was a 16 series, I have it written down somewhere, I'll let you know when I find it.
The C compiler we used was the C2C compiler from a company called PicAnt. It also requires that you install the MPLAB IDE from Microchip, INC. as well.

From what I can gather, our chip was a 16F864, but don't pin me to that.
__________________
Justin Lambert
02-03: Programmer Team #151
  #10   Spotlight this post!  
Unread 10-06-2003, 23:33
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
IFI Coprocessor: I did it.

In response to my own question, above, I implemented a fairly powerful IFI co-processor that uses the debug port. I found out that by carefull processing you can transfer data between the Basic Stamp and an outboard processor at 28.8kb - fast enough to transfer 33/45 possible bytes (26 inputs and 18 outputs + LEDS) while maintaining the IFI 26ms cycle time. You could transfer all 45 variables, but would extend the cycle time to 35ms or so. The entire project can be seen here http://www.barello.net/FIRST Look at the last two items.

Note, I don't have the board made yet. The plan is for 8 channels of 10bit high speed ADC and 16 bits if general I/O (user defined in code). The current code base has 3 channels of Quadrature decoding (for wheel position, motor velocity, whatever: It keeps up with 20krpm and a four slot encoder) Gyro code that tracks absolute theta from the start and a second serial port for debugging.

The actual board is on hold for the next month or two until I find out what IFI has in store for us (they are re-vamping the RC, apparently).

Cheers!
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
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
Horror Story - Laptop com port again Lloyd Burns Programming 3 17-03-2003 07:33
Dashreader.dll: A Visual Basic .NET user control to read the dashboard port Ameya Programming 4 12-01-2003 23:40
Change to Initializing Inputs and Outputs Jferrante Programming 4 07-01-2003 11:36
Programming Port GreenDice Programming 12 10-01-2002 09:14


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

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