#include "bat32g137.h"
#include "clk.h"
int main(void)
{
CLK_Osc_Setting(OSC_PORT,OSC_OSCILLATOR);
//禁止输出
PCBZ->CKS0 &= (uint8_t)~0x80;
PCBZ->CKS0 = 0x08;
/* Set CLKBUZ0 pin */
PORT->P14 &= 0xFEU;
PORT->PM14 &= 0xFEU;
PCBZ->CKS0 |= 0x80;
//禁止输出
PCBZ->CKS1 &= (uint8_t)~0x80;
PCBZ->CKS1 = 0x02;
/* Set CLKBUZ1 pin */
PORT->P14 &= ~(1<<1);
PORT->PM14 &= ~(1<<1);
PCBZ->CKS1 |= 0x80;
while(1)
{
}
}
- 注意如果输出副时钟,需要配置对应的晶振IO为晶振口,这样晶振才会起振。