Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing two basic stamps — Parallax Forums

Interfacing two basic stamps

silviu.litasilviu.lita Posts: 13
edited 2014-04-12 09:13 in BASIC Stamp
I was thinking of parallelising my boe bot with two boards running at the same time.
One could take care of motion while the other process sensor signals.

Then the question on how to interface them.
One option would be serial communication which I try to avoid.
I was then thinking of pin to pin communication. What I have in mind is when the first board senses, say, something on the Ping :)) sets pin A on high. Pin A is directly connected to pin B on the second board.
The second board then could see the signal.

Would this second solution work?
Do I need to power the 2 boards from the same source or separate sources could work too?

Thanks,
Silviu

Comments

  • GenetixGenetix Posts: 1,754
    edited 2014-04-10 14:22
    If you are having problems getting something to work then describe your set-up, post your schematic, post pictures of your set-up, and post the code you are using.
    Then others can see what you are doing and give you guidance on what to do next.

    Rather than going through the trouble of try to add a 2nd Stamp to your BOE-Bot, use a ServoPal.
    A ServoPal can control 2 servos and it only take a few pulses to get the ServoPal started.
    The ServoPal will then keep sending those same pulses to your servos, freeing up your Stamp to do other things.
    You can also command the ServoPal to stop sending pulses and if want the servos to do something different just send the ServoPal a new series of pulses.
    The ServoPal is very easy to use and it's also inexpensive.

    http://www.parallax.com/product/28824
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-10 14:29
    The boards could have separate power supplies but if you're using some sort of communication with wires between the two boards, you need to make sure the boards have their grounds connected together.
  • ElectrodudeElectrodude Posts: 1,660
    edited 2014-04-10 17:47
    The BS2 is a great chip - it was what got me started with programming and I made hundreds of programs for it. However, I think you would be better off with Parallax's Propeller chip for this. It's a little harder to program but is incredibly more powerful. It has eight processors (called cogs) and is only $8 (ok, about $15 with support circuitry), as opposed to $50 for a single-core BS2. The processors can directly communicate with each other instead of needing two boards and making two stamps talk to each other over wires. If you haven't bought the second BOE yet, you should definitely consider getting a Propeller BOE instead.

    Suggestion to Parallax: Would it be possible to bring back a Spin Stamp but add 5v IO, and make a PBASIC interpreter for it? That way you'll run out of SXs later, and be able to make much more powerful stamps. You don't have to be able to program the other 7 cogs, instead their functions would be standardized - PWM, oscillator, sigma-delta, etc. Obviously, more advanced users should be able to program it as a Propeller.

    electrodude

    EDIT: What kind of sensors and motors are these? I'm guessing they're standard BOE-Bot sensors and motors? Usually, one BS2 can handle both of these together if programmed right. Do you really need two stamps? If you only need one, don't bother with a propeller (yet).
  • GenetixGenetix Posts: 1,754
    edited 2014-04-10 19:07
    Swapping the BOE (Board of Education) for a Propeller Activity Board is one option, but so is replacing the stock BS2 with one of it's more powerful cousins.

    That's why I suggested the ServoPal because it can be easily added and it doesn't cost much.

    The BS2 is very easy to use and most of the texts were written for it.
  • silviu.litasilviu.lita Posts: 13
    edited 2014-04-11 00:06
    Thanks for the reply.
    I was thinking of the ServoPal too but the issue is that I might have to send different pulse values (adjustments) in order to move the bot in straight line, or make 90 degrees turns.
    Note that everything is open loop, I'm not using encoders although I was looking to use Compass but not working well eigher.
    Genetix wrote: »
    If you are having problems getting something to work then describe your set-up, post your schematic, post pictures of your set-up, and post the code you are using.
    Then others can see what you are doing and give you guidance on what to do next.

    Rather than going through the trouble of try to add a 2nd Stamp to your BOE-Bot, use a ServoPal.
    A ServoPal can control 2 servos and it only take a few pulses to get the ServoPal started.
    The ServoPal will then keep sending those same pulses to your servos, freeing up your Stamp to do other things.
    You can also command the ServoPal to stop sending pulses and if want the servos to do something different just send the ServoPal a new series of pulses.
    The ServoPal is very easy to use and it's also inexpensive.

    http://www.parallax.com/product/28824
  • silviu.litasilviu.lita Posts: 13
    edited 2014-04-11 00:18
    The thing is that I have the second board already, I've got it for different reasons but now since it's there I was thinking of using the two in parallel.
    I'm using PING, Compass, Sound Impact at the moment but planning to add also motion detection and Bluetooth (used to receive commands from a smartphone that does voice recognition).
    All of this on one board is too much due to RAM and EEPROM limitations.
    Clearly one option would be to move away from BS2. Would getting a BS2px (more RAM and EEPROM) be also an alternative?
    Thanks.
    Silviu
    The BS2 is a great chip - it was what got me started with programming and I made hundreds of programs for it. However, I think you would be better off with Parallax's Propeller chip for this. It's a little harder to program but is incredibly more powerful. It has eight processors (called cogs) and is only $8 (ok, about $15 with support circuitry), as opposed to $50 for a single-core BS2. The processors can directly communicate with each other instead of needing two boards and making two stamps talk to each other over wires. If you haven't bought the second BOE yet, you should definitely consider getting a Propeller BOE instead.

    Suggestion to Parallax: Would it be possible to bring back a Spin Stamp but add 5v IO, and make a PBASIC interpreter for it? That way you'll run out of SXs later, and be able to make much more powerful stamps. You don't have to be able to program the other 7 cogs, instead their functions would be standardized - PWM, oscillator, sigma-delta, etc. Obviously, more advanced users should be able to program it as a Propeller.

    electrodude

    EDIT: What kind of sensors and motors are these? I'm guessing they're standard BOE-Bot sensors and motors? Usually, one BS2 can handle both of these together if programmed right. Do you really need two stamps? If you only need one, don't bother with a propeller (yet).
  • GenetixGenetix Posts: 1,754
    edited 2014-04-11 15:17
    Wow, that is a lot of accessories that you want to use. You understand that all items not only make your program larger but also add weight and use more power.
    What exactly are you trying to do because maybe you don't need all that stuff or you need a more powerful chip.

    As we speak, the BS2PX, which is the fastest of all the BS2s, is on sale for the price of a regular BS2. The BS2PX has a lot more memory and is a lot faster than a regular BS2.
    The timing of the BS2PX is different from the BS2 so any time related instructions such as RCTIME and PULSOUT need to be adjusted.
    The BS2PX also has its memory broken into 8 slots of 2K each. Think of it as 8 BS2s worth of program space.
    You could place the program for each accessory into a different slot and then call each slot as needed.
    Oh, and the BS2PX has a lot more variable space.

    The sale price on the BS2PX will be good until Parallax opens up Monday morning so think about it and definitely buy it you want to stick with PBASIC.
  • silviu.litasilviu.lita Posts: 13
    edited 2014-04-12 02:52
    Genetix wrote: »
    The sale price on the BS2PX will be good until Parallax opens up Monday morning so think about it and definitely buy it you want to stick with PBASIC.

    Thanks for the tip. I have just ordered it :), cheaper than getting the propeller board + chip.
    Silviu
  • GenetixGenetix Posts: 1,754
    edited 2014-04-12 09:13
    Actually, the Propeller Activity Board is the same price as a BS2, and the Propeller chip is built into it. It's used on the Activity Bot.
    As I am learning, the Propeller is very powerful but the programming is considerably different.
Sign In or Register to comment.