STM32------GPIO

GPIO

1. Introduction

1. 1 What is GPIO?

Input and output ports

1. 2 GPIO features

1. The number of IOs in different packages is different.

2. Fast flip, each flip requires only two clock cycles at the fastest.

3. Each IO can be interrupted.

4. Supports 8 working modes.

1. 3 GPIO electrical characteristics

STM32 operating voltage range: 2~3.6V

GPIO identification voltage range: COMS (3.3V), TTL (data sheet marked FT compatible with 5V).

GPIO output current: single IO, maximum 25mA.

IO distribution characteristics: exist in groups, the number of groups depends on the chip, up to 16 IOs.

2. Basic structure of IO port

Notice:

1. Protection diode

2. Internal pull-up and pull-down resistors

3. Schmitt trigger

4. P-MOS & N-MOS functions

The Schmitt trigger is an integer circuit that can shape a non-standard square wave into a square wave.

Features:

1. When the input voltage is higher than the forward threshold voltage, the output is high.

2. When the input voltage is lower than the negative threshold voltage, the output is low.

3. When the input is between the positive and negative threshold voltages, the output does not change.

Function: shaping (such as converting sine wave to square wave).

P-MOS && N-MOS

MOS tubes are voltage-controlled components that are turned on or off by controlling the gate-source voltage (VGS).

G: Gate S: Source D: Drain

P: Vgs<0, conduction.

N: Vgs>0, conduction.

3. GPIO working modes (8 types)

1. Input float

Features: When idle, the IO status is uncertain and determined by the external environment.

2. Input pull-up

Features: When idle (high impedance state), IO is high level.

3. Input drop-down

Features: When idle, IO is low level.

4. Simulation function

Features: Specially used for analog signal input and output.

5. Open drain output

6. Open-drain multiplexing function

7. Push-pull output

8. Push-pull multiplexing function

Differences between F4/F7/H7 and F1 series:

1. When F1 is in output mode, internal pull-down is prohibited.

In output mode, F4/F7/H7 can use internal pull-down.

2. Different series of IO flip speeds are different.

STM32 cannot output 5V internally and can be connected to an external pull-up resistor.

Guess you like

Origin blog.csdn.net/weixin_58125062/article/details/130666066