1 Minimum system schematic diagram
The minimum system mainly consists of five major parts: power supply, clock, debugging, reset, and control chip.
2 Power system
The LDO (Low Dropout Regulator) low dropout linear voltage regulator converts 5V into 3.3V to power the main control chip.
Regarding level conversion, you can view Understanding Digital Circuits from a Level Perspective
3 clock circuit
The crystal oscillator is composed of a quartz crystal. The reason why the quartz crystal can be used as an oscillator is based on its piezoelectric effect: adding an electric field to the two poles of the wafer will cause mechanical deformation of the crystal; adding an electric field to the quartz wafer will When the alternating voltage is applied, the crystal will produce mechanical vibration. At the same time, the mechanical deformation vibration will produce an alternating electric field. Although the voltage of this alternating electric field is extremely weak, its vibration frequency is very stable. When the frequency of the applied alternating voltage is equal to the natural frequency of the wafer (determined by the size and shape of the wafer), the amplitude of the mechanical vibration will increase sharply. This phenomenon is called "piezoelectric resonance".
The crystal oscillator circuit provides the system clock for the main control chip. All peripheral operations and CPU operations must be based on this clock, which is similar to the "heartbeat" of the entire system.
Crystal oscillators are divided into passive and active, but they are essentially Pierce oscillator circuits (inverting amplifier + resistor + capacitor + crystal + power supply). However, for a single-chip microcomputer, the inverting amplifier, resistor, and power supply are integrated inside the microcontroller. Just connect an external crystal and capacitor. The crystal here is called a passive crystal oscillator.
The active crystal oscillator is made of the Pierce oscillator as a whole, and it can work directly with the power supply. Of course, the price will be more expensive than the passive one.
4 reset circuit
The main control chip is a low-level reset (pin NRST), and the hardware button reset is one of the system resets (there are also software resets, watchdog count termination resets, etc.). The purpose of the capacitor C2 is to debounce the button to prevent malfunction caused by level jitter when the button is just contacted/released (the contact process of button closing/releasing has about 10ms of jitter, which is very important for the main control chip I/O In terms of control, it is already a long time, enough to perform multiple reset actions. Since the capacitor voltage will not change suddenly, capacitor filtering is used to prevent jitter reset malfunction).
5 debugging interface
During the program development process, you need to download the bin/hex file and conduct online simulation and debugging, which can be done in SWD or JTAG. SWD mode is more reliable than JTAG in high-speed mode, and only requires 4 pins. SWD mode is generally used in actual development. The clock line CLK is used for clock synchronization between Jlink and the chip. The general frequency is set to 4MHz, and the frequency can be adjusted according to the actual situation.
6 Main control chip STM32F103C8T6
Understanding the chip characteristics in the picture above is a basic understanding of main control chips such as STM32. Including core frequency, memory, flash memory, working mode, A/D data conversion, DMA, timer, and communication protocol. There is still a lot of knowledge in this part, and it needs to be grasped as a whole first, and then divided and conquered.
for example :
00001. The main frequency is related to the speed at which the CPU executes code. The higher the main frequency, the faster the CPU executes and the higher the cost of the chip;
00002. The size of memory SRAM is related to the needs of code running. For example, global variables, local variables and other data are related to SRAM. The logical partitions in C language: heap/stack/global variable area. From a physical perspective: all Belongs to SRAM;
00003. Flash memory is the physical area where codes are stored. The bin/hex file is placed in flash, which is equivalent to the hard disk of a computer;
00004. DMA (Direct Memory Access) direct storage access is used to transfer large amounts of data between peripherals and memory, and between memory and memory. Its function is to reduce the burden on the CPU, increase the cost and complexity of the hardware, and achieve overall improvement. An efficient transmission scheme;
00005. There are many communication protocols, such as UART, SPI, IIC, CAN, USB, etc., which are mainly used to communicate with external devices. Different communication methods have different protocols. This needs to be further studied in combination with the driver of the external chip.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet