cancel
Showing results for 
Search instead for 
Did you mean: 

External Interrupts

sjackson
Associate II
Posted on October 31, 2008 at 12:21

External Interrupts

2 REPLIES 2
sjackson
Associate II
Posted on May 17, 2011 at 09:56

I may have found the problem. There was a bug in my copy of 91x_wiu.c.

Changed:

WIU->CTRL &= WIU_Enable ;

to

WIU->CTRL &= ~WIU_Enable ;

sjackson
Associate II
Posted on May 17, 2011 at 09:56

I'm trying to set up an external interrupt in my application. As far as I can tell, I need to set this up via the WIU peripheral, even though I don't really want it to wake the processor; just provide an interrupt when the pin state changes.

I've set it up as follows:

Code:

WIU_InitTypeDef WIU_InitStruct;

WIU_StructInit(&WIU_InitStruct);

WIU_InitStruct.WIU_TriggerEdge = WIU_FallingEdge;

WIU_InitStruct.WIU_Line = WIU_Line22;

WIU_Init(&WIU_InitStruct);

WIU_Cmd(ENABLE);

SCU_WakeUpLineConfig(22);

VIC_ITCmd(EXTIT2_ITLine, DISABLE);

VIC_Config(EXTIT2_ITLine, VIC_IRQ, 15);

This works for setting up the ISR. However, I need to disable this interrupt (and only this interrupt) occasionally. I have tried doing this as follows:

Code:

VIC_ITCmd(EXTIT2_ITLine,DISABLE);WIU_Cmd(DISABLE);

// Do stuff

VIC_ITCmd(EXTIT2_ITLine,ENABLE);WIU_Cmd(ENABLE);

However the ISR still gets called in the middle of the ''do stuff'' section. Within the ISR I clear the interrupt flags with

Code:

WIU_ClearITPendingBit(22);

WIU_ClearITPendingBit(WIU_Line22);

What am I doing wrong? How do I temporarily disable the EXTIT and/or WIU interrupts?

Thanks in advance.