AnsweredAssumed Answered

LPC4330 UART0_RX not operating

Question asked by daliborzanca on Jul 7, 2016

Hi,

I have NGX LPC-4330-Xplorer board;
pins U0_TXD (9), U0_RXD (10) and GND (1) are interconnected to FTDI cable C232HD pins RXD,TXD,GND.
I tried to debug project "periph_uart_rb" from package lpcopen_2_12_lpcxpresso_ngx_xplorer_4330.zip
On start it prints initial text:

 

LPC18xx/43xx UART example using ring buffers
Press a key to echo it back or ESC to quit

 

but when I press any key there is no echo, no reaction at all.
I think it should repeat the char pressed and LED should toggle.
I measured the FTDI cable and there is 115200 Bd 1Start+8Data+1Stop bit on its TX output pin as expected.

 

Also tried project "periph_uart", no reaction to pressed key, only prints some text.

 

Then I created my project, based on LPCOpen, and tested if the pin used for UART0_RX is functional;

when reconfigured it to Function_0 (be GPIO) I was polling this GPIO & incremented when zero,

the counter risen on each char sent from terminal => pin is functional.

 

UART is initialized:

  Chip_UART_Init(LPC_UART);

  Chip_UART_SetBaud(LPC_UART, 115200);

  Chip_UART_ConfigData(LPC_UART, UART_LCR_WLEN8 | UART_LCR_SBS_1BIT); /* Default 8-N-1 */

  Chip_UART_TXEnable(LPC_UART);

 

for printing I successfully use function:

Chip_UART_SendBlocking(LPC_UART, mystr, 7);     // mystr[] filled with 7 characters before..

 

for reception I tried construction:

a = Chip_UART_Read(LPC_UART, recbuf, 64);     // try to read, maximally 64 bytes

but it always returns 0

 

tried also reading my way:

// try polling of UART0 / LSR.RDR

ula = *((unsigned long *)0x40081014); // UART0_LSR

if (ula & 0x0001) // b0 = RDR (RX Data Ready)

       data = *((unsigned long *)0x40081000); // UART0_RBR

 

but the bit RDR is never set

 

tried to print content of UART0 registers after initializetion (before the endless loop),

UART0_IER:  0x00000000

UART0_IIR:  0x000000C1

UART0_LCR:  0x00000003

UART0_LSR:  0x00000000

UART0_ACR:  0x00000000

UART0_OSR:  0x000000F0

UART0_HDEN: 0x00000000

UART0_SYNC: 0x00000000

UART0_TER:  0x00000001

UART0_THR:  0x00000000

 

The only thing I found interesting is that register IIR / bits_7,6 are HH => FIFO is enabled.

Not sure why (does it LPCOpen) and if it affects the way how RX module works,

could this be the reason why bit RDR (DataReceived) is never set when a char comes ?

Am I to use different procedure for reception, based on anything else that waiting for RDR==1 and reading RBR ?

 

Could anybody show any example code with UART0 that really works on NGX LPC-4330-Xplorer board ?

Any idea what could be wrong or what to try ?

Other registers that affect UART functionality, MUXes, clocks ?.. (but TX works ok)

 

Any ideas welcome.

Original Attachment has been moved to: dal_test1.c.zip

Outcomes