21ic问答首页 - GD32外接16Mhz晶振,计算后倍频是小数,如何解决?
GD32外接16Mhz晶振,计算后倍频是小数,如何解决?
HCFll2021-10-05
#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD))
/* select HXTAL/2 as clock source */
RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0);
RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0);
/* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */
RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4);
//RCU_CFG0 |= RCU_PLL_MUL27;
//这里CK_HXTAL为16MHz,所以计算倍频得13.5,那么应该选RCU_PLL_MUL13还是RCU_PLL_MUL14呢?
RCU_CFG0 |= RCU_PLL_MUL13;//??RCU_PLL_MUL14??
/* select HXTAL/2 as clock source */
RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0);
RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0);
/* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */
RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4);
//RCU_CFG0 |= RCU_PLL_MUL27;
//这里CK_HXTAL为16MHz,所以计算倍频得13.5,那么应该选RCU_PLL_MUL13还是RCU_PLL_MUL14呢?
RCU_CFG0 |= RCU_PLL_MUL13;//??RCU_PLL_MUL14??
赞0
评论
2021-10-08
您需要登录后才可以回复 登录 | 注册