1.首先打开startup_stm32f10x_hd.s文件,右击systemInit,进入函数;在SystemInit函数中,找到SetSysClock()函数,右击进入函数;在SetSysClock()函数中找到SetSysClockTo72(),把系统时钟设置为72MHZ,右击进入函数; 在函数中找到
/* PLL configuration: PLLCLK = HSE * 9 = 72 MHz // PLL configuration: PLLCLK = HSE * 9 = 72 MHz /
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE |
RCC_CFGR_PLLMULL));
RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL9),将最后的RCC_CFGR_PLLMULL9改为RCC_CFGR_PLLMULL6,126,刚好72MHZ;
2.在stm32f10x.h中找到
#if !defined HSE_VALUE
#ifdef STM32F10X_CL
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz /
#else
#define HSE_VALUE ((uint32_t)8000000) /!< Value of the External oscillator in Hz /
#endif / STM32F10X_CL /
#endif / HSE_VALUE */
#define HSE_STARTUP_TIMEOUT ((uint16_t)0x0500) /*!< Time out for HSE start up */
#define HSI_VALUE ((uint32_t)8000000) /!< Value of the Internal oscillator in Hz/,
把8000000,改为12000000;
3.将8.0改为12.0.
1.首先打开startup_stm32f10x_hd.s文件,右击systemInit,进入函数;在SystemInit函数中,找到SetSysClock()函数,右击进入函数;在SetSysClock()函数中找到SetSysClockTo72(),把系统时钟设置为72MHZ,右击进入函数; 在函数中找到
/* PLL configuration: PLLCLK = HSE * 9 = 72 MHz // PLL configuration: PLLCLK = HSE * 9 = 72 MHz /
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE |
RCC_CFGR_PLLMULL));
RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL9),将最后的RCC_CFGR_PLLMULL9改为RCC_CFGR_PLLMULL6,126,刚好72MHZ;
2.在stm32f10x.h中找到
#if !defined HSE_VALUE
#ifdef STM32F10X_CL
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz /
#else
#define HSE_VALUE ((uint32_t)8000000) /!< Value of the External oscillator in Hz /
#endif / STM32F10X_CL /
#endif / HSE_VALUE */
#define HSE_STARTUP_TIMEOUT ((uint16_t)0x0500) /*!< Time out for HSE start up */
#define HSI_VALUE ((uint32_t)8000000) /!< Value of the Internal oscillator in Hz/,
把8000000,改为12000000;
3.将8.0改为12.0.
举报