Tarun Thomas Abraham

Query on PIT in MCF5282

Discussion created by Tarun Thomas Abraham on Jun 5, 2006
Latest reply on Jun 16, 2006 by David E Seymour
Hi ,
I am using M5282EVB evaluation board with Codewarrior for coldfire.
I am trying to set up a PIT in my application.
But somehow the interrupt doesnt get generated. Is there anything i am missing here.In the Vectors.s I have replaced the existing interrupt handler for Vector 77 (119) with _pit0_handler. Am i missing something here?
 
void main()
{
    InitializeTimers();
}
 
void InitializeTimers()
{
 MCF5282_INTC0_ICR55 = 0 | MCF5282_INTC_ICR_IP(6) | MCF5282_INTC_ICR_IL(6);

 MCF5282_PIT0_PCSR = 0 | MCF5282_PIT_PCSR_PRE(0xF)
 |MCF5282_PIT_PCSR_PIE
 |MCF5282_PIT_PCSR_EN
 |MCF5282_PIT_PCSR_RLD;
 MCF5282_PIT0_PMR   = 0x1111;
 MCF5282_INTC0_ICR55 = 0x3F;//0x0B;//Set IP and IL
 MCF5282_INTC0_IMRH &= 0x00800000;//Enable PIT0
}
__interrupt__ void pit0_handler(void)
{  int i;
 

  for(i=0;i<=300000;i++);
  MCF5282_GPIO_PORTTC &= 0x00;
  MCF5282_GPIO_PORTTD |= 0xFF;
  MCF5282_PIT0_PCSR |= MCF5282_PIT_PCSR_PIF;
  //MCF5282_PIT0_PCSR &= 0xFFFE; Is this required?????
 

}

Outcomes