hai i am doing basic programs in lpc2138 ARM controller problem is exter nal interrupt is only once generates but again it is not generate.send me what is the problem.this is my code
//*****************************************************
#include<lpc213x.h> #include <stdio.h>
extern void init_serial(void); unsigned char temp; void EXTINTVectoredIRQ (void)__irq;
void EXTINTVectoredIRQ (void)__irq { unsigned int temp; IOCLR1=0XFFFFFFFF; EXTINT=0X00000020; temp = VICIRQStatus; printf("isr_temp=%x\n",temp); VICVectAddr15=0; }
int main() { init_serial(); //printf("temp\n"); IODIR1=0X00FF0000; IODIR0=0X20000000; PINSEL1=0X00000000; PINSEL0=0X200000C5; //interrupt pin p0.14 EXTMODE = 0; // LEVEL sensitive mode on EINT1 EXTPOLAR = 0; VICDefVectAddr = 0x0000002f; VICIntSelect |=0x00000000; VICVectAddr15 |=(unsigned int)EXTINTVectoredIRQ; VICVectCntl15 |= 0x0000002f; VICIntEnable |=0x00008000; PINSEL0=0X20000005; temp = VICIRQStatus; printf("temp=%x\n",temp); while(1) { IO1CLR =0X00FF0000; IOSET1 =0x00FF0000;
} }
//*******************************************
http://www.keil.com/forum/docs/thread16116.asp
1) Please post code correctly formatted as code. Clearly described just above the message input textbox.
2) Avoid using printf() inside interrupt handlers. They are expected to be very quick - unless you are using a design where all interrupts nests, and this is the lowest-priority interrupt.
3) I'm not sure if you can acknowledge the interrupt by writing VICVectAddr15=0; The traditional way to acknowledge the interrupt is to write to VICVectAddr.
hello sir this is my code this code is enters ISR only once please help me.
#include<lpc213x.h> #include <stdio.h> extern void init_serial(void); unsigned char temp; void EXTINTVectoredIRQ (void)__irq; unsigned int x=0; void EXTINTVectoredIRQ (void)__irq { x++; x=x<<16; IO1SET=x; EXTINT=0X00000020; VICVectAddr15=0x0000002f; } int main() { IODIR1=0X00FF0000; IODIR0=0X20000000; PINSEL1=0X00000000; PINSEL0=0X200000C5; //interrupt pin p0.14 EXTMODE = 0; // LEVEL sensitive mode on EINT1 EXTPOLAR = 0; VICDefVectAddr = 0x0000002f; VICIntSelect |=0x00000000; VICVectAddr15 |=(unsigned int)EXTINTVectoredIRQ; VICVectCntl15 |= 0x0000002f; VICIntEnable |=0x00008000; while(1) { IO1CLR =0X000000ff; IOSET1 =0x000000ff; } }