小弟第一次用ST的单片机,按照例程已经把TIM4全部配置完毕了(在while(1)前面的部分) void main(void) { TIM4_DeInit(); TIM4_TimeBaseInit(TIM4_PRESCALER_1,0xFF ); TIM4_ITConfig(TIM4_IT_UPDATE, ENABLE); enableInterrupts(); GPIO_Init(GPIOG, GPIO_PIN_5, GPIO_MODE_OUT_PP_LOW_FAST); TIM4_Cmd(ENABLE); while (1) { } } 编译也ok了,用STVD软件仿真,但是总是不会进it.c那个文件里面的TIM4的中断函数 @near @interrupt void TIM4_UPD_OVF_IRQHandler (void) { GPIO_WriteReverse(GPIOG, GPIO_PIN_5); TIM4_ClearITPendingBit(TIM4_IT_UPDATE); return; } 哪位大侠可以指点指点啊 |
回复:103K3的TIM4的一个问题
void RTC_It(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = RTC_IRQChannel;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority =6;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
RE:103K3的TIM4的一个问题
void TIM4_It(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = TIM4_IRQHandler;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority =6;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
你试试,能不能进TIM4。
回复:103K3的TIM4的一个问题
这里才是中断入口。