Sections
You are here: Home Forum Bugs, Known Issues, & Requests Cannot get fasttimer to work with an interface board.

Cannot get fasttimer to work with an interface board.

Up to Bugs, Known Issues, & Requests

Cannot get fasttimer to work with an interface board.

Posted by Ryan Chard at September 29. 2009

Hello,

   I'm trying to get an app that has a fasttimer in it to run on an interface board V0.1.  The same app works on a normal mc that has the application board, but when it is moved to an interface board it nologer functions.  Am I missing something.  I have tried from both a heavy v 1.6.2 and a solo, and cannot get it to work.

 

calling FastTimer_SetActive (true);  seems to freeze the controller

if I replace it with   Timer_SetActive(true); it is good until it gets to the FastTimer_Set, then it freezes there.

my app sets a line high then uses the call back from the fasttimer to set it low again.  This works well on the application board

Task code{

  Timer_SetActive(true);
  //FastTimer_SetActive (true);
  while(true){
    if(G_iInjectorOn){
      //Io_SetTrue(G_iIOLine);
      Io_SetValue(G_iIIOLine,1);
      FastTimer_InitializeEntry (&fastTimerPulseOff, Off, 1, G_iOnTime, false);//id=1,non repeating
      FastTimer_Set (&fastTimerPulseOff);
    }
    if (G_iInjectorPeriod == 0){
      TaskYield();
    }else{
      Sleep(G_iInjectorPeriod);
    }

}

//call back

void Off(int id){
  (void) id;
  // Io_SetFalse(G_iInjectorIOLine);
  Io_SetValue(G_iInjectorIOLine,0);
  return;
}

 

Thank you,

Ryan

Re: Cannot get fasttimer to work with an interface board.

Posted by Ryan Chard at August 27. 2010

Hello,

  So I finally had a chance to try and figure out why the fasttimer wouldn't work on the interface board.  I believe I have found the issue.

  In fasttimer.c inside FastTimer_Init()  where the interrupt is enabled makes the interface board freeze for some reason (but not on the application board, same controller swapped).  Replacing the call like below seems to fix the problem.

  // Enable the interrupt
  //AT91C_BASE_AIC->AIC_IECR = mask;
  AT91C_BASE_AIC->AIC_IECR = 1<<AT91C_ID_TC2;

 

Hope this helps someone else.

Cheers,

Ryan

Re: Cannot get fasttimer to work with an interface board.

Posted by Jaime Alemany at June 09. 2011

Hello Ryan,

 

yes it does! I had the same problem. It seems the original instruction ( = mask ) enabled also the FIQ and that was causing the freeze.

Thanks,

 

jaime

Powered by Ploneboard
Document Actions