Shop OBEX P1 Docs P2 Docs Learn Events
So many things for one basic stamp 2sx to do? Out of variable Space... — Parallax Forums

So many things for one basic stamp 2sx to do? Out of variable Space...

AndrewParsonsAndrewParsons Posts: 13
edited 2012-01-28 17:10 in BASIC Stamp
Hi all.

First let me share with you my project. I am building a underwater tethered ROV. I am using (or was) trying to use a Basic stamp 2sx to control 6 thrusters (brushless drills) with 6 HB-25 Motor Controller. As for sensors I have humidity, temperature, xyz accelometer and leak detection.

I was using 2 stamps to communicate over rs-485 from the surface to below. This was done using two RS-485 Transceivers. I have found this to be a horrible and slow way to communicate.

Anyways, I consider myself one step above a newb, I have thought myself Basic and about microcontroller using Parallax's stamp in class.

The main problem I am having is I am running out of variable space on my Basic Stamp 2sx below water level.

I have trimmed the code as much as I can trying to reduce WORD variables as much as I can. Could anyone point me in the right direction? I am looking to move to similar setup with more than 32kb of program space so i have plenty of room to expand my project.

I guess my question is more of a plea for suggestions. I would like to increase my variable space and/or move to a setup that I am already familiar with that has more variable space (Like Basic Stamp2)

I looked at the prop but programming in C looks greek to me, and I find the training is nowhere near as straight forward as Stamp in class.

Thanks in advance
and sorry for the newbness

Andrew

Comments

  • Mike2545Mike2545 Posts: 433
    edited 2012-01-28 10:51
    Aside from trimming your code, which it sounds like you have already done there are “Program Slots”, but you have to share the variable space and switching between them can get confusing. That being said, I have run into a similar situation and have taken up Pic Basic Pro, which allows program space on some PIC chips to 96K.(18F2685) Set up is a little harder than the Stamp but the overhead is great.
  • AndrewParsonsAndrewParsons Posts: 13
    edited 2012-01-28 11:25
    Thank you very much for the suggestion... could you expand on the setup and what you use to for it? After a bit of research this seems to be a great altenative. Again, thanks in advance.
  • stamptrolstamptrol Posts: 1,731
    edited 2012-01-28 11:29
    Sounds like a neat project.

    The usual way to deal with running out of variables is to re-use them in different parts of the program.

    With 8 program slots available and the scratchpad space, the project you describe should fit into the BS2sx. You didn't include your code so its hard to make concrete suggestions.

    I'm a bit surprised at your poor luck with RS-485. If the proper handshaking is taking place between the surface controller and the submerged unit, you should be able to have a system able to control the ROV in real time.

    Also, just for clarity, what is a "brushless" drill that can be controlled with an HB-25?

    Cheers,
  • Mike2545Mike2545 Posts: 433
    edited 2012-01-28 11:41
    What I mean about the set up being harder than the Stamp is, you need a programmer the (PicKit2) would be a good one. Then you need to set up the PC with MPLAB (free download from Microchip) and have Pic Basic Pro (PBP) find your programmer, route the environmental path and you are pretty much set..
  • AndrewParsonsAndrewParsons Posts: 13
    edited 2012-01-28 11:56
    Tom,

    Thanks for the help... could you explain in simple code how one would re use a variable and use the scratch pad with rs-485. This is beyond the scope of what i have learned thus far with Stamp in Class. Also to clarify I wanted to use my HB-25 for my drills, from your comment i have looked into the matter and see this is not an option. I can use bielge pumps for thrust or use oil filled thruster with regular 12v dc drill motors.

    That would have sucked dropping all that money on brushless drills. lol Thanks.

    I have already spent the money on the six HB-25, mainly because i can get away with only using 3 pins to control them all.

    I look forward to your reponse.

    Andrew
  • stamptrolstamptrol Posts: 1,731
    edited 2012-01-28 17:10
    It would likely be easier for me to work with your own code, but as a learning exercise, here's something for you to look over.

    The BS2 code (one program) was tasked with the motor control on a remote control barge used in water quality testing. It used a standard r/c radio for inputs and controlled two drive fans to move the barge. It also could operate a water sampler and a winch for lowering the anchor.

    The other 6 programs (the one called "master" is loaded into slot 0) were in the BS2sx and it read the instruments serially then used a data radio to send the information back to the shore based computer. The same code would be used whether you used rs-232, rs-485, or data radios, as I did.

    Cheers,
Sign In or Register to comment.