Author Topic: timer problem ?  (Read 1443 times)

0 Members and 1 Guest are viewing this topic.

Offline koray692Topic starter

  • Contributor
  • Posts: 13
timer problem ?
« on: April 29, 2016, 08:20:09 am »
Hello friends , I am working on a project I need to use timer in this project but .At first time timer and its interrupt working without timer counting after that it works very well what is the reason first time timer start timer interrupt without counting to I wanted 2 second.When AA becomes 1 it start to count than it create a interrupt.

void InitTimer3(){
  RCC_APB1ENR.TIM3EN = 1;
  TIM3_CR1.CEN = 0;
  TIM3_PSC = 279;
  TIM3_ARR = 59999;
  NVIC_IntEnable(IVT_INT_TIM3);
  TIM3_DIER.UIE = 1;
  TIM3_CR1.CEN = AA;
}

void Timer3_interrupt() iv IVT_INT_TIM3 {
   TIM3_SR.UIF = 0;
   GPIOD_ODR.B12=0;     //ve dur
   AA=0;
}

 if(4<ACI_ACCx && r )
{

 GPIOD_ODR.B12=1;   // sa? ip çek   ye?il

 AA=1;
 h=h+1;
 r=~r;

}
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->