I do write a simple code to test UART0 of LPC4078 on our original board, but it does not work...
Codes for initialize UART0 are shown below:
void Uart0Init(void)
{
UART_CFG_Type UARTConfigStruct;
UART_FIFO_CFG_Type UARTFIFOConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
UARTConfigStruct.Baud_rate = 115200;
UART_Init(UART_0, &UARTConfigStruct);
UART_FIFOConfigStructInit(&UARTFIFOConfigStruct);
UART_FIFOConfig(UART_0, &UARTFIFOConfigStruct);
UART_TxCmd(UART_0, ENABLE);
UART_IntConfig(UART_0, UART_INTCFG_RBR, ENABLE);
NVIC_SetPriority(UART0_IRQn, ((0x02<<3)|0x01));
NVIC_EnableIRQ(UART0_IRQn);
}
And the port 0.2 and 0.3 are set by codes below:
PINSEL_ConfigPin(0, 2, 1);
PINSEL_ConfigPin(0, 3, 1);
Based on the initialize code shown above, I tried to send some characters via ring buffer, but any characters sent to terminal.
I added "UART_SendByte(UART_0, 'A'); to simplify the debug work, but the result was same.
I believe "UART_SendByte" is very simple command and should be work, so there must be an error in my setup/initialization code...
The connection diagram of my debug environment are
PC USB
MCUXpresso ----- LPC-Link2 --------------- 4078board
Serial |
Tera Term ----- USB-Serial Converter ---------|
I did run the sample code "periph_uart_rb" and it was work, so I believe the hardware itself is correct.
Regards,