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复用功能模块时钟
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?能帮忙看看是说明问题吗?