这是我的代码,就是没办法将外部触发配置成功。
void Timer3_Init(void )
{
RCC_APB2PeriphClockCmd (RCC_APB2Periph_TIM1 ,ENABLE );
RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOA ,ENABLE );
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure .GPIO_Mode = GPIO_Mode_IPU ;
GPIO_InitStructure .GPIO_Pin = GPIO_Pin_12 ;
GPIO_InitStructure .GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init (GPIOA,&GPIO_InitStructure );
TIM_ETRClockMode2Config(TIM1,TIM_ExtTRGPSC_OFF,TIM_ExtTRGPolarity_Inverted,0x00);
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure;
TIM_TimeBaseInitStructure.TIM_ClockDivision =TIM_CKD_DIV1 ;
TIM_TimeBaseInitStructure .TIM_CounterMode =TIM_CounterMode_Up ;
TIM_TimeBaseInitStructure.TIM_Period =1000-1 ;
TIM_TimeBaseInitStructure.TIM_Prescaler =1-1 ;
TIM_TimeBaseIn