Detailed explanation of the hardware composition of the STM32 minimum system

Publisher:码字奇思Latest update time:2019-01-16 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Detailed explanation of the hardware composition of the STM32 minimum system


0 composition: power reset clock debug interface start


1. Power supply: generally 3.3V LDO power supply plus multiple 0.01uf decoupling capacitors  


2. Reset: There are three reset methods: power-on reset, manual reset, and program automatic reset


Usually low level reset: (51 MCU high level reset, capacitor and resistor positions swapped)


Power-on reset, at the moment of power-on, the capacitor is charged, and RESET appears a short low level. The duration of the low level is determined by the resistance and capacitance. The calculation method is as follows: t = 1.1RC (fixed calculation formula) 1.1*10K*0.0.1uF=1.1S


The required reset signal duration is about 1ms.


Manual reset: When the button is pressed, RESET and ground are connected, thus generating a low level to achieve reset.



3. Clock: crystal oscillator + starting capacitor + (feedback resistor MΩ level)   


If using the internal clock:


For 100-pin or 144-pin products, OSC_IN should be grounded and OSC_OUT should be left floating.


2) For products with less than 100 pins, there are two connection methods:


i) OSC_IN and OSC_OUT are grounded through 10K resistors respectively. This method can improve EMC performance.


32.768KHZ:


You can choose to connect only a high-speed external clock of 8MHZ or an additional external low-speed clock of 32.768MHZ.


32.768KHZ clock function: used for accurate timing circuit, perpetual calendar


Usually a 32.768KHz crystal is chosen because 32768=2^15, and the frequency division setting register of the embedded chip is usually in the form of a power of 2, so after 15 times of frequency division, it is easy to get a frequency of 1HZ. Achieve precise timing. Used for precise timing circuits and perpetual calendars 


Crystal oscillator: 8MHZ is generally selected for easy frequency doubling     


Active: More stable, more expensive, requires power supply, no peripheral circuit required, 3-pin single-line output  


Passive: basically accurate enough Convenient, flexible and cheap The biggest difference: whether it needs a separate power supply Passive crystal oscillators require external starting capacitors: There are two capacitors on both sides of the crystal oscillator



Active crystal oscillator


effect:


1. Make the equivalent capacitance at both ends of the crystal oscillator equal to or close to the load capacitance;


2. It plays a certain filtering role and removes high-frequency noise in the crystal oscillator waveform;


The size of the starting capacitor is generally selected to be 10~40pF. Of course, you can check the specific details in the user manual of different microcontrollers. If there is no specification in the manual, generally 20pF or 30pF can be selected. This is an empirical value.


Adjusting the capacitor can fine-tune the oscillation frequency:


Generally speaking, increasing the capacitance will reduce the oscillation frequency, while reducing the capacitance will increase the oscillation frequency.


Feedback resistor: 1M Negative feedback and current limiting


1. Inside the chip connected to the crystal oscillator is a linear operational amplifier, which reverses the input by 180 degrees and outputs it. The network composed of load capacitors and resistors at the crystal oscillator provides another 180 degrees of phase shift. The phase shift of the entire loop is 360 degrees, which meets the phase condition of oscillation.


2. The resistor connected to the crystal input and output is used to generate negative feedback to ensure that the amplifier operates in the high-gain linear region, generally in the M-ohm level;


3. The function of current limiting is to prevent the inverter output from overdriving the crystal oscillator and damaging the crystal oscillator. Some crystal oscillators do not need this resistor because the resistor has been integrated into the crystal oscillator.             



4. Startup: Users usually set Boot0 and Boot1 to 0, that is, low level.  


The M3 core has 3 boot modes, and the M4 has 4. The selection is made by the BOOT0 and BOOT1 levels.



       The storage media corresponding to the three startup modes of STM32 are all built-in to the chip, they are:


1) User Flash = Flash built into the chip.


2) SRAM = the RAM area built into the chip, which is the memory.


3) System memory = a specific area inside the chip. When the chip leaves the factory, a Bootloader is preset in this area, which is usually called the ISP program. The content of this area cannot be modified or erased after the chip leaves the factory, that is, it is a ROM area, which uses USART1 as the communication port.


       Based on the above, M4 also adds the ability to start from the BANK1 area of ​​FSMC.



5. Debug interface: STM32 has two debug interfaces, JTAG is 5-pin, SWD is 2-wire serial (a total of four wires)



In addition, USB is used for program burning and data output: connecting to the computer USB port can also provide power for small load driving.


Usually the CH340G chip is used to realize USB to serial port conversion.


Requires a separate oscillator circuit 12MHZ 


Use this chip to map the computer's USB to a serial port. Note that the serial port driver should be installed on the computer, otherwise it cannot be recognized normally.



When burning the program, we hope that BOOT0 = 1, BOOT1 = 0. After burning is completed, we hope that BOOT0 = 0, BOOT1 = 0 (in this mode, BOOT1 can be 0 or 1. Here we pull BOOT1 low, that is, BOOT1 is grounded to L during the whole process to simplify the circuit design).


Keywords:STM32 Reference address:Detailed explanation of the hardware composition of the STM32 minimum system

Previous article:LPC824 using FlashMagic to download programs
Next article:Three methods of programming LPC2378

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号