LPC4078 UART0 discarding 0xD carriage return

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4078 UART0 discarding 0xD carriage return

1,155 Views
ryan1019
Contributor I

I am sending in a string of text 'HelloWorld\r" with 0xD character to UART0 and outputting the same text to UART2 ,but when I probe the UART2 TX line with my logic analyzer, the data is missing the 0xD (Carriage Return) character. I've verified that on UART0 RX line that I can see the 0xD character, so why is it missing on the TX of UART2. My program is NOT using any interrupt..just simple polling and as soon as a character is detected on UART0 it is output to UART2 right away.

Labels (2)
0 Kudos
Reply
3 Replies

947 Views
Dezheng_Tang
NXP Employee
NXP Employee

Is the TX FIFO empty? Check the FIFO status.

0 Kudos
Reply

947 Views
ryan1019
Contributor I

I have this at the input UART

if(LPC_UART2->LSR & 0x01) { // Receive Data Ready
SData[i++]=LPC_UART2->RBR;
}

and this at the output UART

while (!(LPC_UART2->LSR & 0x20)); // TX ready
LPC_UART2->THR = ch;
return (ch);

Notice that the data is missing the CR and LF which I have sent in.

pastedImage_7.png

0 Kudos
Reply

947 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hello Ryan,

Have you tried using the UART example that comes with the LPCOpen package to see if the same behavior is present?

LPCOpen Software for LPC40XX|NXP 

Hope it helps.

Regards,

Carlos Mendoza

0 Kudos
Reply