STM32-GPIO block diagram Analysis

5d3052228414a68787

GPIO block diagram analysis

The basic structural analysis

① protection diodes and the pull-down resistor

When the pin voltage is higher than VDD_FT, on top of the diode conduction, when the pin voltage is lower than the VSS, the diode is turned downward, the introduction of the chip to prevent abnormal voltage lead chip burned.
By the pull-down configuration corresponding switch, we can control the state of the default voltage pin

②P-MOS and N-MOS pipe tube

Push-pull output:
push-pull mode, based on the working mode of the two MOS transistors named.
It high in this configuration, the top of the P-MOS is turned off the bottom of the N-MOS, the external output high; and when low level is input in this configuration, the tube is turned N-MOS, P-MOS closed, the external output low. When the pin is high and low switch alternately conducting two tubes, one for current sink, responsible for pulling a current, switching speed and its load capacity than the ordinary way greatly improved. Push-pull output low level is 0 volts, 3.3 volts for the high level.
Open drain output mode:
P-MOS tube is completely above the work, if we control output is 0, the low level, the P-MOS pipe closed, N-MOS turns on, the output to ground, when the control output is 1 ( it can not directly output a high level), the P-MOS and N-MOS pipe tubes are closed, the output pin is neither high nor low output, high impedance state. Must be used when the normal pull-up resistor, if many open drain mode pin connected together only when all pins are high impedance state to a high-level only by the pull-up resistor, this high level of voltage pull-up resistor externally connected to the voltage supply. If one pin is low, it is equivalent to short-circuit ground line, so that the entire line are low, 0 volts.
Push-pull mode generally used in an output level of 0 and 3.3 volts and require high-speed switching state of the switch case. STM32 application, in addition to the occasion must be open-drain mode, we are accustomed to using a push-pull output mode. Open drain output is generally used in I2C, SMBUS communications bus circuit requires "line" function, is also used in the case of mismatch level needs to be output as a high level of 5 volts, can be a pull on the outside resistor, the pull-up power supply is 5 volts, and the open-drain GPIO set, when the output high impedance state, on the pull-out and power output level 5 volts.

③ output data register

④ Alternate function Output

Peripheral control GPIO pins on the other plate,

⑤ Input Data Register

After the trigger signal, the analog signal into a digital signal of 0, 1, and the "input data register GPIOx_IDR" by reading this register can know the state of GPIO pin level storage.

⑥ multi-function I

Analog input and output ⑦

When the ADC input channel voltage acquisition, as "analog input" function

Operating mode

Input mode (pull-up, pull-down, floating)
output mode (open drain pull, the pull-down)
multiplexing function (open drain pull, the pull-down)
analog input and output

5d3052342254b57093

Guess you like

Origin www.cnblogs.com/luoxiao23/p/11209382.html