 | Discussion Forum |  |
|
|
Issue with LPC2378 IRQ interruptsNext Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Chetan RP Posted 20-Jan-2010 06:33 GMT Toolset ARM |  Issue with LPC2378 IRQ interrupts Chetan RP Hi there, I have 2 IRQ related ISR's in the program shown below. ISR's 1 and 2 do the task of making an LED (connected to P2.0 and P2.7) on and off. Iam seeing that when ISR1 is in execution(which is invoked by pressing a switch connected to P2.10 meant as external interrupt 0) and if ISR2 is invoked(which is invoked by pressing a switch connected to P2.11 meant as external interrupt 1) during that time, after completion of ISR1, the control branches to ISR2. Could anyone please suggest a method to prevent this.
#include <LPC23xx.H>
void wait(void){
unsigned int i,j;
for(i=0;i<=100;i++)
for(j=0;j<=60000;j++);
}
/* External ISR 1 */
__irq void eint0_handler (void) {
FIO2PIN = 0x00000001;
wait();
FIO2PIN = 0x00000000;
EXTINT = 0x00000001;
VICVectAddr = 0;
}
/* External ISR 2 */
__irq void eint1_handler (void) {
FIO2PIN = 0x00000080;
wait();
FIO2PIN = 0x00000000;
EXTINT = 0x00000002;
VICVectAddr = 0;
}
/* Initialize External Interrupts EINT 0/1 */
void init_eint (void) {
EXTMODE = 0x00000003; // Edge sensitive mode
EXTPOLAR = 0x00000000; // Active low, Falling edge
VICIntSelect = 0x00000000;
VICVectAddr14 = (unsigned long) eint0_handler;
VICVectAddr15 = (unsigned long) eint1_handler;
VICVectPriority14 = 0;
VICVectPriority15 = 1;
VICIntEnable = 0x0000C000;
}
int main (void) {
PINSEL4 = 0x00500000;
FIO2DIR = 0x000000FF;
FIO2PIN = 0x00000000;
init_eint(); // Enable EINT0/1
while (1){
;
}
}
| | Read-Only Author Tamir Michael Posted 20-Jan-2010 07:34 GMT Toolset ARM |  RE: Issue with LPC2378 IRQ interrupts Tamir Michael Could anyone please suggest a method to prevent this. prevent what? this sounds like normal program execution to be. I don't think you can affect the status of raw interrupts in the VIC. you might want to consider adding some logic to your program that is based on time difference or something similar. | | Read-Only Author Chetan RP Posted 21-Jan-2010 05:05 GMT Toolset ARM |  RE: Issue with LPC2378 IRQ interrupts Chetan RP I mean is there a way from preventing the execution of ISR2 directly after the completion of execution of ISR1. FYI, interrupts are asynchronous. | | Read-Only Author Chris Burrows Posted 21-Jan-2010 05:51 GMT Toolset ARM |  RE: Issue with LPC2378 IRQ interrupts Chris Burrows The question has now been answered: http://tech.groups.yahoo.com/group/lpc2000/message/47044 | | Read-Only Author Tamir Michael Posted 21-Jan-2010 07:49 GMT Toolset ARM |  RE: Issue with LPC2378 IRQ interrupts Tamir Michael thanks for reminding me that interrupts are asynchronous. regarding your issue - are you using edge or level sensitive interrupts? I don't think you can pull off that trick of writing a "1" into EXTINT if it is level sensitive. | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|