I know this was kind of discussed last year but I there weren’t any threads with what I wanted.
With the “custom electronics,” it is possible to buy a Basic Stamp Chip to use for dedicated control use. But how would one transfer information from the Stamp to the IFI Control System (or vice versa, if possible)?
I hope that it is possible to move a byte of information from the I/O pins to the Control System’s analog in port (using legal parts). If that is not possible, moving information using the digital in ports.
The data that I want to transfer is stuff like sensor readouts that I would like the Stamp to keep track of information, for example, box distance calculated by using two sensors.
Using the analog ports wouldn’t be reliable if you want to transmit the exact byte. I think you should be able to use the digital in for this, however.
You can get data in to the RC fairly easily via the digital inputs, but getting data out of the RC would require that your custom box reads either a PWM or eight relays. Unfortunately, as many threads here have concluded, the IFI control system’s PWM is not the same as the STAMP PWM.
i think if you used the PWM functions on the outside stamp you could fairly accurately output analog data to the RC… I’ll add this to my list of things to try. If you get it to work please share the details here on the forums.
My main goal is to get an approximate value out of the Auxilliary Stamp Chip. Perhaps if one was truely desperate, they could use the tether/debug talk to the Stamp, but that’s insane. However, that data I want to send is more “parallel” and I don’t want to tie up tons of digital inputs.
*Originally posted by nwagers *
**i think if you used the PWM functions on the outside stamp you could fairly accurately output analog data to the RC… I’ll add this to my list of things to try. If you get it to work please share the details here on the forums. **
The RC’s PWM is not the same as the Stamp’s PWM, so I’m guessing it isn’t going to work. Furthermore, the stamp has no “PWM in” type function.
]*Originally posted by Kai Zhao * My main goal is to get an approximate value out of the Auxilliary Stamp Chip. Perhaps if one was truely desperate, they could use the tether/debug talk to the Stamp, but that’s insane. However, that data I want to send is more “parallel” and I don’t want to tie up tons of digital inputs.
Doing it throught the program port is actually not that insane. This is how RoboCon works, and it really isn’t that hard. Plus, the Stamp has native support for RS-232, so you wouldn’t even need any addition electronics. Unfortunately, it is not legal to exchange data in any way other than with the digital/analog inputs on the RC. This also rules out the idea of doing it with PWMs.
May I ask what advantage this would have, aside from letting you input a few number of sensors?
*Originally posted by rbayer * Unfortunately, it is not legal to exchange data in any way other than with the digital/analog inputs on the RC. This also rules out the idea of doing it with PWMs.
This is not quite accurate. The outputs of the custom circuit can only be connected to the digital/analog inputs on the RC. The circuit may receive input from a PWM out.
From rule C29:
Inputs to the circuits may be connected to the following sources:
· Circuit breaker outputs.
· Speed Controller or Relay module outputs.
· PWM or Relay outputs on Robot Controller.
· Switches, Potentiometers, the Yaw Rate Sensor, Optical Sensors, Motors and
other additional electronics allowed in the restricted parts list.
OK, first of all… I’m pretty sure you’re not allowed to be connected to the program port during a match.
Second (and yeah, I am thinking about doing something like this), I’m pretty sure it can be done, and easily. Here’s how I would do it:
For inputs to the auxiliary Stamp, feed it with either PWM or relay outputs from the RC. If you want to use PWM outputs, just make them operate digitally, ie. give it either 0 or 255. Then just read the digital data from off the pins on the aux Stamp. You could use one output as a clock to send more data.
To output from the Stamp to the RC, I would say just connect the IO pins of the Stamp to the digital input on the RC. You might have problems with using analog inputs, because I’m not sure how they sample and PWM isn’t really a variable analog voltage. You could use a clock line here, too.
If you need more pins on the Stamp, you can try the 40 pin model.
Just a thought, still has a lot of stuff to be worked out.
You guys are right on track. I’ll throw in some stuff that might help.
Remember that each relay output has 2 bits - so to transfer an 8 bit value from one processor to the other you only need 4 relay outputs.
If you read the digital inputs while the other processor is changing them, you can read a corrupted byte. You’ll need to figure out some way to ensure that the data that came across the digital ins is valid.
I think that the PWM outs from the RC never go full DC. Even at 0 or 255 they’re still pulsing, I believe. I’ll try to remember to check this tomorrow on the scope, unless someone else can confirm this.
Finally, if you have any engineers on your team who have some experience with it, I’d highly recommend trying to use some other processor than the stamp. If you get a HC08 or a PIC you’ll get a processor that is orders of magnitude faster, cheaper, and not that much more difficult to program.
Doing a microcontroller based custom circuit is a lot of work but it’s fun and it’s a great learning experience. We had a good time building ours last year and we’re well on our way to having a plan for this year’s.