#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; //关闭外部晶振
CLOCK_CFG |= bOSC_EN_INT; //使能内部晶振
CLOCK_CFG = CLOCK_CFG & (~MASK_SYS_CK_SEL) | 0x06; //24M
TMOD = TMOD & 0xF0 | bT0_M1; //模式2
void Time0Interrupt(void) interrupt INT_NO_TMR0 using 1
热门产品 :
CH32X035: 32位USB+USB PD单片机