Skip to main content
swiggers9
Associate III
June 26, 2006
Question

software interrupt

  • June 26, 2006
  • 3 replies
  • 915 views
Posted on June 26, 2006 at 16:30

software interrupt

This topic has been closed for replies.

3 replies

swiggers9
swiggers9Author
Associate III
June 20, 2006
Posted on June 20, 2006 at 10:33

Hi,

Is there any example code for configuring and handling of software interrupts??

Regards

Sander

swiggers9
swiggers9Author
Associate III
June 21, 2006
Posted on June 21, 2006 at 05:05

Hi,

I'm working in the Keil uVision3 IDE with the Keil CARM compiler.

I want to create a delayed software interrupt (with the lowest priority) after a given number of adc samples. In my test application I was also toggling some IO pins on port 2. While debugging it seemed that there was constantly an interrupt pending on the XTI (P2.8 --- P2.11).

Am I forgetting something or can I avoid this?

here is my code.

Code:

int main(void)

{

...

...

config_interrupts(DISABLE);

config_irq_channel_priority(IRQ_CHANNEL_XTI, IRQ_PRIORITY_XTI);

config_irq_channel(IRQ_CHANNEL_XTI, ENABLE);

XTI->CTRL |= 0x02;

config_interrupts(ENABLE);

...

...

}

void adc_isr(void)__arm

{

...

if(sample_cnt == 30)

{

// activate delayed interrupt

XTI->SR |= 0x01;

}

...

}

void xti_isr(void) __arm

{

XTI->PRH = 0x00;

XTI->PRL = 0x00;

XTI->SR = 0;

//handle adc samples

}

swiggers9
swiggers9Author
Associate III
June 26, 2006
Posted on June 26, 2006 at 08:48

Can you tell me what the effect of __swi(8) is?? aint this function being handled as any other function?

I want my software interrupt to be handled after all other pending interrupts with higher priority (like ADC, uart and timers) by setting a flag. But my code it doesn't seem to work and I can't find any examples of handling swi from the XTI.

Regards,

Sander