The pin goes into a high-impedance state

Hi all! I found on one of the forums that when switching a pin from output to input, the pin goes into a high-impedance state, with a resistance of the order of several tens of MΩ. Tell me how it happens? I am using an ATmega 328 chip.

Hello roman_arduino

Didn´t you read the data sheet, did you?

1 Like

Read. I can not find this place, where it is indicated how the situation described by me is carried out.

Several thousands of MΩ.

1 Like

Hi,
The atmega328 port pins are tristated.
1 HIGH or ,(OUTPUT mode).
2 LOW or ,(OUTPUT mode).
3 Floating (High impedance). (INPUT mode).

If you use INPUT_PULLUP, the impedance go down.

If a pin is in high impedance state, it can be pulled to high or low by an external device without much current flow.

When it's an input, it's "tristated," allowing the external chip to control its logic level.

See: Three-state logic - Wikipedia

1 Like

The output stage (in layman's terms) consists of two transistors, one from Vcc to pin (call it T1) and one from pin to GND (call it T2).

If T1 is open and T2 is closed, the output is Vcc (HIGH).
If T2 is open and T1 is closed, the output is GND (LOW).

If both are closed, the output is in tri-state.

That is, as I understand it, there is not much difference: there will be a switch from output to input or from input to output. All the same, the pin will go into a high-impedance state.

Electronics is so confusing -- does 'closed' mean closed like a knife switch, a closed loop, or a closed door or valve? Or is that 'open' like an open circuit or open door? And electricity/electrons flows backwards through from negative to positive.

1 Like

Our current world is all electronics. :earth_africa: :earth_americas: :earth_asia: :globe_with_meridians: :rofl: :rofl: :rofl:

In this case, the door.

Conducting / non-conducting would have been a better choice of words :wink:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.