#include "CH552.h"
#include "GPIO.h"
unsigned int PWM=50;
unsigned char time = 0;
void delay(unsigned int a)
{
? unsigned int i,j,k;
? CLOCK_CFG &= ~bOSC_EN_XT;? //關(guān)閉外部晶振
? CLOCK_CFG |= bOSC_EN_INT;? //使能內(nèi)部晶振
? CLOCK_CFG = CLOCK_CFG & (~MASK_SYS_CK_SEL) | 0x06; //24M
? P3 |= (1 << 0x04);//關(guān)閉LED
? TMOD &= ~bT1_CLK; //系統(tǒng)時鐘12分頻
? TMOD = TMOD & 0xF0 | bT0_M1;? //模式2
void Time0Interrupt(void) interrupt INT_NO_TMR0 using 1