Shop OBEX P1 Docs P2 Docs Learn Events
Two Props, one global ram buffer? — Parallax Forums

Two Props, one global ram buffer?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-03-01 10:11 in Propeller 1
So I am setting up two propeller chips, so far they communicate using a standard 1Mbaud uart connection. Basically one collects sensor information and sends it to another prop to be processed. I got to thinking that sending data back and forth at these speed is just fine, but it would be nice to set up some ram to hold Global information for the two props, im thinking a microchip SRAM. Is it possible to have two propellers reading and writing on the same Sram chip? If not is there any way to accomplish this, preferably not SD?

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-03-01 01:50
    Anything is possible with a good memory map and using some semiphore flags to lock shared areas of the RAM to avoid collisions that occur with simultaneous access.
  • Heater.Heater. Posts: 21,230
    edited 2013-03-01 03:17
    Sure it can be done.
    Back in the day we did it with two 8085 micros and a static RAM. Had to build the bus arbitration logic out of a bunch of TTL chips. Which luckily you won't need to do with the Props.

    However, driving static RAM from a Prop is complicated and eats a lot of pins.
    At the end of the day you might find it's not much faster than using a serial link.
    Prop to Prop serial can be done much faster than 1MBit.

    As for those mutual exclusion semaphores, you have to of course start with the Props signalling directly to each other on a pin or two to work out who has charge of the RAM at any moment.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-03-01 03:24
    So I am setting up two propeller chips, so far they communicate using a standard 1Mbaud uart connection. Basically one collects sensor information and sends it to another prop to be processed. I got to thinking that sending data back and forth at these speed is just fine, but it would be nice to set up some ram to hold Global information for the two props, im thinking a microchip SRAM. Is it possible to have two propellers reading and writing on the same Sram chip? If not is there any way to accomplish this, preferably not SD?

    If you are referring to dual-port RAM then it is possible, although not practical. Even if it were only a 2Kx8 RAM it would require around 22 I/O pins just to communicate to this expensive device without much gain. If you stick to the serial link and even use Beau's high-speed data link object where you dedicate a cog to transmitting and one to receiving then they can link the the two Propeller's memory together. The update rate for a full 2K byte block could easily be in the order of 2ms or so. So you are creating your own dual-port serial RAMs by using the Prop's cogs the way it was designed to be used, as virtual peripherals.

    But it would seem unnecessary for the project you have at hand. I had an application a few years back where I had 2 Props collecting and processing information from 12 sensors and they were serially linked to the main Prop for further processing. All this worked really well, there was no need for anything more than this. The simplest solution that adequately performs the function is usually the best solution. Keep it simple.
  • MagIO2MagIO2 Posts: 2,243
    edited 2013-03-01 06:23
    Wasn't there a good while ago a thread from Beau about a high-speed prop to prop protocol which is exactly meant for copying variables from one prop to the other?

    If you can afford the HUB-RAM to keep a bunch of variables in both propellers, I don't see a reason to have a "RAM in the middle"! You can't fill the RAM faster than you can send data to the prop.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-03-01 10:11
    Ya this sounds pretty complicated and impractical. See i was thinking one prop could do hardware control/data gathering and the second one could be totally dedicated to crunching numbers maybe even have a 64bit FPU attached to it (although I doubt i need that kind of accuracy).


    [FONT=arial, sans-serif]I have looked at Beaus object, But he says its not for small amounts of data, and right now im just sending variables and control commands back and forth so i went with serial. The point of the sram wasn't so much speed as it was basically a way to try to easily update values on one prop and have it be in sync with the other prop. I figured if both props ran a dedicated cog that just read the Global values off Sram this would be easier than sending and reciving data back and forth any time one of the global values was updated by either propeller.[/FONT]
    [FONT=arial, sans-serif]Anyways it sounds like sharing sram is not at all any easy task, so ill just stick to some kind of communications protocol.[/FONT]
Sign In or Register to comment.