Shop OBEX P1 Docs P2 Docs Learn Events
Prop to prop communication and programming — Parallax Forums

Prop to prop communication and programming

Don MDon M Posts: 1,653
edited 2013-03-01 16:46 in Propeller 1
I would like to look into connecting 2 propellers together. Just a simple Tx from Prop 1 to Rx on Prop 2 and Tx from Prop 2 to Rx on Prop 1. For inter-prop programming there will also need to be a connection of the reset from Prop 2 to Prop 1 (I think).

Prop 1 would be connected to the standard USB interface for programming and debugging. Prop 1 would have 2 pins connected to Prop 2 pins 30 & 31 plus the reset to enable downloading of code from USB > Prop 1 and allow Prop 1 to program Prop 2.

Doesn't have to be super fast 115K baud would be fine.

Prop 2 will operate independently of Prop 1. Prop 2 will respond to commands from Prop 1 and send data back to Prop 1 when requested.

So my questions are:

1. What programs / files / examples / demos exist for doing the inter-prop communication?
2. What programs / files / examples / demos exist for having one prop program the other ?

I would prefer these examples to be in spin / assembler and not other languages if that's possible.

The search of the forum turns up several examples such as Beau's code but would like to know what is tried and true, pros cons etc..

Edit: Can I assume that FDS might work for the inter-prop? But what about programming Prop 2 from Prop 1?

Don

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-27 10:19
    Chip wrote a Propeller loader in Spin which is attached here. Remember that, for loading, the Propeller doesn't really use asynchronous serial I/O, it uses a special self-clocking scheme, so FullDuplexSerial isn't necessary although it can be used, but not with this program. For other communications between Props, FDS is fine. Other options for downloading include the Propeller Backpack loader which gets stored in the EEPROM attached to Prop2 and uses a special protocol that can work through a Stamp or other microcontroller (like another Prop).
  • Don MDon M Posts: 1,653
    edited 2013-03-01 06:52
    I looked over Propeller Loader and have a few questions.

    I need to compile the image for the slave prop, save it as a binary. I give it a name (for example) slave.binary

    Here's where it's confusing to me-

    Where do I store this binary file? Does it reside in a folder on the PC?

    So next I would compile Propeller Loader with pins declared, settings etc. and in the dat section just list slave.binary?

    Then download this to the Master Propeller and somehow it finds slave.binary and starts to load it into the Slave?
  • Don MDon M Posts: 1,653
    edited 2013-03-01 09:02
    Ok I figured it out. The binary file resides in the same folder as the Prop Loader. I was able to connect two QS boards and transfer the file through one to the other.

    But it appears to only load it into RAM? As soon as I reset the slave QS it reverts back to the original program that was in there before.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-03-01 09:35
    PropForth developed a system to work with multiple Propellers that might be of interest to you. The fact that the interpreter is interactive may inspire you to something creative.
  • Don MDon M Posts: 1,653
    edited 2013-03-01 14:40
    PropForth developed a system to work with multiple Propellers that might be of interest to you. The fact that the interpreter is interactive may inspire you to something creative.

    Thanks for the suggestion however I have quite a bit of time invested in my project with the code I have.

    Here's what I found to work satisfactorily so far today:

    My testing setup: USB >>> QS board pins 12, 13, 14 >>> Propeller DNA pins 30, 31, Reset

    1. I saved the EEPROM image of the program that I want to run independently on the Propeller DNA board and named it "loader.pgm" to an SD card
    2. With power off the boards I plugged the SD card into the DNA board.
    3. I powered up the boards and downloaded my simple program containing Chips Propeller Loader to load Brian Riley's SD Loader object http://obex.parallax.com/objects/620/
    3. I powered the boards down then back on and viola! the program that was loaded into the DNA board now runs on it's own.

    Thanks Brian and Chip! This seems to do what I need it to. I just need to make a slight modification to indicate when the SD Loader is finished.
  • Don MDon M Posts: 1,653
    edited 2013-03-01 15:46
    Actually after reading Brian's code a little more in detail I find I don't need to use the Prop to Prop Propeller Loader connection for an upgrade.

    The Slave will have the SD card accessible so I load Brian's object in the lower 32K of EEPROM and the SD card will load the object I need to run in the Slave in the upper 32K of EEPROM. If SD Loader doesn't find an upgrade on the SD card then it runs the program from the upper 32K. So simple.

    The Main prop will always have the USB port accessible so the Main Prop can be updated via USB....

    Gotta love this!
  • tonyp12tonyp12 Posts: 1,951
    edited 2013-03-01 16:46
    >But it appears to only load it into RAM?
    I guess you will have to use command 3.
    Normally the second Prop does not have a eeprom in this sequential boot scheme.

    I was able to use the Chips example to create a C# version, it skips the verify lsr data response though.
    http://forums.parallax.com/showthread.php/138549-C-Prop-Serial-Boot-loader-example-for-the-Silabs-CP2110
Sign In or Register to comment.