UART LPCOpen code

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

UART LPCOpen code

1,732 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nicolasdarmadja on Sun Apr 05 04:15:23 MST 2015
Hi guys,

I am trying to run the UART example code of LPC54100 and none of them seems to be working?
I have done all the steps mentioned in the readme.txt file.
The code always gets stuck in the UART_Send function.
Any ideas?
Labels (1)
0 Kudos
Reply
4 Replies

1,141 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nicolasdarmadja on Mon Apr 20 00:00:16 MST 2015
Hi nerd_herd,

In my project I would need to setup two UARTs with two different baud rates. I managed to configure the UART1 correctly based on your suggestion. However, if i set different baud rate for UART1, the baud rate for UART0 is somehow affected, and I would get garbage values when receiving the data of UART0 on my serial terminal monitor. Any way around this?

Any help is appreciated.

Thanks.
0 Kudos
Reply

1,141 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Mon Apr 06 07:59:16 MST 2015
Hi nicolasdarmadja,

I was able to replicate what you are experiencing. You changed all the right variables and values to enable UART1 in the main source file but ultimately can not use UART1 still. The reason why is because the peripheral clock for UART is never enabled in the main source file. The reason why it works for UART0 is because UART0 is considered the default "debug UART" that is initialized in Board_Init(). To fix this, simply place the following line of code after Board_Init() in your main() and it should now work!

Chip_Clock_EnablePeriphClock(SYSCON_CLOCK_USART1);
0 Kudos
Reply

1,141 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nicolasdarmadja on Mon Apr 06 05:54:04 MST 2015
Hi nerd_herd

I am using LPCxpresso with the latest LPCOpen version for LPC5410x packages. I am using om13077 board from NXP. It was the rom_uart_int example. I was trying to modify the sample code from using UART0 to UART1 instead. I have enabled the interrupt using the NVIC_EnableIRQ(UART1_IRQn) function and set up the corresponding pin muxing for UART1.
The code was stuck because no UART1 interrupt is actually generated, and hence the UART transfer is never completed. Attached is the modified code.

Thank you.
0 Kudos
Reply

1,141 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Sun Apr 05 18:48:00 MST 2015
Hi nicolasdarmadja,

Can we get some more information to help you debug? What IDE are you using? Are you using a custom board or the LPCXpresso evaluation board? Are you running the LPC54102 LPCOpen UART example as-is with no modifications?
0 Kudos
Reply