2006-06-26 07:30 AM
2006-06-20 01:33 AM
Hi,
Is there any example code for configuring and handling of software interrupts?? Regards Sander2006-06-20 08:05 PM
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 }2006-06-25 11:48 PM
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