Shop OBEX P1 Docs P2 Docs Learn Events
Multi-threadding — Parallax Forums

Multi-threadding

ArchiverArchiver Posts: 46,084
edited 2004-07-14 23:12 in General Discussion
In a message dated 7/14/2004 4:59:21 PM Eastern Daylight Time,
davemucha@j... writes:

It is my understanding that the engine core sees one
instruction at a time and then does what is needed.

since this list dedicated to the BasicStamp and it's variants, why
not ask HOW it can be done on a Stamp ?


I was under the impression that BasicStamps at least the BS1 and BS2
couldn't really do multi-tasking but had to take the tasks one at a time and if you
needed to do multiple task at the same time you needed multiple Stamps.

I may be wrong about that as it has been awhile since I did any design with
the Stamp. But have a new project coming up that should be ideal for it.
Small single axis machine control with just a few I/O points.


Randy Abernathy
4626 Old Stilesboro Road NW
Acworth, GA 30101-4066
Phone / Fax: 770-974-5295
Cell: 678-772-4113
E-mail: Cnc002@a...

I furnish technical support, repair, and other related services for your
industrial woodworking machinery. My background as Senior Service Engineer for
the SCMI Group for nearly fifteen years with factory training, combines with
my extensive background in electronics, mechanics, pneumatics, electrical and
CNC machinery to offer you needed support for your machinery.


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-07-14 21:20
    --- In basicstamps@yahoogroups.com, "nagibabu2000" <nagibabu@c...>
    wrote:
    > please pardon me if this is not the right place for this question.
    > But, I'm struggling with this question for a few weeks now.
    >
    > I'm in the process of redesigning my miniature autonomous robot -
    > ALIBE. Please see LOSA
    > (http://www.hth.com/filelibrary/txtfiles/losa.txt).
    >
    > One of the requirement is for multiprocessing. Obviously BS2 won't
    > cut it. B-X will handle it. However, I'm totally ignorant of B-X.
    > You guys seem to have knowledge on the 2 processors. I also need
    > speed, ability to not poll but, respond to events - as in a true
    > event driven programming, etc.
    >
    > Do you guys know or can point out pros and cons from building and
    > developer angle. I have been to the B-X site and saw the compare
    > sheet. But, not enough to convince me to jump on the B-X wagon.
    >
    > Any help, ideas, or links to your B-X projects would be of great
    help.
    >
    > thanks in advance
    > nagi

    I too am ignorant about how a microcontroller can do multi-
    processing. It is my understanding that the engine core sees one
    instruction at a time and then does what is needed.

    since this list dedicated to the BasicStamp and it's variants, why
    not ask HOW it can be done on a Stamp ?

    Dave
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-14 23:12
    Hmmmmm.....

    Here's an overview on what I remember about the architecture of
    microprocessors, so please anyone jump in to correct me or extrapolate a
    bit.

    I think you need a primer on interrupt vs. polled processing. In reality,
    all microprocessors can only do one thing at a time. But their hardware
    architecture can be designed to allow the processor to be "interrupted" by
    something like a switch closure on an I/O line. Then the processor is
    "interrupted" to go service that particular process. That way the processor
    can happily be doing it's own thing full time until you close a switch, or
    an RS-232 port has incoming data, or an LCD screen needs to be refreshed, or
    whatever.

    The other way to do this is via "polled" ports, where the microprocessor
    takes care of checking each port every few hundred milliseconds or so to see
    if a contact has been closed, or a servo needs to be refreshed, or whatever.
    This works, but does force you write a program that will revisit each port
    quickly enough not to drop data or screw up an external process, like a
    servo motor which needs a pulse every so many milliseconds.

    Polled vs. Interrupt driven architectures are part of the initial design of
    the processor, so you can't upgrade it.... if you want to go from polled to
    interrupt processing you'll need a different processor with the hardware and
    operating system that supports interrupts. Essentially the support hardware
    has extra logic to make this interrupt cycle happen transparently before
    returning to the "show already in progress" by the processor.

    Of course, you should be able to simulate interrupts on a Stamp with some
    clever hardware and programming where a bunch of external process with
    open-collector ports would be bussed together on a common input port on the
    Stamp. Then if any port or device needs to be serviced, it would pull that
    "bus" true, and the Stamp would only need to poll that one line every so
    often to check for interrupts. The Stamp would then need to determine which
    external gadget interrupted it, and jump to that part of the instruction
    set. Not a simple thing to do, but theoretically possible if I understand
    Stamp architecture sufficiently. Don't count on doing this for a complex
    project, but it would be an interesting experiment.

    Don't ask me about the programming tricks to implement this, I'm just a
    hardware guy that dabbles in programming.


    Mike Sokol
    mike@f...


    Fits & Starts Productions, LLC
    The Leader in Recording & Sound Seminars
    "Furthering Technology & EducationT"
    www.fitsandstarts.com


    Original Message
    From: <cnc002@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, July 14, 2004 5:10 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Re: Multi-threadding


    >
    >
    > In a message dated 7/14/2004 4:59:21 PM Eastern Daylight Time,
    > davemucha@j... writes:
    >
    > It is my understanding that the engine core sees one
    > instruction at a time and then does what is needed.
    >
    > since this list dedicated to the BasicStamp and it's variants, why
    > not ask HOW it can be done on a Stamp ?
    >
Sign In or Register to comment.