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

关于STM32F107中的时钟配置寄存器RCC_CFGR2

[复制链接]
十二翼天使 提问时间:2015-3-11 20:15 /
如题,在STM32F10X参考手册中没有找到时钟配置寄存器RCC_CFGR2,在配置时钟时,没有资料可以参考,开发板的外部晶振是25M,想配置72M的主频,想求助一下大家!参考手册顺便附上。

RCC_CFGR2

RCC_CFGR2

stm32f10xxx_reference_cn.pdf

下载

3.69 MB, 下载次数: 105, 下载积分: ST金币 -1

STM32F10X参考手册

<
收藏 评论18 发布时间:2015-3-11 20:15

举报

18个回答
wambob 回答时间:2015-3-11 20:47:14
本帖最后由 wambob 于 2015-3-11 21:09 编辑

Status bits in the Clock
control register (RCC_CR) indicate which clock(s) is (are) ready and which clock is currently
used as system clock.  

在时钟控制寄存器(RCC_CR)里的状态位指示哪个时钟已经准备好了,哪个时钟目前被用作系统
时钟。



时钟配置寄存器(RCC_CFGR)

这2个寄存器就可以了


你的RCC_CFGR2在是那个手册里的 啊







十二翼天使 回答时间:2015-3-11 21:20:06
wambob 发表于 2015-3-11 20:47
Status bits in the Clock
control register (RCC_CR) indicate which clock(s) is (are) ready and which  ...

这个手册里没有RCC_CFGR2的资料,我也不知道在哪里可以找到关于这个寄存器的资料
十二翼天使 回答时间:2015-3-11 21:20:49
wambob 发表于 2015-3-11 20:47
Status bits in the Clock
control register (RCC_CR) indicate which clock(s) is (are) ready and which  ...

ST的官网上有吗?
wambob 回答时间:2015-3-11 21:28:28
本帖最后由 wambob 于 2015-3-11 21:31 编辑
十二翼天使 发表于 2015-3-11 21:20
这个手册里没有RCC_CFGR2的资料,我也不知道在哪里可以找到关于这个寄存器的资料 ...


你那个程序是从哪找来的,写程序参考相应芯片的参考手册就可以了 ,比如你用的107,就用10XX的
程序不是通用的,但思路是一样的,要学会思考。不能光看代码一样不一样
十二翼天使 回答时间:2015-3-11 21:29:33
wambob 发表于 2015-3-11 20:47
Status bits in the Clock
control register (RCC_CR) indicate which clock(s) is (are) ready and which  ...

stm32f10x.h中没有关于RCC_CFGR2的定义

RCC_CFGR的位定义

RCC_CFGR的位定义
十二翼天使 回答时间:2015-3-11 21:51:35
wambob 发表于 2015-3-11 21:28
你那个程序是从哪找来的,写程序参考相应芯片的参考手册就可以了 ,比如你用的107,就用10XX的
程序不是 ...

我也看过时钟树,在外部晶振为25M的情况下不可能配置出72M的时钟,而且源代码里的一些解释也我一头雾水的,例如PREDIV1,我就不知道从哪儿来的,而且找不到它的定义,问题中提到的RCC_CFGR2寄存器也是一样,找不到它的定义。

时钟树

时钟树

源代码.rar

下载

1.91 KB, 下载次数: 14, 下载积分: ST金币 -1

源代码

wambob 回答时间:2015-3-11 21:58:19
typedef struct
{
  __IO uint32_t CR;         /*!< RCC clock control register,                                  Address offset: 0x00 */
  __IO uint32_t CFGR;       /*!< RCC clock configuration register,                            Address offset: 0x04 */
  __IO uint32_t CIR;        /*!< RCC clock interrupt register,                                Address offset: 0x08 */
  __IO uint32_t APB2RSTR;   /*!< RCC APB2 peripheral reset register,                          Address offset: 0x0C */
  __IO uint32_t APB1RSTR;   /*!< RCC APB1 peripheral reset register,                          Address offset: 0x10 */
  __IO uint32_t AHBENR;     /*!< RCC AHB peripheral clock register,                           Address offset: 0x14 */
  __IO uint32_t APB2ENR;    /*!< RCC APB2 peripheral clock enable register,                   Address offset: 0x18 */
  __IO uint32_t APB1ENR;    /*!< RCC APB1 peripheral clock enable register,                   Address offset: 0x1C */
  __IO uint32_t BDCR;       /*!< RCC Backup domain control register,                          Address offset: 0x20 */
  __IO uint32_t CSR;        /*!< RCC clock control & status register,                         Address offset: 0x24 */
  __IO uint32_t AHBRSTR;    /*!< RCC AHB peripheral reset register,                           Address offset: 0x28 */
  __IO uint32_t CFGR2;      /*!< RCC clock configuration register 2,                          Address offset: 0x2C */
  __IO uint32_t CFGR3;      /*!< RCC clock configuration register 3,                          Address offset: 0x30 */
  __IO uint32_t CR2;        /*!< RCC clock control register 2,                                Address offset: 0x34 */
} RCC_TypeDef;


wambob 回答时间:2015-3-11 22:12:28
本帖最后由 wambob 于 2015-3-11 22:14 编辑

请看下STM32F0XX手册就明白了,你用的107芯片,却用的0XX的程序,肯定不对了 ,参考手册不一样的
十二翼天使 回答时间:2015-3-11 22:23:28
wambob 发表于 2015-3-11 21:58
typedef struct
{
  __IO uint32_t CR;         /*!< RCC clock control register,                        ...

真是太谢谢你了,我刚刚受你的启发,我在stm32f10x.h中也找到了相关的定义,只是和你给的稍有不同
RCC_CFGR2的位定义.png
RCC_type.png
12下一页

所属标签

相似问题

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版