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