LPC4078 UART0 discarding 0xD carriage return

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC4078 UART0 discarding 0xD carriage return

1,100件の閲覧回数
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 返答(返信)

892件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

Is the TX FIFO empty? Check the FIFO status.

0 件の賞賛
返信

892件の閲覧回数
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 件の賞賛
返信

892件の閲覧回数
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 件の賞賛
返信