Re: Sharing memory



On Thu, 08 Mar 2007 07:13:09 -0800, eromlignod wrote:

I'm an ME and I have an application where I'd like to use two Basic
Stamp microcontrollers working together. One is the main processor
that runs the show and does calculations; the other is a dedicated
slave that constantly distributes a series of 16-bit numbers to
various devices in a continuous, timed loop. The first processor
calculates what these numbers are based on feedback sources.

The reason I use a dedicated second processor is that its stream of
numbers can't be interrupted...it has to provide a continuous series
of values on a clock. The problem is that I can't even interrupt it
long enough to pass numbers to it from the other processor without
messing up the sequence.

What I'd like to try (if possible) is to share the same memory between
the two MCU's. So the first Basic Stamp is calculating values and
storing them to memory and the second Basic Stamp is using them as if
they were in its own memory bank simply by referring to a value by
variable name (or address??...I don't know).

Is this possible and, if so, what would be a good way of going about
it? I'm also open to alternate suggestions to solve the problem
including using a different processor (I would like to avoid investing
in another development kit or chip burner if possible though).

Thanks for any help you can provide.


If your "master" is fast enough, you could write a ring buffer so that
the next item of data is waiting for the slave to pick it up. You'd need
some handshaking, so that the master knows when it's time to reload
the buffer, or pause if you're going too fast, but it could be done
with no additional parts, just software.

A ring buffer is just a chunk of memory that's accessed one item
after another, and the index wraps from the end to the beginning;
the master writes to it, and when the slave is ready, it requests
a byte (or whatever) that's guaranteed to be ready to be picked
up. The master would manage the "write" and "read" pointers and
so on.

Good Luck!
Rich

.



Relevant Pages

  • Re: Sharing memory
    ... Stamp microcontrollers working together. ... What I'd like to try is to share the same memory between ... I would implement a periodic update on a timer interrupt and make the interrupt a sufficiently high priority. ... I can understand why you would want to avoid the costs associated with different development kits, programmers, and the increased learning curve. ...
    (sci.electronics.basics)
  • Re: [PATCH] dmaengine: at_hdmac: add DMA slave transfers
    ... memory to peripheral transfers with hardware handshaking. ... Slave structure for controller specific information is passed through channel ... This work is intensively based on dw_dmac and several slave implementations. ...
    (Linux-Kernel)
  • Re: Sharing memory
    ... Stamp microcontrollers working together. ... What I'd like to try is to share the same memory between ... which have 16 I/O pins. ... meant to store the tokenized program, ...
    (sci.electronics.basics)
  • Re: [PATCH] dmaengine: at_hdmac: add DMA slave transfers
    ... memory to peripheral transfers with hardware handshaking. ... Slave structure for controller specific information is passed through channel ... This work is intensively based on dw_dmac and several slave implementations. ...
    (Linux-Kernel)
  • Re: Will Digitals abandonned software ever go "public" ?
    ... common, Cutler was absolutely brutal about it. ... DuPont to do RSX-11M, the small memory version of RSX, and he inspected ... (He had a stamp that said, "Size is the Goal," but I ... I think that coding this tight is one thing that makes ...
    (comp.os.vms)

Loading