Two Props, one global ram buffer?
rwgast_logicdesign
Posts: 1,464
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
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.
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.
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.
[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]