STM32L1學習筆記04 晶振設定

2021-07-25 19:06:05 字數 640 閱讀 8721

關於stm32的學習,初學者很容易被晶振這個東西給坑了。要在乙個新平台上開發,先要把晶振搞定。

檢視介紹sensornode例程的晶振是12mhz, sk和另乙個都是16mhz。下面例項講解下如何調整到16mhz,看下晶振如何設定。

\src\boards\sensornode\cmsis\stm32l1xx_hal_conf.h

#if !defined (hse_value)

//#define hse_value ((uint32_t)12000000) /*!< value of the external oscillator in hz */

#define hse_value ((uint32_t)16000000) /*!< value of the external oscillator in hz */

#endif

\src\boards\sensornode\board.c

rcc_oscinitstruct.pll.pllmul = rcc_pll_mul6; //rcc_pll_mul8
mdk project setting

option for target: xtal: 12mhz -> 16mhz

STM32cube學習筆記(1)

1 偶然的機會接觸到了stm32cubemx與stm32cubefx 詳細了解相關的資料之後感覺相當實用。2 程序建立 osthreaddef defaulttask,startdefaulttask,osprioritynormal,0,128 定義乙個結構體 defaulttaskhandle ...

stm32菜鳥學習筆記(1)

1.標頭檔案中,使用 ifndef define endif 可以避免標頭檔案內容重讀定義。2.mdk 編譯bug 要以回車結尾,不然會有warning。3.呼叫韌體庫必宣告的標頭檔案 include stm32f10x.h 識別符號為所定義的巨集名。字串 可以是常數 表示式 格式串等。例如 def...

STM32 NRF24L01學習筆記

首先nrf24l01是使用spi與stm32進行通訊的 其中要區分csn 模組的片選訊號,和ce 使能訊號的功能。csn是協議片選端,多個spi裝置共用stm32的spi口時,就通過csn來區分,而ce端實際上是晶元的功能使能端,通過配置ce使它進入不同的狀態 rx,tx 寫命令 1aaaaa 相當...