cancel
Showing results for 
Search instead for 
Did you mean: 

software interrupt

swiggers9
Associate II
Posted on June 26, 2006 at 16:30

software interrupt

3 REPLIES 3
swiggers9
Associate II
Posted on June 20, 2006 at 10:33

Hi,

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

Regards

Sander

swiggers9
Associate II
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
Associate II
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