What is Hi-Z input?
Kenneth Kramer
Posts: 11
I know of outputs being in Hi-Z (high impedance mode) but I am not familiar with the term "Hi-Z" input.
Is this a feature related to the internal structure of the SX chip and as such not to the physical behaviour of the port when configured as input?
Would someone care to explain?
Thanks,
Kenneth
Is this a feature related to the internal structure of the SX chip and as such not to the physical behaviour of the port when configured as input?
Would someone care to explain?
Thanks,
Kenneth
Comments
When you put an SX i/O bit to input mode, you are creating a "Hi-Z input", although I don't know if that's an official term. Normally, Hi-Z outputs are used so you can physically connect multiple chip outputs to together (such as in a data bus) without having multiple outputs driving the line and doing nasty things like shorting each other to ground. Well, if you wanted to connect a bunch of SX chip outputs in a bus, you could have them all set to input (even though you wanted outputs) and let the one chip that is driving the line be set to output. This way, all the chips are connected, but only one of them is actively driving the line. The rest, being in input mode, will safely "listen". Hence, you can simulate a Hi-Z output by putting a bit in input mode.
Thanks, PeterM
Say I've 3 SX chips with all B-ports connected together. If chip 1 is driven as output and chip 2 and 3 are driven as Hi-Z inputs, then those 2 chips will listen to what the line driving chip outputs?
As long as only one of these chips are driving the line, then the 2 other chips will safely listen to what the line driving chip has to say.
I think I got picture now.
Please consider the following and tell me·if you agree/disagree:
Thanks,
Kenneth
Yes, you understand exactly. I also agree with your truth table except for the line that says:
Hi-Z Hi-Z 3-state No
That's actually perfectly legal. It just means that no one is driving the line(s) at that moment.
BTW, the key to all of this is to make sure that your code always switches between input and output correctly. This sort of code has to be debugged carefully since you might have a situation where a bug in the software causes more than one SX to try and drive the line simultaneously.
Thanks, PeterM
If there is a pull up resistor somewhere in there, no problem. Using the internal pullups on the pin is probably just fine as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
James Newton, Host of SXList.com
james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
SX FAQ / Code / Tutorials / Documentation:
http://www.sxlist.com Pick faster!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Kenneth
It should be:
...along with the caveat's that Jim and Gunter mentioned about protecting the chips.
Thanks, PeterM
Your help has been invaluable all along. I really appreciate it.
Sincerely,
Kenneth
Do you mind showing how you calculate the current limiting resistor?
Thanks,
Kenneth
I have assumed worst case, i.e. one output high (5V) and the other output low (0V). To limit the curren to 20 mA, R = 5V/20mA = 250 Ohm, or for a 220 Ohm resistor, the current would be I = 5V/220Ohm = 22.7 mA.
When you connect two (potential) outputs together, each of the resistors may be half that value, say 120 Ohm each.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
You really disappoint me.
I think your comment is a bit patronizing and it certainly doesn't help for the sake of clearity and the knowledge needed to handle these sensitive devices in a safe way.
I don't know your background but if you're a hardware engineer you probably know more·about the SX chip than most of the members of this forum do.
I wish you would share your experience with the SX processor in a way that we all can benefit from.
Remember this forum exist because all the mebers of this forum has an keen interest in the SX processor and the vast possibities that this brilliant chip can offer once you get to know you its true potentials.
Based on that you may feel like elaborating on what you didn't finish in the first place.
With all respect,
Kenneth
Now with all the negative stuff out of the way, here is what you need to do to accomplish what you are seeking. You need an open-collector setup, this is a system where the line is not actively driven to a high state, it's two states are tri-state output and pull-down. In order to use an SX in this mode, you switch between input and output where the bit is 0 (don't ever drive it 1), so your communication on the line is by switching back and forth between output and input where the output is always a 0. The 244 must also never drive the line high, this setup requires an external pullup resistor on each line to work. Now the SX is a bit peculiar when switching modes and switching from one mode to another requires an intervening operation depending on the value of the output register and the mode register, I don't remember which transistions require this, but read the SX-User's manual very carefully to make sure you adhere to this requirement.
The open collector situation still needs some pretty fancy collision detection software, but it is possible to do, this is what is done in the CDMA protocol.
I'll be happy to further explain anything·you have questions about.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 10/12/2005 4:26:07 PM GMT
I think that in general you are completely correct in using a resistor (or current source) pull-up mechanism for half-duplex party-line communications.
There are however some instances when this may not be adequate, such as very high speed communications; the pull-up is just too slow due to the capacitances on the line.
In those extreme cases then when multi-active operation is required, a good synchronizing techinique with deterministic bit rendering is invaluable, and very reliable.
BUT, it is not for the faint-of-heart; and great care is required.....that Murphy lurks everywhere. I recall a case where I was doing just such a system at 10 Megabits/Sec, and due to a slight timing error in my software, occasionally two opposing transmitters were simultaneously "on" for a few cycles, 40 to 60 nanoSeconds, and that caused a current pulse sufficient to drop my barely adequate power supply enough to reset the processors. Took me a week to track that sucker down...intermittent failures can be a bear to catch if their frequency is low.
Best approach is eliminate tricky things if you can, but don't be afraid of them if you are thorough and careful.
Cheers,
Peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 10/12/2005 5:11:12 PM GMT