本人有个疑问想请教一下:107以太网功能的MCO是输出PLL分频后的时钟给PHY和REF使用的,MCO使用的引脚是PA8,但是本人又使能和TIM1定时功能,配置TIM1为:
void TIM1_Config(void)
{
TIM_TimeBaseInitTypeDef TIM1_InitStruct;
TIM_OCInitTypeDef TIM1_OCInitStruct;
TIM_DeInit(TIM1);
TIM1_InitStruct.TIM_Period = 65535;
TIM1_InitStruct.TIM_Prescaler = 35999;
TIM1_InitStruct.TIM_ClockDivision = TIM_CKD_DIV1;
TIM1_InitStruct.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM1, &TIM1_InitStruct);
TIM1_OCInitStruct.TIM_OCMode = TIM_OCMode_Timing;
TIM1_OCInitStruct.TIM_Pulse = 65535;//CaptureVal;
TIM1_OCInitStruct.TIM_OCPolarity = TIM_OCPolarity_Low;
TIM1_OCInitStruct.TIM_OutputState = TIM_OutputState_Disable;
TIM_OC1Init(TIM1, &TIM1_OCInitStruct);
TIM_OC2Init(TIM1, &TIM1_OCInitStruct);
TIM_OC3Init(TIM1, &TIM1_OCInitStruct);
TIM_OC4Init(TIM1, &TIM1_OCInitStruct);
/* TIM1中断源设置,开启相应通道的捕捉比较中断*/
TIM_ITConfig(TIM1, TIM_IT_CC1 | TIM_IT_CC2 | TIM_IT_CC3 | TIM_IT_CC4, ENABLE);
}
PA8------TIM1——CH1-----MCO
PA8引脚我的意是作为时钟输出,初始化之后,网络的时钟信号正常(LED闪烁正常),但是当触发TIM1中断后,MCO时钟不正常,网络时钟消失了。本人猜想,是否是因为TIM1_CH1和MCCO引脚冲突导致,但是在TIM1_OCInitStruct.TIM_OutputState = TIM_OutputState_Disable;也没有作用,还是出现这个问题? |