CH32V307KCS
2023 20221203.6 Timer 6 int main(void) { //u16 i ; NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); Delay_Init(); USART_Printf_Init(115200); printf("SystemClk:%d\r\n",SystemCoreClock); printf("This is printf example\r\n"); GPIO_InitTypeDef GPIO_InitStructure = {0}; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, DISABLE); RCC->APB2PCENR |= 0x04 ; //RCC_APB2PCENR RCC->APB2PCENR GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_WriteBit(GPIOA, GPIO_Pin_15, 1); //Bit_SET Bit_RESET RCC->APB1PCENR |= 1<<4 ; //TIM6->ATRLR = 0x0000 ; TIM6->PSC = 0xFFF ; TIM6->CTLR1 = 0x01 ; while(1) { //GPIO_WriteBit(GPIOA, GPIO_Pin_15, 1); //while((TIM6->INTFR&0x01)==0);