LPC4078 UART0 discarding 0xD carriage return

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC4078 UART0 discarding 0xD carriage return

1,153 次查看
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.

标签 (2)
0 项奖励
回复
3 回复数

945 次查看
Dezheng_Tang
NXP Employee
NXP Employee

Is the TX FIFO empty? Check the FIFO status.

0 项奖励
回复

945 次查看
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 项奖励
回复

945 次查看
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 项奖励
回复