Currently my i'm using a few I/O ports of my MCU as outputs. Due to new requirements, these outputs should be able to be configured as high-impedance state. However, these ports are not supported for high-impedance by my MCU.
So, is it possible to achieve this high-impedance state by configuring the port as input ports?
If these pins are of open drain type - setting them to a 1 will put them into high-impedance state - floating ..
Other pins will have week internal pullups and the impedance may depend on the purpose of these pins (see examples below) .. if you can live with some µA drawn by a pin then you can use this option..
You will have to check that with the MCUs data sheet ..
attached is the waveform when i keep on switching the pin from output to input and vice versa:
- when as output, 1 is set for the output level.
- when i switch to input, there is a transition slope.
my question is: why is there such a slope?
is there the same slope when switching from output state to high-impedance state (real high-impedance state, not input).
According to this figure, the IO seems to have a internal pull down.Becuase the capability of internal pull down is weak, the transition is slow.
Generally the state change from 1 or 0 to high Z is quick, but it is depend on the IO circuit structure too.
There is a resistive pulldown (scope probes can provide this resistance). In high-impedance state, the two output transistors are nonconducting, and the output acts like a capacitor. The "slope" is a typical RC charge/discharge curve.