Uart basic using LPC43xx_uart

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

Uart basic using LPC43xx_uart

1,165 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by L.simon on Wed Apr 02 02:06:23 MST 2014
hello to all,


I am trying to set up a uart communication for debugging purposes and this is what i found so far
I just want to use the basic settings for transmitting from the device



UART_CFG_Type UART_InitStruct;

void UartAction (void)
{
UART_ConfigStructInit(&UART_InitStruct);
UART_Init(LPC_UART1, &UART_InitStruct);

// Enable UART Transmit
UART_TxCmd(LPC_UART1, ENABLE);

//enabling interrupt flags
        UART_IntConfig( LPC_UART1, UART_INTCFG_THRE, ENABLE);
volatile unsigned long ul;
char msg[40] = {'a', 'b'};
for(;;)
{
UART_TxCmd(LPC_UART1, ENABLE);
//UART_Send(LPC_UART1, (uint8_t *)msg , strlen(msg), BLOCKING); //strlen :Length of Transmit buffer Checking Blocking.
UART_SendByte(LPC_UART1, 0x61);
//UART_Send(LPC_UART1, (uint8_t *)msg , strlen(msg), NONE_BLOCKING); //strlen :Length of Transmit buffer Checking Blocking.
for( ul = 0; ul < mainDELAY_LOOP_COUNT2; ul++ );//basic wait loop

}
}

i tried sending blocking and none_blocking and just sending a byte but nothing seems to work,
if i debug it seems the data does get put on the THR register (transmit hold register).

am i forgetting something?

Thank you for your time,
greetings
Simon
Labels (1)
0 Kudos
3 Replies

1,117 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by L.simon on Fri Apr 04 06:55:12 MST 2014
Just in case someone had the same problem:

It seems i had to initialize the clocks for the Uart to be able to automatically find the frequency
with thissimple function everything works perfectly:
CGU_Init();

This also solved my problem with the bootloader LPC_DFUsec.
The freeRtos environment has problems with the bootloader if the clocks aren't initialised.
0 Kudos

1,117 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by L.simon on Thu Apr 03 06:00:08 MST 2014
Thank you, that will be very usefull in the future!

It seemed i had a problem with the clock, i didn't asign one manually hoping it would automatically find the right clock frequency.

After some debuging it seemed to be 3*96MHz (= 288MHZ).
It is now fully operational.

thanks again,

Greetings
Simon
0 Kudos

1,117 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by embd02161991 on Wed Apr 02 11:42:33 MST 2014
Hi Simon,

Please refer to the UART examples for LPC43xx.

http://www.lpcware.com/content/nxpfile/lpc4350apdlzip

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

Thanks,

NXP Technical Support
0 Kudos