hi, I am new to implementing interrupts and arm 7 as well. I have just tried one example after reading the manual as well as some post. I have few questions about the register values. 1)How do we get the value of VICVectCntl?I read the document but it's not clear.Please can someone explain me.. VICVectCntl1 = 0x20 | 7;
2)My code ehoes the character i enter on serial port uart1 but after the character it keeps on echoing 00 eg: 06 00 00.. and i see when i debug that it executes putchar_uart1() indefinately and does not echoes any othe character i type after the first one. Please any suggestions would help me
//main.c #include <stdio.h> #include <RTL.h> #include <LPC214x.H> int main(void) { init_serial1(); printf("testing \n"); while(1); } //end of main //serial.c void init_serial1 (void) { PINSEL0 = 0x00050000; U1LCR = 0x83; U1DLL = 8; //115200 baudrate U1LCR = 0x03; /* set up the interrupts */ U1IER = 0x05; // VICVectAddr1 = (unsigned long) u1_interrupt; /* set interrupt vector */ VICVectCntl1 = 0x20 | 7; VICIntEnable = 0x00000080; /* enable uart1 interrupts */ } void u1_interrupt (void) { char intrpt; intrpt = U1RBR; putchar_uart1( intrpt ); U1IER = 0x00; VICVectAddr = 0; /* acknowledge interrupt */ }//end u1_interrupt() int putchar_uart1(int ch) { while (!(U1LSR & 0x20)); return (U1THR = ch); }
Hello ss dd,
com_putchr() and com_get_char() are called via fputc() and fgetc() using retargetting. Please see file Retarget.c.
Best Regards, Martin Guenther
hi,
My Rx interrupt is working fine but not the thre interrupt.Please can u give me a small but complete example of how thre interrupts work