Query on PIT in MCF5282

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query on PIT in MCF5282

2,155 Views
TTA
Contributor I
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?????
 

}
Labels (1)
0 Kudos
1 Reply

333 Views
DavidS
NXP Employee
NXP Employee

Hi TTA,

Did you lower the SR from 0x2700 to 0x2000?  The system status register (SR) is like a global mask.  Whatever Interrupt Level it is at, then interrupt sources that are at that level or less will be blocked.  So lowering the SR to a IL=0 (i.e. SR=0x2000) will let the interrupt source get to the core.

Regards, DavidS

0 Kudos