Skip to main content
acorradini9
Associate II
September 19, 2007
Question

Problem on Interrupt (VIC0 and VIC1)

  • September 19, 2007
  • 11 replies
  • 3436 views
Posted on September 19, 2007 at 07:53

Problem on Interrupt (VIC0 and VIC1)

This topic has been closed for replies.

11 replies

jens239955_stm1
Associate II
May 17, 2011
Posted on May 17, 2011 at 09:33

Hi,

As I wrote, I thought I have fixed the problem. Using two independend spurious ISR with updating the hardware logic at VIC0 and VIC1 looks like the solution I need.

But, adding the I2C0 to VIC1 (UART2 was still in use) shows the well known effect (ISR were lost).

Looking about the forum entries, I think some of the describted problems looks like basing on the same reason. There must be an error in the VICs!

Please have a look on my code fragments and say what is wrong with it:

static unsigned spuriousInterruptCount0 = 0;

void defaultISR0( void ) __attribute ((interrupt(''IRQ'')));

void defaultISR0( void ){

spuriousInterruptCount0++;

VIC0_VAR = 0;

}

static unsigned spuriousInterruptCount1 = 0;

void defaultISR1( void ) __attribute ((interrupt(''IRQ'')));

void defaultISR1( void ){

spuriousInterruptCount1++;

VIC1_VAR = 0;

}

....

VIC0_DVAR = (unsigned int)defaultISR0;

VIC1_DVAR = (unsigned int)defaultISR1;

VIC0_VA5R = (unsigned int)TMR_vIsr;

VIC1_VA2R = (unsigned int)UART_vIsr;

VIC1_VA2R = (unsigned int)I2C_vIsr;

As you see I'm not a friend of complex interrupt handlers, like the STM library.

I'm also wouldn't agree with some of describted solutions. I fear that the problem in the hardware interrupt handler was only covered not fixed!

Best regards,

Jens