PDA

View Full Version : A Couple Prop1<-->Prop2<-->Prop3 Inter-Communication Questions



idbruce
11-16-2010, 03:40 PM
Hello Everyone

I have three Propeller Proto Boards that must communicate with each other.

Here is the setup:
Prop1 must be able to communicate with Prop2
Prop2 must be able to communicate with Prop1 and Prop3
Prop3 must be able to communicate with Prop2

Prop1, Prop2, and Prop3 all have the same _CLKMODE and _XINFREQ constant settings
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000

From the documentation that I have read, I am assuming that I can accomplish this task in the following fashion.

Prop1 has 1 object of FullDuplexSerialPlus

Prop1ToProp2 : "FullDuplexSerialPlus"
Intialize pins 0 and 1 in the start method
Prop1ToProp2.start(0, 1, 0, 9600)


Prop2 has 2 objects of FullDuplexSerialPlus

Prop2ToProp1 : "FullDuplexSerialPlus"
Intialize pins 0 and 1 in the start method
Prop2ToProp1.start(1, 0, 0, 9600)

and

Prop2ToProp3 : "FullDuplexSerialPlus"
Intialize pins 2 and 3 in the start method
Prop2ToProp1.start(2, 3, 0, 9600)

and finally

Prop3 has 1 object of FullDuplexSerialPlus

Prop3ToProp2 : "FullDuplexSerialPlus"
Intialize pins 0 and 1 in the start method
Prop3ToProp2.start(0, 1, 0, 9600)

As I understand it, it is simply a three wire connection between each Prop, a TX line, a RX line, and a common ground. The distance from Prop1 to Prop2 will be approximately four inches, and the connection will consist of three stranded 22 AWG wires in a cable sheathing. The distance from Prop2 to Prop3 will be approximately three feet, and the connection will consist of a four conductor 28 AWG DIN cable assembly.

Okay, there is the proposed layout. Now for the questions.

1. Can I achieve inter-communication as described above?
2. If I am correct in the proceeding assumptions, are there any special wiring requirements that I must be aware of? I assume it should be pin to pin connections, without any need for resistors, capacitors, etc.
3. Again, if I am correct in the proceeding assumptions, what would be the approximate maximum BAUD rate with the described connections?

Any assistance you may provide will be greatly appreciated.

Bruce

Ale
11-16-2010, 04:47 PM
I thought you were talking about the may be upcoming in 10 years (or sooner) PropellerIII(tm) ! :(.

Baud rate ? 9600 ?... you set it. Make a diagram of the 3 propellers, if you connect them right the output of one to the input of the other one it should work well, and the GNDs of course too.

Have fun

Mike Green
11-16-2010, 04:57 PM
You should probably put a 2.2K resistor in each Prop to Prop lead. These are not needed if everything works right. They're intended to help your Props survive programming errors that might set the connected I/O pins both to output mode and in opposite states (high / low). This happens sometimes.

idbruce
11-16-2010, 07:11 PM
Thanks Mike and Ale

Mike -> My programming is always error free :) or at least I wish it was. Okay, so a 2.2K resistor on each Prop lead as an ounce of prevention. It shall be done. I am assuming that besides the addition of a few series resistors that you are in agreement with Ale and that it should work. Thanks for the good advice Mike.

Bruce

Mike Green
11-16-2010, 07:41 PM
You might also have a look at this (http://obex.parallax.com/objects/546/) high speed Prop-Prop driver.

idbruce
11-17-2010, 01:05 AM
Thanks again Mike. Yea I have been looking at that and Beau Schwabe's hi speed prop object. I just wish that I already understood this communication stuff a little better.

Cluso99
11-17-2010, 03:12 AM
For those distances I expect that 115,200 baud will run fine. I run 12" with stranded wire all the time (i.e. not in a cable).

Duane Degn
11-17-2010, 03:50 AM
If your Prop2 runs low on cogs, you might want to use Tim Moore's pcFullDuplexSerial4FC. It lets you have four communication lines using one cog. Here's an excerpt from his comments:



''* 1 port up to 750kbps *
''* 2 port up to 230kbps *
''* 3 port up to 140kbps *
''* 4 port up to 100kbps *


It's made my life a lot easier. Thanks Tim.

It's in the OBEX.

Duane Degn

idbruce
11-17-2010, 11:03 AM
Cluso99 - I believe I have seen that 115,200 baud rate in one of your other posts. I believe it was also mentioned to start out with a lower baud rate and work my way up until there is errors or loss of data. I was looking for a good starting baud rate to save time and then I will work my way up. So with your recommendation I will probably start at 57,600, then 115,200, etc... However, I am sure that you are right on the mark and that the magic number will be 115,200. Thanks.

Duane Degn - Thanks for the info. I haven't yet begun to get into the intricacies of programming the boards, but I believe I should have an ample amount of cogs. However, you are correct, if I run low on cogs, Prop2 will be the place. Thanks.