Issue with recieve on UART

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

Issue with recieve on UART

581 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SodaAnt on Fri Aug 15 20:20:21 MST 2014
So I've finally gotten the transmit side of one of the UARTS working, but for some reason I can never get the UART to receive anything. I've tried two different USB to UART adapters, and even connecting the TX and RX pins directly on the board, however I still get absolutely no data, and the interrupt is never triggered.

Here's the code I'm using:

void UART_INIT(void)
{
LPC_CGU->BASE_UART0_CLK |= 0x9 << 24;
LPC_CCU2->CLK_APB0_USART0_CFG |= 0x1;
LPC_USART0->LCR |= (1 << 7 | 3);// Set USART0 word length to 8-bit
LPC_USART0->DLL = 36;
LPC_USART0->DLM |= 0;// Eq 6 in manual
LPC_USART0->LCR &= ~(1 << 7);
LPC_USART0->FDR |= (13 << 4 | 7);
LPC_USART0->FCR |= 1;
LPC_USART0->IER |= 1;
NVIC_SetPriority(USART0_IRQn, 13);
NVIC_EnableIRQ(USART0_IRQn);
}


Any idea what's going wrong?
Labels (1)
0 Kudos
Reply
2 Replies

547 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Sun Aug 17 17:42:00 MST 2014
Hello,

I would first start off by ruling out the hardware as the culprit by setting the RX pin as a GPIO input and see if you can read from the pin correctly. If that test passes, I would check to make sure there is a signal for the MCU to receive on the UART RX pin. Do you have an oscilloscope or logic analyzer to check that there is a signal?

Aside from this, we have a software platform called LPCOpen which contains several peripheral drivers and software examples, including UART. If you're interested on checking out UART code from LPCOpen, you can download them here:

http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages
0 Kudos
Reply

547 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Sun Aug 17 01:49:20 MST 2014
Just an idea: Have a look into the GPIO block. When I remember correctly, there was a bit which enables input on a GPIO.
This bit was not available in earlier controllers. Something like EZI or so...
(Around page 385 of user manual)
0 Kudos
Reply