杰发科技AC7803——不同晶振频率时钟的配置

计算公式

cpp 复制代码
PLL_POSDIV       [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62]
PLL_PREDIV_1     1 2 4
USE_XTAL       = 24M   
SYSCLK_FREQ    = 64M
SYSCLK_DIVIDER = 1
VCO            = USE_XTAL* FBKDIV / PREDIV     24*FBKDIV/2
SYSCLK_FREQ    = VCO / POSDIV / SYSCLK_DIV     64 = 24*FBKDIV/2/ (2-62)/1   

PREDIV = 2, SYSCLK_DIV = 1,POSDIV = 12,
24*FBKDIV/2
64 = 24*FBKDIV/2/12/1   
64*1*12*2=24*FBKDIV
FBKDIV = 64

修改为24M晶振,可以参考12M晶振配置

cpp 复制代码
	#define HSI_FREQ      8000000UL   /*!< Internal 8M RC clock */

	#define XTAL_8M       8000000UL   /*!< extern crystal oscillator 8M  */
	#define XTAL_12M     12000000UL   /*!< extern crystal oscillator 12M */
	#define XTAL_16M     16000000UL   /*!< extern crystal oscillator 16M */
	#define XTAL_30M     30000000UL   /*!< extern crystal oscillator 30M */
	#define XTAL_24M     24000000UL   /*!< extern crystal oscillator 30M */

	#define USE_XTAL     XTAL_24M      /*!< Select the actual crystal frequency */
	#define CKGEN_AUTO_CHANGE_CLK  1U  /*!< Auto change system clock to internal clock after detect xosc or pll fail */

	/*!< PLL configure */
	#ifndef PLL_CONFIG_72M  /* Output 64MHz */
	#if USE_XTAL == XTAL_8M
	#define PLL_POSDIV   PLL_POSDIV_8
	#define PLL_FBKDIV   64U
	#define PLL_PREDIV   PLL_PREDIV_1
	#elif USE_XTAL == XTAL_12M
	#define PLL_POSDIV   PLL_POSDIV_12
	#define PLL_FBKDIV   64U
	#define PLL_PREDIV   PLL_PREDIV_1
	#elif USE_XTAL == XTAL_16M
	#define PLL_POSDIV   PLL_POSDIV_8
	#define PLL_FBKDIV   64U
	#define PLL_PREDIV   PLL_PREDIV_2
	#elif USE_XTAL == XTAL_30M  /* Output 64MHz */
	#define PLL_POSDIV   PLL_POSDIV_20
	#define PLL_FBKDIV   160U
	#define PLL_PREDIV   PLL_PREDIV_4
	#elif USE_XTAL == XTAL_24M  /* Output 64MHz */
	#define PLL_POSDIV   PLL_POSDIV_12
	#define PLL_FBKDIV   64U
	#define PLL_PREDIV   PLL_PREDIV_2 
相关推荐
Shaun_青璇2 天前
STM32的AFIO讲解
stm32·单片机·嵌入式硬件·mcu·物联网
Shaun_青璇2 天前
EXTI配置流程 含中断延时消抖点亮小灯
stm32·单片机·嵌入式硬件·mcu·物联网
ShiinaKaze2 天前
【MCU】微控制器的编程技术:ISP 与 IAP
单片机·嵌入式硬件·mcu·iap·isp
7yewh3 天前
嵌入式硬件杂谈(六)充电器原理 线性电源 开关电源 反激电源原理
单片机·嵌入式硬件·mcu·物联网·硬件架构·硬件工程·pcb工艺
drinow4 天前
【纸飞机串口调试工具】预设曲线名称
arm开发·驱动开发·单片机·mcu·dsp开发·fpga·iot
可乐鸡翅好好吃4 天前
STM32的中断(什么是外部中断和其他中断以及中断号是什么)
c语言·stm32·单片机·嵌入式硬件·mcu·物联网·51单片机
Shaun_青璇5 天前
STM32 流水灯实验
stm32·单片机·嵌入式硬件·mcu·物联网
Shaun_青璇5 天前
stm32 点亮LED
stm32·单片机·嵌入式硬件·mcu·物联网
7yewh5 天前
嵌入式硬件实战基础篇(三)-四层板PCB设计-步进电机驱动(TMC2208/TMC2209)
驱动开发·嵌入式硬件·mcu·物联网·硬件架构·硬件工程·pcb工艺