|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||||
|
||||||
|
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...
|
|
#3
|
|||
|
|||
|
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
|
|||||
|
|||||
|
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. |
|
#5
|
||||
|
||||
|
Quote:
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? |
|
#6
|
|||||
|
|||||
|
Quote:
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. |
|
#7
|
|||||
|
|||||
|
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! |
|
#8
|
|||||
|
|||||
|
Quote:
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. ![]() |
|
#9
|
|||||
|
|||||
|
Quote:
From what I can gather, our chip was a 16F864, but don't pin me to that. |
|
#10
|
|||
|
|||
|
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! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |