Shop OBEX P1 Docs P2 Docs Learn Events
BS2 to BS2SX — Parallax Forums

BS2 to BS2SX

NWCCTVNWCCTV Posts: 3,629
edited 2012-10-26 15:45 in BASIC Stamp
After doing some research I see that it is possible to connect 2 or more BS2's to work together. My question is, can the same be done with 1 Ea. BS2 and 1 or more BS2SX's?

Comments

  • davejamesdavejames Posts: 4,047
    edited 2012-10-13 20:06
    In terms of them communicating with each other, I don't see why not. The BS2sx is just an enhancement of the venerable BS2 with more memory, faster, and a couple more commands.

    How are you conceiving them "working together"?
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-10-13 21:00
    I want to control my motors and possibly LED's with the BS2SX. I want to use one or maybe two BS2's to control Sensors and stepper motor drivers. Does this sound feasible?
    I know, I should use a Propeller. However, I know PBasic pretty well and spent a lot of timing learning it and I want to get this bot going. I have Propeller chips and demo board. I am learning Spin but do not have it down as well as PBasic. Once I have everything going with the Stamps and PBasic I will convert over to the prop. I want to learn as much as possible by working with both stamps and the propeller.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-10-13 22:11
    Sure, you can mix and match different Stamp models. Just be sure you've put the right Stamp model in the $STAMP directive and adjust the timing constants appropriately.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-10-15 22:46
    I mixed different stamp processors within the BSS project by matching the BAUD rates.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-10-15 23:03
    @humanoido, That thing is AWESOME!!!! My plan is not that advanced by any means. I was only planning on 2, maybe 3 at most!!!!
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-10-22 01:26
    Thanks. Here's a page I did a couple years ago with more multiple Stamp projects. The projects range from 2 and 3 Stamps on up. As you can see, the concept is the same with 2 and 3 Stamps as it is with over 20.
  • FORDFORD Posts: 221
    edited 2012-10-22 04:11
    Just a gentle warning,

    If you are going to communicate serially between the 2, keep the speeds below 9600 to receive reliably, and even slower if your code isnt in hurry.

    Also, if one of them is going to only receive data from the other, make the faster one the receiver.

    You should also probably consider the bs2p if you haven't yet purchased the bs2sx, it has more commands available to it, including 1wire devices.
    It also has a command called SPSTR - which is ideal for receiving small strings of data, it receives them and puts them straight into ram.

    cheers,
    Chris
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-10-25 11:55
    Here's the declaration setup I used in my program. It covers BS2, BS2sx and others used in the BSS.
    ' ---------------------- Declarations -------------------------------
    
    #SELECT $STAMP ' conditional compilations - run on other Basic Stamps
      #CASE BS2, BS2E, BS2PE
        T1200       CON     813
        T2400       CON     396
        T4800       CON     188
        T9600       CON     84
        T19K2       CON     32
        T38K4       CON     6
      #CASE BS2SX, BS2P
        T1200       CON     2063
        T2400       CON     1021
        T4800       CON     500
        T9600       CON     240
        T19K2       CON     110
        T38K4       CON     45
      #CASE BS2PX
        T1200       CON     3313
        T2400       CON     1646
        T4800       CON     813
        T9600       CON     396
        T19K2       CON     188
        T38K4       CON     84
    #ENDSELECT
    SevenBit        CON     $2000
    Inverted        CON     $4000
    Open            CON     $8000
    Baud            CON     T9600 + Inverted
    I               CON     254              ' LCD Instruction prefix value.
    CLR             CON     1                ' LCD clear-screen instruction
    LINE2           CON     192              ' LCD Address of 1st char of 2nd line
    L1_C7           CON     135              ' LCD Address of line 1, character 7
    L2_C8           CON     199              ' LCD Address of line 2, character 8
    n               VAR     Nib              ' LED data light flash cycle
    
  • Rural GeekRural Geek Posts: 17
    edited 2012-10-26 09:27
    @Humanoido that is a wild set up. nice job.

    @NWCCTV This is a great idea I wasnt sure about this untill I read here. It will help me with my bigger robots once I learn the language for the BS2. Insted of learning the Prop Just use more BS2's and break the robot up into sections. Now i have to learn about serial communication.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-10-26 11:09
    Cooperating multiple microcontrollers is a great way to handle complex control tasks. You do have to be careful that the added "expense" of the communications doesn't slow down the microcontrollers to the point where adding another microcontroller slows things down to where you're worse off. If you're reasonably careful about assigning work to the various microcontrollers, that shouldn't be a problem. Do consider using specialized controllers for specific functions. For example, the ServoPAL and the Propeller Servo Controller can take over the control of multiple motors and save the main microcontrollers a lot of work.
  • Rural GeekRural Geek Posts: 17
    edited 2012-10-26 15:45
    @ Mike
    Again thank you for all the info you have provided. I am only looking at only 2 at most 3 BS2's but that is a way off for me. I have to crawl before I run. but I'm learning.
Sign In or Register to comment.