Stm32 microcontroller entry c language analysis

Recommended learning books on learning stm32 microcontroller :

The STM32F103xxx Reference Manual does not need to be fully read - there is no time. It is recommended to read, but the first few chapters must be read. Memory and bus architecture, power control, backup registers, reset and clock control, general and alternate function I/O, interrupts and time, etc. The first few chapters must take time to read. The following chapters describe the specific functional module design. If we use which module, we can read which module.

The STM32 Firmware Library User Manual is mainly to simplify programming.

Learning ideas (for reference only)

Step one, install the STM32 learning software, such as J-Link, Keil for ARM (MDK), ISP (if you need to download from the serial port).

Step 2: Select the HEX of some routines, such as the HEX file of the LED light, and download it to the core STM32 development board to observe the blinking of the two LED lights.

Step 3, prepare several commonly used documents, such as the "STM32 User Manual", "STM32 Firmware Library User Manual" and other documents for normal reference.

Step 4, start to look at the preparation of the routine, see how the routine is written, can you modify the routine to achieve the desired effect? The core of the STM32 development board is available for everyone.

A wealth of routine code can be referenced. You can definitely modify the more exciting routines!

Step 5, Ucos-II transplantation, do you need to try it?

Congratulations, you have been able to develop independently. The last step is to give yourself a goal (project) and implement it!

Stm32 microcontroller entry c language analysis

For the subsequent programming of each module, please refer to the introduction manual of any one of Shenzhou I (103RBT), Shenzhou II (103vct), Shenzhou III (103zet), Shenzhou IV (103vct), official website armjishu.com There are downloads on it, you can refer to the reference.

Step 1: Familiar with debugging software

For beginners, we need to install at least two software: J-Link driver software, MDK (the original Keil) software. These two softwares can be checked during the process of installing the software.

Look at the Shenzhou Development Board User Manual, which is not repeated here. You can refer to our tutorial "How to Install J-Link Driver Software" and "How to Install MDK (Keil) Software". how is it

Verify that you are already familiar with the operation of the debugging software? Very simple, the Shenzhou STM32 development board CD comes with a lot of HEX format files, you can choose some HEX files to observe the running knot

fruit. For example, the HEX file of the LED light is downloaded to the Shenzhou STM32 development board to observe the blinking of the two LED lights. The light is flashing, it means that your operation has already programmed the HEX file.

Into the flash memory.

The goal to be achieved in this step: familiar with the debugging software, such as burning HEX problems, you can easily identify the problem and solve it independently.

Step 2: GPIO Programming

This is the first time you have access to the programming of the firmware library. Be sure to slap the bulletin to understand the firmware library. I suggest you try to use the firmware library. Instead of avoiding the firmware library to write your own code —

- This can only happen during study. In the actual project, the code is hundreds of thousands, how to write one by one? Calling the function in the firmware library to complete is the king's way.

Stm32 microcontroller entry c language analysis

The programming of GPIO itself is actually very simple:

1. Set the pin of the GPIO port to input or output mode. When we are lighting the code, we usually set it to push-pull output mode.

2, the operation of the register, set to 1 or clear the operation - this step, the firmware library has provided a special GPIO_SetBits function and GPIO_ResetBits function, we just go

The IO port can be set and cleared by a call.

3, to achieve a variety of patterns of LED flashing, making yourself familiar with the GPIO programming process.

The goal to be achieved in this step: familiar with the debugging software, such as burning HEX problems, you can easily identify the problem and solve it independently.

Step 3: Start a new STM32 in-depth study

After the familiarity of the above debugging software and the programming and debugging of the GPIO port, I believe that you have a certain understanding of STM32. At least know how to use the STM32 firmware library to write a

Code. OK, below we will start a new STM32 in-depth study. At this stage, you will be exposed to serial programming, TFT LCD driver programming, timer programming, serial peripheral interfaces.

SPI programming, memory programming, SD card and file system porting, USB read and write, UCOS porting, etc., have the energy to study other peripherals.

Silicone Rubber Keypad

Silicone Rubber Keypad,Rubber Keypad ,Silicone Keymats,Rubber Key Pad

CIXI MEMBRANE SWITCH FACTORY , https://www.cnjunma.com