开发指南:华大 HC32F460 时钟控制单元

clock

pll

systick

《ARM ® CortexM4 Devices Generic User Guide》

hc32f460's systick control and status register

华大 HC32F460 的 systick 嘀嗒定时器使用内核时钟(HCLK)

HC32F460.h
********************************************************************************
* @file HC32F460.h
* @brief Headerfile for HC32F460 series MCU
********************************************************************************

********************************************************************************
Configuration of the Cortex-M4 Processor and Core Peripherals
********************************************************************************
#define __CM4_REV 1 // !< Core revision r0p1
#define __FPU_PRESENT 1 // !< FPU present
#define __MPU_PRESENT 1 // !< HC32F460 provides an MPU
#define __NVIC_PRIO_BITS 4 // !< HC32F460 uses 4 Bits for the Priority Levels
#define __Vendor_SysTickConfig 0 // !< Set to 1 if different SysTick Config is used
core_cm4.h
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
uint32_t SysTick_Config(uint32_t ticks)
{
...
}
#endif

华大 HC32F460 的 systick 嘀嗒定时器使用 cmsis(core_cm4.h) 中默认的配置函数

外设时钟源(URT)

÷2 表示开启过采样功能

Baudrate=串口频率08 × (1 +整数分频寄存器)    (关闭过采样)
Baudrate=串口频率16 × (1 +整数分频寄存器)    (开启过采样)

公式中整数分频寄存器的取值范围为 0x00 ~ 0xFF(USART_BRR[b15~b08])

外设时钟源(SPI)

外设时钟源(I2C)

外设时钟源(CMP)

比较滤波器的采样频率越低→滤波效果越好!