Oscar Sanz

Interrupts only working al level 7

Discussion created by Oscar Sanz on Feb 26, 2008
Latest reply on Feb 27, 2008 by Oscar Sanz
Hello again...
 
I'm still have a mystery problem with inerrupts on MCF52233. The problem is i only have working inrterrupts if set all of these to IL = 7.
 
I have tested many different combination of IL and IP below level 7 without success....
 
Here is my code:
Code:
void KEnableAllInterrupts(){ DWORD tempStatus; //GLOBAL INTERRUPT ENABLEMCF_INTC0_IMRL = 0xFFFFFFFE;tempStatus = MCF_INTC0_IMRH & 0xFF7FFFFF;  //Activada interrupcion PT0;MCF_INTC0_IMRH = tempStatus;  tempStatus = MCF_INTC0_IMRL  & 0xFFFFDFFF;  //Activada interrupciones UART0;MCF_INTC0_IMRL = tempStatus;tempStatus = MCF_INTC0_IMRL  & 0xFFFFBFFF;  //Activada interrupciones UART1;MCF_INTC0_IMRL = tempStatus;tempStatus = MCF_INTC0_IMRL  & 0xFFFF7FFF; //Activada interrupciones UART2;MCF_INTC0_IMRL = tempStatus;//FEC INTERRUPTS -> ETHERNET MODULEStempStatus = MCF_INTC0_IMRL  & 0xF7FFFFFF;  //Interrupcion 27 FEC RX.MCF_INTC0_IMRL = tempStatus;//RTC ha dado problemasMCF_RTC_RTCCTL  = 0x00000000;MCF_RTC_RTCIENR = 0x00000000;}void IRQ_INIT(){BYTE IP;BYTE IL;MCF_INTC0_IMRH = 0xFFFFFFFF;      //All interrupts dissabledMCF_INTC0_IMRL = 0xFFFFFFFF;      //All interrupts dissabled//UARTS//MCF_INTC0_ICR13 = 0x3D; //MCF_INTC0_ICR14 = 0x3E; //MCF_INTC0_ICR15 = 0x3F;//PIT0//MCF_INTC0_ICR55 = 0x3C; //UARTSIL = 0x07 << 3;IP = 0x02;MCF_INTC0_ICR13 = IL | IP; IP = 0x03;MCF_INTC0_ICR14 = IL | IP; IP = 0x02;MCF_INTC0_ICR15 = IL | IP; //PIT0IP = 0x04;MCF_INTC0_ICR55 = IL | IP; //ETHERNETIL = 0x07 << 3;IP = 0x01;MCF_INTC0_ICR27 = IL | IP; }

 
Does any have a idea about where the problem can be?????
 
Maybe the ISR's are wrong? Here are:
 
 
Code:
__declspec (interrupt) void PIT0_isr();__declspec (interrupt) void PIT0_isr(){KDisableAllInterrupts();   if( GPROC_1_CN ) GPROC_1_CN--; if( GPROC_2_CN ) GPROC_2_CN--; if( GPROC_3_CN ) GPROC_3_CN--; if( GPROC_4_CN ) GPROC_4_CN--; if( GPROC_5_CN ) GPROC_5_CN--; if( GPROC_6_CN ) GPROC_6_CN--; if( GPROC_7_CN ) GPROC_7_CN--; if( GPROC_8_CN ) GPROC_8_CN--;  GTIME_COUNTER++; if( GENERAL_PROPOSE_TIMER ) GENERAL_PROPOSE_TIMER --; //Contador per fer timers senzills  MCF_PIT0_PMR = 0x0FFF;KEnableAllInterrupts();}//-----------------------------------------------------------------------------------------------------__declspec (interrupt) void EPORT4_isr();__declspec (interrupt) void EPORT4_isr(){KDisableAllInterrupts(); MCF_EPORT0_EPFR = 0xFF;KEnableAllInterrupts();}//-----------------------------------------------------------------------------------------------------__declspec (interrupt) void UART0_isr();__declspec (interrupt) void UART0_isr(){KDisableAllInterrupts(); GRxData[0].GRxChar[GRxData[0].GRxCounter] = uart_getchar(0); if( GRxData[0].GRxCounter < 255 ) GRxData[0].GRxCounter++; else GRxData[0].GRxCounter = 0; GRxData[0].GRxChar[GRxData[0].GRxCounter] = 0; KEnableAllInterrupts();}//-----------------------------------------------------------------------------------------------------BYTE tempChar;__declspec (interrupt) void UART1_isr();__declspec (interrupt) void UART1_isr(){KDisableAllInterrupts(); tempChar = uart_getchar(1); if( tempChar == ':' )  { GRxData[1].GRxCounter = 0; GRxData[1].GTxCounter = 0; } GRxData[1].GRxChar[GRxData[1].GRxCounter++] = tempChar ; GRxData[1].GRxChar[GRxData[1].GRxCounter] = 0; KEnableAllInterrupts(); }//-----------------------------------------------------------------------------------------------------__declspec (interrupt) void UART2_isr();__declspec (interrupt) void UART2_isr(){KDisableAllInterrupts(); GRxData[2].GRxChar[GRxData[2].GRxCounter++] = uart_getchar(2); GRxData[2].GRxChar[GRxData[2].GRxCounter] = 0; KEnableAllInterrupts();}__declspec (interrupt) void RTC_isr();__declspec (interrupt) void RTC_isr(){ MCF_RTC_RTCCTL  = 0x00000000; MCF_RTC_RTCIENR = 0x00000000; printf("\n\rUNKNOWN_INTERRUPT_isr()");}__declspec (interrupt) void ETHERNET_isr();__declspec (interrupt) void ETHERNET_isr(){KDisableAllInterrupts(); fec_handler(&fec_nif); Xarxes();KEnableAllInterrupts(); }

 

Thank you in advance;

WBR

Oscar Sanz


 

Outcomes