STM32 study notes (two)

STM32F103ZET6 GPIO working principle



Preface

The learning of STM32 can be divided into 3 versions.
1. Register version
2. Library function version
3. HAL library version
Due to personal reasons, I choose the library function version to learn STM32.


Tip: Problems such as software installation will not be explained! ! !

One, chip introduction

The STM31F103ZET6 chip has 144 pins, of which there are 7 groups of I0 ports, one group of IO ports has 16 IOs, and a total of 16×7=112 IOs.
Insert picture description here

2. GPIO input and output mode

Insert picture description here

3. Basic structure

Insert picture description here
Insert picture description here

Four, register principle

1. Port configuration low register (GPIOx_CRL)

Insert picture description here

2. Port configuration high register (GPIOx_CRH)

Insert picture description here

3. Port input data register (GPIOx_IDR)

Insert picture description here

4. Port output data register (GPIOx_ODR)

Insert picture description here

5. Port bit setting/clearing register (GPIOx_BSRR)

Insert picture description here

6. Port bit clear register (GPIOx_BRR)

Insert picture description here

7. Port configuration lock register (GPIOx_LCKR)

Insert picture description here


to sum up

It has been changed, forgive me! ! !

Guess you like

Origin blog.csdn.net/weixin_44935259/article/details/112401253