你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

请问 stm32f103 外部晶体 何时工作?

[复制链接]
不思 提问时间:2016-5-14 17:41 /
没有下载程序的stm32f103最小系统上电,晶体上没测到波形,二脚都是低电平,是否正常?
谢谢!

收藏 评论5 发布时间:2016-5-14 17:41

举报

5个回答
不思 回答时间:2016-5-14 17:43:53
中文手册第57页:
HSE晶体可以通过设置时钟控制寄存器里RCC_CR中的HSEON位被启动和关闭。
五哥1 回答时间:2018-5-27 23:54:57
你要 在主程序里设置呀,不然程序不知道你要用外置还是内置的

评分

参与人数 1蝴蝶豆 +2 收起 理由
zero99 + 2

查看全部评分

andey 回答时间:2018-5-28 15:59:37
提示: 作者被禁止或删除 内容自动屏蔽
STM1024 回答时间:2018-5-28 17:24:00
本帖最后由 stm1024 于 2018-5-28 17:25 编辑

首先,你要选择HSE……
建议你先看看版本为3.5的标准库,system_stm32f10x.c这个文件,最开始的描述是这样的:
  1. /*
  2. * 1.  This file provides two functions and one global variable to be called from
  3.   *     user application:
  4.   *      - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
  5.   *                      factors, AHB/APBx prescalers and Flash settings).
  6.   *                      This function is called at startup just after reset and
  7.   *                      before branch to main program. This call is made inside
  8.   *                      the "startup_stm32f10x_xx.s" file.
  9.   *
  10.   *      - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
  11.   *                                  by the user application to setup the SysTick
  12.   *                                  timer or configure other parameters.
  13.   *                                    
  14.   *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
  15.   *                                 be called whenever the core clock is changed
  16.   *                                 during program execution.
  17.   *
  18.   * 2. After each device reset the HSI (8 MHz) is used as system clock source.
  19.   *    Then SystemInit() function is called, in "startup_stm32f10x_xx.s" file, to
  20.   *    configure the system clock before to branch to main program.
  21.   *
  22.   * 3. If the system clock source selected by user fails to startup, the SystemInit()
  23.   *    function will do nothing and HSI still used as system clock source. User can
  24.   *    add some code to deal with this issue inside the SetSysClock() function.
  25.   *
  26.   * 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depedning on
  27.   *    the product used), refer to "HSE_VALUE" define in "stm32f10x.h" file.
  28.   *    When HSE is used as system clock source, directly or through PLL, and you
  29.   *    are using different crystal you have to adapt the HSE value to your own
  30.   *    configuration.
  31.   */        
复制代码
以前我们在3.5之前的标准库里面,总要在main中调用一下SystemInit(),但是在3.5中,此项工作在启动代码中执行。
文件“startup_stm32f10x_xx.s“中的SystemInit()函数在所有设备会在进入main之前配置系统时钟,如果配置失败,HSI还是作为系统时钟源。
检查一下你的代码,是否有这个过程,如果有的话,最好调试一下看看代码挂在哪里了。

评分

参与人数 1蝴蝶豆 +4 收起 理由
zero99 + 4

查看全部评分

电子星辰 回答时间:2018-5-29 09:53:12
不管寄存器,标准库还是HAL库,我们要使用外部高速时钟都是需要在程序里设置代码的。没有程序的stm32f103应该是默认就没有使用外部晶振的,所以晶体本来就没工作。

评分

参与人数 1蝴蝶豆 +2 收起 理由
zero99 + 2

查看全部评分

所属标签

相似问题

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版