Shop OBEX P1 Docs P2 Docs Learn Events
Multitasking with the stamp — Parallax Forums

Multitasking with the stamp

FlorezFlorez Posts: 4
edited 2006-06-12 14:19 in Learn with BlocklyProp
Is there anyway to increase the multitasking capability of the stamp.· I am trying to control two servos, and read temperature at the same time.· However, doing these two tasks at the same time is quite difficult with the stamp.

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-05-17 17:30
    This won't be a great answer, but I'd recommend you switch over the Propeller from Parallax. It has 8 cores, each can do a different task. http://www.parallax.com/propeller

    Or, get a serial servo controller to drive the servos when the Stamp is busy elsewhere. Also from Parallax.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Southern Illinois University Carbondale - Electronic Systems Technologies

    Personal Links with plenty of BASIC Stamp info
    StampPlot - Graphical Data Acquisition and Control
  • edited 2006-05-17 18:18
    On the other hand, if you're having that much difficulty with three simple tasks with the BASIC Stamp, the Propeller might not be an appropriate jump.

    Controlling two servos and measuring temperature should be really easy. What kind of temperature sensor are you using?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-17 19:04
    Andy's right...If a BOE-Bot can control 3 servos and read several sensors with a stock BS2 then reading temperature and controlling two servos doesn't seem like a lot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • edited 2006-05-17 20:41
    The best thing to do would be to post the manufacturer/part number of the temperature sensor you are using. Your current code and your goals for the code will help to. With that information, we can make recommendations that will probably make it possible for your BASIC Stamp to work on those three tasks with bandwidth to spare.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-05-18 00:59
    Sorry for the not-focused answer. Guess I'm too propeller happy these days [noparse]:)[/noparse]

    Why not post your code, and as mentioned, your temperature sensor name/specs and we can look it over and give some recommendations where you can make some speed increases. The term multasking isn't really appropriate here since it will be one program that does all you need instead of several programs trying to run concurrently.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Southern Illinois University Carbondale - Electronic Systems Technologies

    Personal Links with plenty of BASIC Stamp info
    StampPlot - Graphical Data Acquisition and Control
  • Mike GreenMike Green Posts: 23,101
    edited 2006-05-18 04:56
    There have been several postings here in the recent past on this "multitasking" in relation to servos. Servos require a pulse between 0.5ms and 1.5ms in width about every 20ms. That leaves more than enough time for 8-10 such pulses each cycle, one for each servo you're controlling. If you're only controlling 2-3 servos, that leaves plenty of processing time to read a temperature sensor and do a bit of computation like: <read temperature>, <compute servo positions>, <output servo 1 pulse>, <output servo 2 pulse>, go back to beginning.
  • StampNut2StampNut2 Posts: 224
    edited 2006-06-10 23:09
    If it's any help I am using bluebell design co-processor board which of loads all the hard work functions and leaves my bs2p40 free for other functions.

    http://www.bluebelldesign.com/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-06-12 14:19
    For reliable multi-tasking, you need an accurate source of 'ticks', which you can use for context switching.
    See http://www.rhombus-tek.com/co-processors.html

    He has programmed an 8-pin DIP to be a 'tick' generator, as well as a serial recieve buffer. And he has some nice multi-tasking state-machine design code.
Sign In or Register to comment.