STM32L1 Study Notes 04 Crystal Oscillator Settings

Publisher:科技先锋Latest update time:2018-09-10 Source: eefocusKeywords:STM32L1 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Preface


When learning STM32, beginners are easily fooled by the crystal oscillator. To develop on a new platform, you must first get the crystal oscillator right.



for example


The crystal oscillator in the SensorNode example is 12MHz, while SK and the other one are both 16MHz. The following example explains how to adjust it to 16MHz and how to set the crystal oscillator.


\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

1

2

MDK Project setting


Option for Target: Xtal: 12MHz -> 16MHz


End


Keywords:STM32L1 Reference address:STM32L1 Study Notes 04 Crystal Oscillator Settings

Previous article:How to download the firmware library of stm32 series microcontroller
Next article:STM32F4 uses hardware SPI to drive ADS8322

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号