STM32F1xx -- GPIO eight working modes

1. STM32F1xx GPIO eight modes

        1. General input mode: (1) pull-up input, (2) pull-down input, (3) floating input.  

        2. Analog mode: (4) Analog input

        3. Output mode: (5) open-drain output, (6) push-pull output

        4. Multiplexing mode: (7) multiplexing push-pull, (8) multiplexing open drain

------------------------------------------------IO Basic Structure diagram ------------------------------------------------ -------------- 

------------------------------------------------end----------------------------------------------------------------------------

2. Explain in detail the working conditions of various modes:

---------------------------------------- 1. The IO structure diagram in the general input mode is as follows --- ----------------------------------------------

        1. General input:

                (1) The output driver is disabled.

                (2) The Schmitt trigger is turned on.

                (3) Weak pull-up and weak pull-down are disconnected or connected depending on the input configuration (pull-down, pull-up, floating).

                (4) The data present on the IO lead-in is adopted to the input data register every APB2 clock.

                (5) IO status can be obtained by reading and accessing the input data register. 

------------------------------------------------end----------------------------------------------------------------------------

----------------------------------------2. The IO structure diagram in the analog input mode is as follows --- ----------------------------------------------

        2. Analog input

                (1) The output driver is disabled

                (2) The Schmitt trigger is off, the output value of the Schmitt trigger is 0, and the input data register is always 0 when it is read

                (3) Weak pull-up and pull-down are disabled 

 ------------------------------------------------end---------------------------------------------------------------------------

-------------------------------------3. The IO structure diagram in the output mode is as follows---- -------------------------------------------------- -

 

         3. Output mode:

                (1) The output driver is activated and the Schmitt trigger is activated.

                (2) Open-drain mode: 0 on the output data register can turn on the N-MOS transistor to output a low level, and 1 on the output data register can disable the N-MOS and output a high-impedance state (open drain has nothing to do with P-MOS )

                (3) Push-pull output: When the output data register is 0, the N-MOS is turned on to output a low level; when it is 1, the P-MOS transistor is turned on to output a high level

                (4) Pull-up and pull-down are disabled

                (5) The input data register can be read to know the state of the IO pin

                (6) In the push-pull mode, the output data register can be read to obtain the last written data.

                (7) In each apb2 clock cycle, the data appearing on the io pin will be sampled into the input data register.

------------------------------------------------end---------------------------------------------------------------------------

----------------------------------------4. The IO structure diagram in the multiplexing mode is as follows--- -------------------------------------------------- --

 

         4. Multiplexing mode

                (1) Compared with the output mode, the output signal comes from the peripheral, not the io pin port. At this time, the corresponding peripheral must be enabled.

                (2) Others are the same as the output mode.

Guess you like

Origin blog.csdn.net/longjintao1/article/details/124247255