When using the STM32F4 firmware library, the default crystal oscillator is a 25Mhz crystal oscillator, so some modifications need to be made. Because I had not paid attention to this problem before, I fiddled with it for a long time and found that the working clock was always wrong. After checking the information, I realized that there were several places that needed to be modified.
Original link: Modify the crystal value in the STM32 library function
The default crystal value in the STM32F407 library file is 25MHz. If the external crystal oscillator is 8MHz, the following places need to be modified:
1) Modify the value of HSE_VALUE
Will #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
Modify to #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
2) Modify the value of PLL_M
Change #define PLL_M 25 to #define PLL_M 8
3) Modify the Options settings of the STM32F407 project
In the Option for target "Flash" window, select the Target page and change the value of Xtal (MHz) in the STMicroelectronics STM32F407VG column to 8.0
Previous article:USB to serial communication in stm32f4USART
Next article:Hardware I2C of STM32F407
Recommended ReadingLatest update time:2024-11-16 19:32
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Analog Basics: How Sample and Hold Circuits Work and Ensure ADC Accuracy
- The role of the volatile keyword
- Apple's contract factory violated the rules by using student workers, Apple responded by suspending its new business cooperation
- AD sampling average current
- Assembling a single-phase solid-state relay circuit using discrete components
- Motor Control Advanced 3——PID Cascade Control (with full code download)
- [Evaluation of domestic FPGA Gaoyun GW1N-4 series development board] ——9. Internal OSC and rPLL IP core test
- Zero-Drift Amplifiers: Features and Benefits
- Interference issues
- Help, the SD card cannot communicate normally, and the measured pin voltage is abnormal