<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          STM32F107VCT6的RCC配置

          作者: 時(shí)間:2016-11-10 來源:網(wǎng)絡(luò) 收藏
          /****************************************************************/
          /* HSE=25MHz
          /* HCLK=72MHz
          /* PCLK2=72MHz
          /* PCLK1=36MHz
          /****************************************************************/

          void RCC_Configuration(void)
          {
          ErrorStatus HSEStartUpStatus;

          /* RCC system reset(for debug purpose) */
          RCC_DeInit();

          /* Enable HSE */
          RCC_HSEConfig(RCC_HSE_ON);

          /* Wait till HSE is ready */
          HSEStartUpStatus = RCC_WaitForHSEStartUp();

          if (HSEStartUpStatus != ERROR)
          {
          /* Enable Prefetch Buffer */
          FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);

          /****************************************************************/
          /* HSE=25MHz, HCLK=72MHz, PCLK2=72MHz, PCLK1=36MHz */
          /****************************************************************/
          /* Flash 2 wait state */
          FLASH_SetLatency(FLASH_Latency_2);
          /* HCLK = SYSCLK */
          RCC_HCLKConfig(RCC_SYSCLK_Div1);
          /* PCLK2 = HCLK */
          RCC_PCLK2Config(RCC_HCLK_Div1);
          /* PCLK1 = HCLK/2 */
          RCC_PCLK1Config(RCC_HCLK_Div2);
          /* ADCCLK = PCLK2/4 */
          RCC_ADCCLKConfig(RCC_PCLK2_Div6);

          /* Configure PLLs *********************************************************/
          /* PPL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
          RCC_PREDIV2Config(RCC_PREDIV2_Div5);
          RCC_PLL2Config(RCC_PLL2Mul_8);

          /* Enable PLL2 */
          RCC_PLL2Cmd(ENABLE);

          /* Wait till PLL2 is ready */
          while (RCC_GetFlagStatus(RCC_FLAG_PLL2RDY) == RESET)
          {}

          /* PPL1 configuration: PLLCLK = (PLL2 / 5) * 9 = 72 MHz */
          RCC_PREDIV1Config(RCC_PREDIV1_Source_PLL2, RCC_PREDIV1_Div5);
          RCC_PLLConfig(RCC_PLLSource_PREDIV1, RCC_PLLMul_9);

          /* Enable PLL */
          RCC_PLLCmd(ENABLE);

          /* Wait till PLL is ready */
          while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
          {}

          /* Select PLL as system clock source */
          RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);

          /* Wait till PLL is used as system clock source */
          while (RCC_GetSYSCLKSource() != 0x08)
          {}
          }
          }

          本文引用地址:http://www.ex-cimer.com/article/201611/317518.htm



          關(guān)鍵詞: STM32F107VCT6RCC配

          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();