-Original content, please do not reprint.
people need to rely on a certain amount of energy to live, such as water and food, so what is the energy of a microcontroller? If people want food, they need to set up a food supply system, such as breeding, processing, selling, and cooking. In the end, food can be delivered to people's mouths. For microcontrollers, it is also necessary to build a system to provide it with energy to keep it running. This is called a minimum system.
Achitecture of the minimum MCU system
Today we take "STM32F103" of "ST" as an example. the minimum system of MCU consists of the following parts:
1: Power supply
• Microcontroller power supply voltage ranges are 3.3volts, 5volts......The power supply voltage of STM32 is 5volts, and the voltage can be reduced if necessary.
• The power supply locations of different modules of the microcontroller are different. For example, STM32F103C8T6 has 5 positive power supply pins and 4 ground pins. The responsible power supply modules are these:The supply voltage for these pins is also in the manual.
2: Reset circuit
• If you eat too much and don't sleep well you will have physical problems. The microcontroller will have some abnormal situations from time to time, so at this time, reset circuit is needed to help.
• It can quickly reset the microcontroller and return it to the initial state to ensure the system's stability. Stability and reliability, its working logic is to give the microcontroller reset pin (NRST) a short low level when the board is powered on,
• allowing the microcontroller program to reset and restore the state of all registers except the backup area register to the original state. Frankly speaking, it is to let the microcontroller start again from scratch.
3: System clock
• You must have a sense of time to keep your lives in order, and the same is true for microcontrollers. The clock of the microcontroller is the rhythm required for the work of the microcontroller.
• STM32 has integrated an internal clock, so in general applications, there is no need for an external crystal oscillator circuit. However, since the internal clock is susceptible to interference from various factors, in strictly demanding situations, an external crystal oscillator circuit can still be connected when needed. The system clock usually adds an external crystal oscillator circuit. According to the STM32 data sheet, the high-speed external clock (HSE) can be connected to a 4MHz~16MHz crystal oscillator. Low-speed external clock (LSE), connected to a crystal oscillator with a frequency of 32.768KHz.
4:programming
• Anyone needs a goal to know what to do, and the microcontroller also needs to be injected with a program so that it can understand its own mission.
• STM32 is often programmed in SWD mode because it is more reliable than JTAG in high-speed mode. In the case of large data volume, the JTAG download program will fail, but the probability of SWD occurring will be much smaller. Generally, only 5 wires are needed, and some use 4 wires.