您现在的位置是:首页 > 正文

stm32f407时钟配置方法

2024-02-29 14:48:43阅读 1

这里我们写一个RCC配置函数来说明各函数的用途,其中HSE = 8MHz。

 

/**

  *  @说明  配置STM32F407的时钟系统

  * @参数  

  * @返回  

  * @说明  void Clock_Config(void) 按如下表格配置时钟

  *

*==================================================================

*        Supported STM32F4xx device revision    | Rev A

        *-----------------------------------------------------------------------------

*        System Clock source                             | PLL (HSE)

*-----------------------------------------------------------------------------

        *        SYSCLK(Hz)                              | 168000000

        *-----------------------------------------------------------------------------

*        HCLK(Hz)                                | 168000000

        *-----------------------------------------------------------------------------

*        AHB Prescaler                                       | 1

*-----------------------------------------------------------------------------

*        APB1 Prescaler                                  | 4

*-----------------------------------------------------------------------------

*        APB2 Prescaler                                | 2

*-----------------------------------------------------------------------------

*        HSE Frequency(Hz)                           | 8000000                                    

*-----------------------------------------------------------------------------

 *        PLL_M                                 |8

*-----------------------------------------------------------------------------

*        PLL_N                                   | 336

*-----------------------------------------------------------------------------

        *        PLL_P                                       | 2

*-----------------------------------------------------------------------------

*        PLL_Q                                  |7

网站文章