Hi peter;
thanks a lot for your reply.
The priorities for all interrupts are defined as follows:
MCF_INTC0_ICR04 = 0x3F;
MCF_INTC0_ICR13 = 0x3F;
MCF_INTC0_ICR14 = 0x3F;
MCF_INTC0_ICR15 = 0x3F;
MCF_INTC0_ICR19 = 0x3F;
MCF_INTC0_ICR55 = 0x3F;
These are all interrupts i'm using on this project. But note that i have tried to change these parameters by decreasing the INTERUPT LEVEL and similar problem happens.
Basically i'm doing the following; timer init:
void ColdfireDTIMERInit( BYTE timerNum, BYTE prescalerValue, DWORD timeoutValue, BYTE interruptEnable )
{
WORD tempVar = 0;
if( timerNum == 0)
{
MCF_GPIO_PTCPAR = 0x01; //COMO GPIO
// MCF_GPIO_DDRTC = 0x0F; //SALIDA
// MCF_GPIO_PORTTC = 0x00;
MCF_DTIM0_DTXMR = 0;
MCF_DTIM0_DTER = 0x02;
MCF_DTIM0_DTRR = timeoutValue;
tempVar = prescalerValue;
tempVar = tempVar << 8;
tempVar |= 0x0033;
if( interruptEnable )
{
tempVar |= 0x0010;
}
MCF_DTIM0_DTMR = tempVar;
//MCF_DTIM0_DTCR
//MCF_DTIM0_DTCN
}
}
And the timer ISR:
__declspec (interrupt) void DTIM0_isr()
{
MCF_DTIM0_DTER = 0x02;
MCF_DTIM0_DTCN = 0;
GTaskSwitcher |= 0x08; //DTIM_0
}
GTaskSwitcher is a global variable i'm using as a task switch flag on the main while loop ( the same is applied on the other interrupt routines:
main()
{
......
// Some inits etc...
......
while(1){
if( GTaskSwitcher & 0x08 )
{
ColdfireDissableAllInterrupts();
printf("\n\rDTIM_0_IRQ->%d", tempCnt); // To see what is happening....
fflush(stdout);
GTaskSwitcher = GTaskSwitcher & 0xF7;
tempCnt++;
ColdfireEnableAllInterrupts();
}
....
....
}
}
OK, with this code, the printf runs up to tempCnt =10496. Then no any interrupt will work anymore. Before all the other interrupts are working fine. If I dissable the DTIM0 interrupt the problem disappear also.
What do you think?