\Mini51DE_Series_BSP_CMSIS_v3.01.002\SampleCode\StdDriver\SYS
在寄存器里面有个clkout的功能。
/* Set P3 multi-function pins for Clock Output */
SYS->P3_MFP = SYS_MFP_P36_CKO;
/* Switch HCLK clock source to Internal 22MHz */
CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_IRC22M,0);
/* Enable CKO and output frequency = system clock / 4 */
CLK_EnableCKO(CLK_CLKSEL2_FRQDIV_HCLK,1,0); |