Shop OBEX P1 Docs P2 Docs Learn Events
Dual Processor...???? — Parallax Forums

Dual Processor...????

SCGrant327SCGrant327 Posts: 10
edited 2007-02-27 17:26 in Propeller 1
Is it possible to run two Props acting on the same memory? Of course, I am talking about shared RAM...

Comments

  • Stan671Stan671 Posts: 103
    edited 2007-02-27 16:05
    The Propeller already has 8 processors inside the chip sharing the 32K of [url=mailto:#@RAM]RAM[/url] inside the chip.· Do you have an application that needs more than 8 parallel processes running at the same time on the same RAM?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Stan Dobrowski
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-27 16:15
    Sure. Two Props can share nearly anything. When I/O pins are set to inputs, it's almost as if they were not connected. There's a little bit of leakage current and some capacitive loading, but usually that's not significant for logic signals. The main issue is that, if one Prop sets its I/O pin to output a logic high and the other Prop sets its I/O pin to output a logic low, you're probably going to "blow" the I/O pin on one or both of the Props due to the short circuit created. Usually a series resistor (1K to 4.7K) in each I/O lead to the common point will protect the Props against damage, but may slow down the signalling (due to RC delays with the small connection capacitance involved). There has to be some mechanism for one of the Props to "request" the shared memory, then "release" it when done. There's usually a trade off between complicated / expensive / fast vs. simple / cheap / slow.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-27 16:20
    Simple / cheap is to have two pins on each Prop each connected through a 4.7K resistor to the corresponding pin on the other Prop (say I/O 0 on one Prop to I/O 1 on the other Prop and vice versa). I/O 0 on each Prop is set to input and I/O 1 on each Prop is set to output (initially low = 0). When a Prop wants to use the memory, it sets its I/O 1 to high (1 = I want), then waits until I/O 0 is low (0 = Available). At that point, it can use the shared memory any way it wants to. When it's done, it sets its I/O 1 to low. That's all. Try it on paper. You'll see.
  • bambinobambino Posts: 789
    edited 2007-02-27 16:32
    Mike,

    I was playing with a similiar thought the other day. If a pull up resistor was used with a protocal similiar to the one used on the sht11 Humidity/Temp Ic's, would just toggling the dira register for the affected pins cause any heartburn with the propeller guts.

    It would be a great one wire com control, in Theory anyway?
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-27 16:40
    I do not have a need for running two Props...16 processors...YET! Just wanted to see if it was feasible. I may push things to where I need more than 8 processes. If that happens, I will look further into getting two Props to live together nicely.

    Thanks for the help.
  • Stan671Stan671 Posts: 103
    edited 2007-02-27 16:46
    Even if you piggy-backed two Props, they would not have direct access to eachother's internal RAM.· But, you could always set up communications between two (or more) Props to transfer information back and forth.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Stan Dobrowski
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-27 16:49
    bambino,
    Just toggling the DIRA register does work very well for manipulating an open-drain/open-collector type of signal (with a pull-up/pull-down). The reason for the series resistor in this case is to protect against programming errors. If you mis-type a pin number or something similar, you could easily destroy an I/O pin. I'm particularly careful when connecting one microcontroller pin to another since these are designed to provide quite a bit of current (20-50ma or more).
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-27 16:55
    I understand they could not directly access each others internal RAM...but could we not stick in some external RAM that is shared by both?
  • bambinobambino Posts: 789
    edited 2007-02-27 16:58
    Mike, that is most true. I need to remind myself of that more often!
  • mahjonggmahjongg Posts: 141
    edited 2007-02-27 17:02
    Parallax is busy with a version of the Propellor with either more COG's or more internal memory, so perhaps there will be a Propellor with 16 COG's (processors) in the future.

    You can find a discussion thread about it here:

    http://forums.parallax.com/showthread.php?p=617536

    The only other way to have two props sharing memory to do a task together is to set up some kind of intercommunication between them.
    You could setup a system where an 8-bit port and a few control bits are used to interconnect two props (with safety resistors inbetween like mike suggests), to create a fast interconnection system. You need some kind of data sharing protocol running on a COG on boths props too, but it is doable.

    Mahjongg.
  • bambinobambino Posts: 789
    edited 2007-02-27 17:10
    SCGrant327,

    I once did as you suggest with another type microcontroller. Two where connected at their port pins in junction with a stamp. The stamp used their memory and provided a com port to a computer for the other two microcontrollers. Two main concerns doing this:

    One as Mike said, current build up on the bus is dangerous. I took the total number of resistence needed between any two chips and devided it by two. Then I placed that much resistence in front of each chips pins. In my case I needed 440 ohms between any chip, so on each pin was placed a 220 resistor, so no matter who was talking to who I still had 440.

    The other problem is arbitration of bus control. Needless to say control of the bus had to be decided on lines not part of this 3-way bus.(ie; if two where transmitting at the same time then 440*2 ohms would be needed.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-27 17:26
    For a low I/O pin count inter-Prop communications scheme, you could use a Ramtron FRAM 64K I2C serial memory. The FRAM is as fast as the I2C protocol (maybe 10-40K Bytes/sec) without the write "wear out" of conventional EEPROMs. You'd need 2 pins for the shared I2C bus (which is already open-drain) and 2 pins for the Request/Available signalling I described.
Sign In or Register to comment.