OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2743|回复: 5

SysTick时钟选择,在一个程序里面看到SysTick时钟源选择的是8分频

[复制链接]

1

主题

6

帖子

0

精华

初级会员

Rank: 2

积分
132
金钱
132
注册时间
2019-10-17
在线时间
47 小时
发表于 2020-4-6 10:49:30 | 显示全部楼层 |阅读模式
10金钱
请问    SysTick的时钟源选择的是SysTick_CLKSource_HCLK_Div8当外部晶振挂了,是不是也会自动转到内核时钟

最佳答案

查看完整内容[请看2#楼]

SysTick就是HCLK或者HCLK/8,HSE挂了CSS会自动切换到HSI运行,所以HCLK就是HSI频率,所以SysTick时钟也就可以确定了。
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

8

主题

154

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
439
金钱
439
注册时间
2018-12-21
在线时间
126 小时
发表于 2020-4-6 10:49:31 | 显示全部楼层
SysTick就是HCLK或者HCLK/8,HSE挂了CSS会自动切换到HSI运行,所以HCLK就是HSI频率,所以SysTick时钟也就可以确定了。
回复

使用道具 举报

1

主题

6

帖子

0

精华

初级会员

Rank: 2

积分
132
金钱
132
注册时间
2019-10-17
在线时间
47 小时
 楼主| 发表于 2020-4-7 16:37:01 | 显示全部楼层
0x00000000 发表于 2020-4-6 10:49
SysTick就是HCLK或者HCLK/8,HSE挂了CSS会自动切换到HSI运行,所以HCLK就是HSI频率,所以SysTick时钟也就可 ...

系统时钟选的是PLL,
“HSE故障,外部HSE振荡器被关闭。如果HSE振荡器时钟是用作系统时钟的PLL的输入时钟,PLL也将被关闭。”
那是不是此时切换的HSI就直接作为系统时钟了、没有PLL倍频了,
如果原本是PLL  9倍频得到的72M系统时钟在HSE故障后就变成8M了
回复

使用道具 举报

8

主题

154

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
439
金钱
439
注册时间
2018-12-21
在线时间
126 小时
发表于 2020-4-7 18:20:37 | 显示全部楼层
你说的这些其实RM0008号文件都有为什么不先去ST官网看看呢?这么详细的内容不好过你在这里问一万遍?先自助再求助。
Clock Security System can be activated by software. In this case, the clock detector is
enabled after the HSE oscillator startup delay, and disabled when this oscillator is stopped.
If a failure is detected on the HSE clock, the HSE oscillator is automatically disabled, a clock
failure event is sent to the break input of the advanced-control timers (TIM1 and TIM8) and
an interrupt is generated to inform the software about the failure (Clock Security System
Interrupt CSSI), allowing the MCU to perform rescue operations. The CSSI is linked to the
Cortex®-M3 NMI (Non-Maskable Interrupt) exception vector.
Note: Once the CSS is enabled and if the HSE clock fails, the CSS interrupt occurs and an NMI is
automatically generated. The NMI will be executed indefinitely unless the CSS interrupt
pending bit is cleared. As a consequence, in the NMI ISR user must clear the CSS interrupt
by setting the CSSC bit in the Clock interrupt register (RCC_CIR).
If the HSE oscillator is used directly or indirectly as the system clock (indirectly means: it is
used as PLL input clock, and the PLL clock is used as system clock), a detected failure
causes a switch of the system clock to the HSI oscillator and the disabling of the HSE
oscillator
. If the HSE clock (divided or not) is the clock entry of the PLL used as system clock
when the failure occurs, the PLL is disabled too.

回复

使用道具 举报

52

主题

160

帖子

0

精华

高级会员

Rank: 4

积分
725
金钱
725
注册时间
2019-6-27
在线时间
153 小时
发表于 2020-4-7 21:03:40 | 显示全部楼层
0x00000000 发表于 2020-4-7 18:20
你说的这些其实RM0008号文件都有为什么不先去ST官网看看呢?这么详细的内容不好过你在这里问一万遍?先自助 ...

去官网哪里去查看这些个资料,不太知道
回复

使用道具 举报

1

主题

6

帖子

0

精华

初级会员

Rank: 2

积分
132
金钱
132
注册时间
2019-10-17
在线时间
47 小时
 楼主| 发表于 2020-4-7 21:24:24 | 显示全部楼层
0x00000000 发表于 2020-4-7 18:20
你说的这些其实RM0008号文件都有为什么不先去ST官网看看呢?这么详细的内容不好过你在这里问一万遍?先自助 ...

,,,,,这就是从手册弄来的
感谢您的回答,受教了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-5-25 01:02

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表