hi,
i try to receive data through UART1 in Interrupt mode, when i run the code the following are the changes occured on reception of the character.
before
U1LSR=0x60 U1IIR/FCR=0xC1 VICVectAddr=0x00000130 VICIRQStatus=0x00000000 VICIntEnable=0x00000080
after
U1LSR=0x61 U1IIR/FCR=0xC4 VICVectAddr=0x00000144 VICIRQStatus=0x00000080 VICIntEnable=0x00000080
but the coding written in the U1ISR is not invoked. here is my code
#include <stdio.h> /* prototype declarations for I/O functions */ #include <lpc21xx.h> /* LPC21xx definitions */ void U1ISR(void) __irq; //Declare UART1 IRQ ISR int data,clear,dummy; long int data1; void DefISR(void)__irq { VICVectAddr=0; /* Acknowledge Interrupt*/ } int main (void) { PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */ IO1DIR = 0x00FF0000; /* P1.16..23 defined as Outputs */ IO1CLR= 0x00FF0000; /* turn off LEDs */ U1IER = 0; /* Disable UART1 Interrupts */ U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ U1DLL = 97; /* 9600 Baud Rate @ 12MHz VPB Clock */ U1LCR = 0x03; /* DLAB = 0 */ U1FCR = 0x07; /*Enables and Resets FIFO, 1 byte */ dummy = U1IIR; /* Read IrqID - Required to Get Interrupts Started */ U1IER = 0x01; /*Enable the RDA interrupt*/ VICVectAddr7 = (unsigned long)U1ISR; //Set UART1 ISR Vector Address VICVectCntl7 = 0x20 | 7; //Enable Slot, Set Channel 7 VICIntEnable = 0x80; //Enable Int UART1 VICIntSelect =0xFFFF7F; VICDefVectAddr = (unsigned long)DefISR; // un-assigned VIC interrupts while (1) { ; } //END OF WHILE LOOP } // END OF MAIN LOOP void U1ISR(void)__irq //UART1 ISR { data1=VICIRQStatus; clear=U1LSR; //UART Line Status Register data = U1RBR; // UART Receiver Buffer Register data<<=16; IO1CLR=0x00FF0000; IO1SET=data; /*Displaying the DATA on GPIO1 */ VICVectAddr = 0; /* Acknowledge Interrupt */ return; }
please indicate the problem in my code