If I try to use uart1 to read/write from hyperterminal with JTAG connected, it works. Now I'm trying to use uart0 as I/O, I got error "JTAG communication failue", here is my code: /////////////////////////////////// #include <LPC213X.H>
void delay(int);
int main() { unsigned long temp; unsigned char a;
PINSEL0 = 0x5;
U0LCR = 0x83; U0DLL = 0x61; U0DLM = 0x00; U0LCR = 0x03;
while(1) { while (!(U0LSR & 0x01)); a = U0RBR; delay(10); while (!(U0LSR & 0x20)); U0THR = a; } }
void delay(int x) { unsigned int i,j; for(i=0;i<x;i++) for(j=0;j<113;j++); } ////////////////////////////////////// Any help will be appreciated! Thanks.