Connecting two Propellers for serial communications
simonl
Posts: 866
If connecting two Prop's for serial comm's (Prop1 P31 to Prop2 P30; Prop1 P30 to Prop2 P31); do I need to add resistors (to Vdd or Vss) on each connection? If so, what value would be appropriate?
The reason I ask is I seem to remember reading that, without resistors, there's a possibility of damaging the Propeller under certain conditions. I don't remember (and can't find) the exact reason, but I think it was something to do with protecting against both ends setting their pins high?
I want to get my facts right, before publishing (here) my guide to Propeller communications, so all help will be greatly received.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
The reason I ask is I seem to remember reading that, without resistors, there's a possibility of damaging the Propeller under certain conditions. I don't remember (and can't find) the exact reason, but I think it was something to do with protecting against both ends setting their pins high?
I want to get my facts right, before publishing (here) my guide to Propeller communications, so all help will be greatly received.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
Comments
So, if I connect (say) a 1K resistor on each of the lines to GND, would that be a good fail-safe?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
Propeller #1 Pin 30
1K resistor
Propeller #2 Pin 31
Propeller #1 Pin 31
1K resistor
Propeller #2 Pin 30
They limit the maximum current flowing between the two Propellers.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
Now I translate this as - a pin designated as pin1 is set to high and the other pin designated as pin2 was set to low. With pin1 set as output and pin2 set as input accordingly. This is as close to a short that we can get with no series resistor, but since the prop sinks 30ma and source 30ma then why bother with a resistor? I see it as a HIGH and a LOW. Am I wrong and if so please let me know?
In your own response you contradict your self (I think). You say "set one high and the other low you have a short from 3.3V to ground through the prop pins"
Don't you have to set the direction of the pins first or it wont work. e.g.
That would work but this wont will it.
I am at work so I cant test this situation.
I am only debating in an effort to learn more of this mighty chip that parallax has given to all of us. So no offense is intended to any of you fine people for my badgering questions.
And second, I have found this out a long time ago, you don't ever argue with Mr Green. He is very very experienced with the parallax stuff, and has never seemed to lead me down the wrong path...
I agree - the pragmatic solution is to just add the series resistors.
My only thought on this is that I'm guessing the resistors might affect the maximum speed of serial communications?
Thanks to all
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
All I am asking is why? Why put in a resistor if its not needed. I cant logically see how even a faulty program could mess this up. I understand that Mike Green is very wise; this is why I am asking more on this topic. Sure the quick solution is place a resistor in and not ask why hell place a diode, optically isolate it, or use a buffer. A point comes when I ask WHY?
I have always been a curious feller.
Resistors are normally the product of choice because they are cheep and handy. They normally do not affect speed and they provide extra cheep insurance. You don't know that when the chip is in the process of booting that the pin will always be low, and never end up high. You could accidently load the wrong program on it or mess up a line of code, at which point you would either need to redesign your circuit board, or need to replace the prop.
I normally like to take protective measures because you never know what will happen. You could even have one prop fail and dont want it to take the other one out. I even use 1k resistors on a lot of my inputs when I am breadboarding, just to project the prop while I am poking wires all around...
If I'm reading the explanation right, it goes as follows:
This is an example of a silly coding mistake.
I think I've got that right.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
That is possibly an error in code, but since you set both bins as outputs (dira[noparse][[/noparse] pinTX ] , dira[noparse][[/noparse] pinRx ]) then I was assuming that high input impedance - no harm could accrue. This supports my belief that a resistor is not needed. On the other hand if you just ran this code
Without setting the pins to outputs first then my assumption was that the compiler would catch it. Or maybe it would not, perhaps the propeller would not work even if the compiler did not catch it.
This was my thinking that programming errors were not possiable in this situation. At least, no possiable way to cause the prop to kill itself. So why use a resistor?
Post Edited (Zap-o) : 5/1/2009 7:40:58 PM GMT
2) The compiler does not catch anything about the use of the I/O pins. Programming errors are possible. The scenario I mentioned is where you have two separate Propellers possibly with different programs running on them and, on each, I/O pin 30 is connected to the other Propeller's I/O pin 31 and I/O pin 31 is connected to the other Propeller's I/O pin 30. As long as you define pinTx = 31 and pinRx = 30 in both programs (and use those definitions correctly), you'll be fine. If you somehow get confused when writing one of the programs and swap the definitions in only one program so pinTx = 30 and pinRx = 31, you're in trouble when you turn those Propellers on.
3) The issue is not whether the resistors are normally needed ... they're not, but would they be helpful in the case of certain programming errors? ... yes. Is this sort of programming error likely? ... that depends. Would the result be catastrophic? ... maybe. Do I put this sort of resistor on all my boards? ... no. Would I build it into a board where I plan to use all sorts of external circuitry from time to time? ... yes.
As for the 30ma its clearly stated here www.parallax.com/Portals/0/Downloads/docs/prod/prop/WebPM-v1.01.pdf page 15.
my 2cents
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· 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·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
The original question
"If connecting two Prop's for serial comm's (Prop1 P31 to Prop2 P30; Prop1 P30 to Prop2 P31); do I need to add resistors (to Vdd or Vss) on each connection? If so, what value would be appropriate?"
If I connected two props to eachother and one pin to output high, and on the other prop set the output to low, the props would both heat up until they smoked. I use 1k resistors on all inputs and outputs for standard logic. Higher speeds might require lower values to allow the square data wave to rise or fall in time.
Zap-o asks why,
and its because all chips have limits which don't actually DO the limiting of the current or even voltage. Say i have a 5v 30ma device, i can still put more than 5v into it, and can also pull more than 30ma from it, eventually frying it.(unless it has protection circuitry)
There is only 1 reason why anyone should be doing this.
If they absolutely must have minimal components, and have tested the program and design extensively.
This would be a production, EE level choice mostly only made to cut costs.
This is why our electronics fail today,
As our friends on the other side of the world say,
"COST DOWN"
even if it only adds 1$ to the cost per device, they look at it in hundreds of thousands of units that each add 1$ ,,, save 1$ on 100,000 units and you have an extra $100,000. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.