When the I/O pin has no connect, which one is better for port output mode as following:
1. Quasi-Bidirectional
2. Push-Pull
3. Input Only (High Impedance)
4. Open Drain
I have read from "P89LPC9221 User's Manual" as following:
Quasi-bidirectional output mode,
'One of these pull-ups, called the 'very weak' pull-up, is turned on whenever the port latch for the pin contains a logic 1. This very weak pull-up sources a very small current that will pull the pin high if it is left floating'.
So if the I/O pin is no connect, is it better to choose 'quasi-bidirectional'?
I think I understand your question. You want to properly terminate unused pins?
If you have space to do so, the safest option is to connect them to one of the power rails through a high value resistor with the pin defined as an input. This way if code gets lost and redefines the pin function the load is minimal.
Leaving the pin unconnected and using an internal "weak pull-up" is almost as good, and uses less resource. The liability is that if code gets lost the WPU may get deactivated.
The last option that I've heard recommended is to leave the pin unconnected and define it as an output.
The greatest sin is to leave unused pins floating as inputs. This allows them to wander into ambiguous territory and the input amplifiers will consume excessive current.
As above poster said Bidirectional and Input are not good option to go with.
Try to avoid leaving unconnected.
But if you want to leave it that way Leave it as Output.
Re: if the I/O pin is NC, is it better to choose 'bidirectio
Here is the reason:
Quasi-bidirectional output type can be used as both an input and output without the need to reconfigure the port. This is possible because when the port outputs a logic HIGH, it is weakly driven, allowing an external device to pull the pin LOW. When the pin is driven LOW, it is driven strongly and able to sink a fairly large current.
As you can see, pins configured that way have internal pull-ups active and can be "shorten" to either 0V od +Vdd without damage, and one other thing: don't forget to write a "1" into them ..
Re: if the I/O pin is NC, is it better to choose 'bidirectio
Dear IanP,
'One of these pull-ups, called the 'very weak' pull-up, is turned on whenever the port latch for the pin contains a logic 1. This very weak pull-up sources a very small current that will pull the pin high if it is left floating'.
Re: if the I/O pin is NC, is it better to choose 'bidirectio
In this context "left floating" may only man "NOT CONNECTED TO ANYTHING" ..
However, this internal weak pullup is strong enough to firmly hold the logic level "H" and in the same time does not consume much current ..
And that's all what you are after ..
Re: if the I/O pin is NC, is it better to choose 'bidirectio
Dear IanP,
I have asking to NXP and the answer is:
NXP Semiconductors answer:
Greetings,
There is no hard and fast rule on this but in most cases it is better to leave them as inputs. The inputs are Schmidt triggered and have weak pull-ups so they should not float up & down drawing extra current.
-Dave
The second mail after I explain your answer: NXP Semiconductors answer:
That fine too. There is no single right answer. If you put them in input mode there is no chance of damaging the pin should it be accidentally shorted HIGH or LOW as well. In quasi mode if you accidentally write a low as a output and it is shorted HIGH externally you can damage the part. If it is set as an input and software accidentally writes to the port it will not potentially fight like in the previous example for quasi mode.
Whatever makes you most comfortable is the best answer in this case.
-Dave