Shop OBEX P1 Docs P2 Docs Learn Events
Can you easily make a way for two Propellers to comunicate? — Parallax Forums

Can you easily make a way for two Propellers to comunicate?

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2009-01-27 18:04 in Propeller 1
I am working on a project that includes three propeller chips and the connections go like this: Prop 1 is connected in a duel serial line with Prop2, and prop 2 loads programs into prop 3. If·Prop 2 has a collections of programs to be run by Prop 3 and prop 1 tells what to load, how would they communicate? (P.S. The serial comunication is through a phone jack with the probes on the Propeller straight through to the wires of the jack, and the cable ends at the "Hydra-Net" port on a Hydra, which has a filter and resistor on it. ) Also, I am using the Propeller Loader·Object for Prop 2 to Prop 3, and just the Phone line for connections between Prop1 and Prop 2. Here is a pictre of the custom Duel-Propeller PCB before the Phone jack was added. Neither of the connections work and that is the·problem. Please explain·simply what I should do because I have only been learning the Propeller for·4 months and I am only 14. Thank you for your patience. smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thank you for reading!·
1600 x 1200 - 581K
004.JPG 580.7K

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-26 00:29
    The easiest way is to use 2 pins and communicate serially - use the FullDuplexSerial object. 115200 baud or slower will work fine. You may achieve higher speeds, but start here first. I am planning to communicate >1Mbaud (untested and unproven), but to do that I am using a common oscillator and synchronising the cogs.

    If you have problems, just ask here - there are plenty of willing people on the forum only too happy to answer your questions smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-01-26 01:00
    @microcontroled1204

    Your doing great! The info below should help you.
    Beau Schwabe (Parallax) said...
    Ok, beta testers... I have run this DEMO and tested over 100 Billion data Bits with no Transmission Errors over the distance of 10 feet from one Propeller to another Propeller.
    Here is a beta release before I place it in the object exchange. ... Enjoy!!

    Click here for the complete info:
    http://forums.parallax.com/showthread.php?p=691952

    Have fun!

    Bob

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-26 04:33
    Suppose I need to put this into the Object exchange Huh?! ... I think it's ready, i.e. haven't heard too many complaints about it, I just wanted to clean it up a bit and make the handshaking a little more seamless.

    This project however was designed exactly for the purpose of high-speed data transfer from Propeller to Propeller ... because of this I did not conform to standard serial communication and decided to use features that were unique to the Propeller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • LeonLeon Posts: 7,620
    edited 2009-01-26 04:44
    It could be tested on one Propeller with one cog transmitting and another receiving, presumably.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-26 05:12
    Leon,

    Initially that's how I wrote the code, and then I moved it to two separate Propellers. I only tested it to 10 feet and the wire I used was purposefully poor quality so that it would fall in the worst extreme.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • AleAle Posts: 2,363
    edited 2009-01-26 06:28
    I use Beau's method, either 4 or 8 parallel bits. Works quite well. I use it bidirectionally but it is still half-duplex. My propellers are separated a few cm, and not 3 m. Some high-speed differential buffers and recievers can be used in the case of longer distances.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-01-26 06:34
    Beau,

    Would you please post the code? I think we understand it is experimental.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional
  • dMajodMajo Posts: 855
    edited 2009-01-26 07:17
    @Quantum, look at Bob's link (code there)
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-01-26 16:17
    One thing I don't understand about the whole data transfer is how to rieceive the data with the RX line. I have tryed many different communication objects including Simple Seirial, Full Duplex serial, BS2 commands (with the debug in/out command) and Serial COM. (I have not yet tryed the object above) Every one of those objects required something to rieceive the data from the RX line.
    My communication object is :

    {{ Propeller communicate test }}

    Obj
    Ser : "Full_Duplex_Serial"

    PUB Start

    Ser.init (3, 4, 3, 19600)
    Ser.tx (Bit1, 8)
    if Ser.rx | Bit1
    Ser.tx (Bit3, 8)
    else
    Ser.tx (Bit2, 8)

    DAT

    Bit1 byte %11111111 ' Return true
    Bit2 byte %00000000 ' Return False
    Bit3 byte %10101010 ' Confirm

    will this work? Or will I have to store the value in a varible? If so, how do I do it? How do I read the data bit from the transfer?
    I am not very experienced so please help!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank you for reading!·

    ···
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-27 03:17
    I am hoping to use the counters to shift the data in and out to get really high speed blocks. My clocks (therefore props) are synchronised.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-01-27 03:56
    Cluso,

    Did you use an external clock to synchronize the two props?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-27 05:10
    yes (a crystal oscillator). It's the only way to synchronise high speed without using a CLK pin like I2C or SPI. You still have to bring the cogs from different props into sync though.

    My plan is to send a start bit, followed by x bits (say 64 bytes [noparse][[/noparse]or more]·of 8 bits = 512 bits) followed by stop. I know the counters (video) can clock the bits out, but I am unsure at what speed I can clock in using the counters and which mode - but this can wait for now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz

    Post Edited (Cluso99) : 1/27/2009 5:15:50 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-27 05:23
    microcontroled1204,
    The serial I/O drivers already take care of processing the 8-bit values passed to ser.tx to make them into a bitstream and they do the equivalent to take a bitstream and extract 8-bit values that are returned by calls to ser.rx.

    The easiest way to understand what's going on is to look at the Simple_Serial object and particularly the rx and tx routines. Each routine is really only about 7 lines of Spin. Take some sample data (like the value %10101010) and run it through the transmit routine on paper. Take a piece of paper and make a column for each variable and a couple of columns for intermediate results. Each line on the paper is a statement of the program (or a convenient part of a statement). For example, if the statement is "i := i + 1", you might have the value 4 on the current line. Start a new line and, in the "i" column put 5, then go on to look at the next statement.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-01-27 12:53
    Thank You! The project i am working on is very big so help is still greatly appreciated!

    P.S. Does anyone know if theres going to be another Propeller Design Contest this year??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank you for reading!·

    ···
  • TreeLabTreeLab Posts: 138
    edited 2009-01-27 13:49
    microcontroled1204
    The Full duplex codes run in their own cog, so they must be 'start'-ed, not 'init'-ed. As Mike pointed out, the source code is the best reference possible. (Use the Source Luke, Use the Source). The easiest way to check these codes out is to connect via the PropPlug to a PC running a terminal program, or PropTerm, etc. Then you can really see what is going across the wire. There are also multi-serial versions available in the ObEx that can reduce the cog count in busy systems.
    Cheers!
    Paul Rowntree
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-01-27 16:05
    The number of cogs luckily doesen't matter in this project considering that having 3 Propellers comunicate gives you 24 cogs. Oh... I forgot to mention that I was running Full_Duplex_Serial_Plus_Plus.
    The first PUB routine there is "init". Another question: What is PropTerm???

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank you for reading!·

    ···
  • TreeLabTreeLab Posts: 138
    edited 2009-01-27 17:08
    PropTerm was written by Ariba specifically for working with the prop over the serial port. It makes it easier to switch back and forth from the PropTool than with HyperTerm or its ilk, (where you have to disconnect before recompiling, then reconnect afterwards)

    http://insonix.ch/propeller/prop_term.html

    The download links are at the bottom of the web page.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-01-27 18:04
    I succecesfuly downloaded PropTerm! I didn't expect it to be in Germen, though.
    Thank You for the help!
    Help is still appreciated, however, thank you!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank you for reading!·

    ···
Sign In or Register to comment.