2007-09-18 10:53 PM
Problem on Interrupt (VIC0 and VIC1)
2011-05-17 12:33 AM
Hi,
At the moment I sent my last message I found that I use the VIC1_VA2R register twice. Actually, it was not a copy and past error, it was really wrong in my code. Because of that, the UART wouldn't work with the I2C at the same time. That's clear. But an other intersting effect occurs. During my work with the I2C the UART-ISR was not initialised. The VIC1_VA2R register contains the start address of the I2C-ISR, but the wrong channel (VIC1_INTER |= (1 << 3)) was enabled. With this setting the programm works!? Best regards, Jens2011-05-17 12:33 AM
Hello,
My interrupts:VIC0_VA4R = (u32)TIM0_IRQHandler; // for dma
VIC0_VA6R = (u32)TIM2_IRQHandler; // 2ms timer
VIC0_VA12R = (u32)DMA_IRQHandler;
VIC1_VA2R = (u32)UART2_IRQHandler;
VIC1_VA3R = (u32)I2C_IRQHandler;
VIC1_VA13R = (u32)EXT_IO_IRQHandler;
For testing I continiously read and write to an external EEPROM. After a certain time the processor resets. After the help on this forum, i modified my code with 2 default IRQ functions: (as suggested by JAL)
void Default0_IRQHandler( void ) __attribute ((interrupt(''IRQ'')));
void Default0_IRQHandler( void ){
spuriousInterruptCount0++;
VIC0_VAR = 0;
}
void Default1_IRQHandler( void ) __attribute ((interrupt(''IRQ'')));
void Default1_IRQHandler( void ){
spuriousInterruptCount1++;
VIC1_VAR = 0;
}
VIC0_DVAR = (u32)Default0_IRQHandler;
VIC1_DVAR = (u32)Default1_IRQHandler;
After a certain time, Default1_IRQHandler is entered and spuriousInterruptCount1 is incremented. After returning, the continious read/write to I2C didn't continue... Then I modified the 2 default IRQ functions:
void Default0_IRQHandler( void ){
spuriousInterruptCount0++;
VIC0_VAR = 0;
VIC1_VAR = 0;
}
void Default1_IRQHandler( void ){
spuriousInterruptCount1++;
VIC0_VAR = 0;
VIC1_VAR = 0;
}And up till now, it keeps on working!!! Read/write tests to the EEPROM: 4120 spuriousInterruptCount1: 81 spuriousInterruptCount0: 0 I hope this solution is suitable for devellopers with simular problems. Best Regards, Louis XIV