The difference and analysis of the eight input and output modes of STM32

The difference between pull-up input, pull-down input, push-pull output, open-drain output, multiplexed open-drain output, multiplexed push-pull output, floating input, and analog input

1. Pull-up input: Pull-up is to pull up the potential, such as to Vcc. Pull-up is to pull the uncertain signal on the IO port to a high level through a pull-up resistor! The resistor also acts as a current limiter! Weak and strong are only different in the resistance value of the pull-up resistor, and there is no strict distinction.

2. Pull-down input: pull the voltage down to GND. Similar to the pull-up principle.

3. Floating input: Floating (floating) means that the input pin of the logic device is neither connected to a high level nor a low level. Due to the internal structure of the logic device, when its input pin is floating, it is equivalent to the pin being connected to a high level. In general practical use, the pins are not recommended to be left floating, which is susceptible to interference. In layman's terms, it means that the pins are not connected to anything and are left floating.

4. Analog input: Analog input refers to the input in the traditional way. The digital input is the input PCM digital signal, that is, the binary digital signal of 0, 1, which is converted into an analog signal through digital-to-analog conversion, and then enters the power amplifier through the pre-amplification. The amplifier is still analog.

5. Push-pull output: It can output high and low levels and connect to digital devices; push-pull structure generally means that two transistors are controlled by two complementary signals respectively, and the other is always turned off when one transistor is turned on. The high and low levels are determined by the power supply of the IC.

6. Open-drain output: The output terminal is equivalent to the collector of the triode. To get a high-level state, a pull-up resistor is required. It is suitable for current-type driving, and its ability to absorb current is relatively strong (generally within 20ma).

7. Multiplexed open-drain output, multiplexed push-pull output: It can be understood as the configuration when the GPIO port is used as the second function (that is, not used as a general-purpose IO port).

The IO mode is selected in STM32. The following is a summary of the reference online.
(1) Floating input _IN_FLOATING - floating input, can be used for KEY identification, RX
(2) with pull-up input _IPU - IO internal pull-up resistor input
(3) with pull-down input _IPD - IO internal pull-down Resistor input
(4) Analog input _AIN ——Apply ADC analog input, or save power under low power consumption
(5) Open-drain output _OUT_OD ——IO output 0 is connected to GND, IO output 1, floating, requires an external pull-up resistor , in order to achieve output high level. When the output is 1, the state of the IO port is pulled high by the pull-up resistor, but because it is an open-drain output mode, the IO port can be changed to a low level or unchanged by an external circuit. It can read the IO input level change to realize the IO bidirectional function of C51.
(6) Push-pull output _OUT_PP ——IO output 0-connected to GND, IO output 1-connected to VCC, the read input value is
unknown SCL, SDA)

(8) Open-drain output of multiplexing function _AF_OD - on-chip peripheral functions (TX1, MOSI, MISO.SCK.SS)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325251604&siteId=291194637