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.
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.
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