CH32V307VCT6的PB8無法映射到TIM8_CH3上

??? GPIO_InitTypeDef GPIO_InitStructure={0};
??? NVIC_InitTypeDef NVIC_InitStructure = {0};
??? TIM_OCInitTypeDef TIM_OCInitStructure={0};
??? TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure={0};

??? RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );
??? RCC_APB2PeriphClockCmd( RCC_APB2Periph_TIM8, ENABLE );
??? RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);//使能AFIO復(fù)用功能模塊時鐘

??? GPIO_PinRemapConfig(GPIO_Remap_TIM8 , ENABLE);

??? GPIO_InitStructure.GPIO_Pin = X_PUL_GPIO;
??? GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
??? GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
??? GPIO_Init( X_PUL_PORT, &GPIO_InitStructure );

??? TIM_TimeBaseInitStructure.TIM_Period = arr;
??? TIM_TimeBaseInitStructure.TIM_Prescaler = psc;
??? TIM_TimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
??? TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
??? TIM_TimeBaseInit( X_TIM, &TIM_TimeBaseInitStructure);

??? TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
??? TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
??? TIM_OCInitStructure.TIM_Pulse = ccp;
??? TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
??? TIM_OC3Init( X_TIM, &TIM_OCInitStructure );

??? TIM_CtrlPWMOutputs(X_TIM, ENABLE );
??? TIM_OC3PreloadConfig( X_TIM, TIM_OCPreload_Enable );
??? TIM_ARRPreloadConfig( X_TIM, ENABLE );
??? TIM_Cmd( X_TIM, ENABLE );

??? TIM_ITConfig(X_TIM, TIM_IT_Update, ENABLE);
??? NVIC_InitStructure.NVIC_IRQChannel = TIM8_UP_IRQn;
??? NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
??? NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
??? NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
??? NVIC_Init(&NVIC_InitStructure);





以上是代碼,PB8(TIM8_CH3)無法輸出PWM?能幫忙看看是說明問題嗎?

icon_rar.gifCH32V307VCT6_TIM8_CH3_PB8_2022.8.zip

image.pngimage.pngimage.png


只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频