2014-04-11 07:37 AM
hello dear forum,
I am trying to write a program for STM32F103RC but when I enable TIM8_UP interrupt the program freezes I am using RIDE7 for compiling and the program compiles without error please have a look at my code , thank youRCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE);
-----------------------------
void
TIM8_UP_IRQHandler(
void
){
tim8tog++; }
-----------------------------
TIM_ITConfig(TIM8, TIM_IT_Update , ENABLE);
-----------------------------
NVIC_InitStructure.NVIC_IRQChannel = TIM8_UP_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
#tim8_up
2014-04-11 07:54 AM
Qualify and Clear the interrupt source before incrementing your counter variable.