Hi Prasanna Naik,
Let's analysis the API Chip_UART_ConfigData function at first:

From the user manual, we can know the details about the LCR register:

So, please check your setParityBit and setStopBits, just take this PARTITY_EVEN as an example, you write it like this:

Please consider it, if you call this code after you have called the Chip_UART_Init:
void Chip_UART_Init(LPC_USART_T *pUART)
{
volatile uint32_t tmp;
Chip_Clock_EnableOpts(UART_PClock[Chip_UART_GetIndex(pUART)], true, true, 1);
Chip_UART_SetupFIFOS(pUART, (UART_FCR_FIFO_EN | UART_FCR_RX_RS | UART_FCR_TX_RS));
Chip_UART_TXDisable(pUART);
pUART->IER = 0;
pUART->LCR = 0;
pUART->ACR = 0;
pUART->RS485CTRL = 0;
pUART->RS485DLY = 0;
pUART->RS485ADRMATCH = 0;
if (pUART == LPC_UART1) {
pUART->MCR = 0;
tmp = pUART->MSR;
}
Chip_UART_ConfigData(pUART, (UART_LCR_WLEN8 | UART_LCR_SBS_1BIT | UART_LCR_PARITY_DIS));
pUART->FDR = 0x10;
}
What will happen?
You will just set UART_LCR_PARITY_EN and UART_LCR_PARITY_EVEN, the WLS will be retrun back to 0X0, it is 5 bit character length, and others all will be back to 0.
So, I think if you want to configure the according bit, you can configure the LCR directly, just clear that according bit, and set it again, don't influence the other LCR bits.
Take example, after you called Chip_UART_Init function, then you want to set the Parity and Even, then you call this code:
LPC_UART->LCR &= ~(UART_LCR_PARITY_EN |UART_LCR_PARITY_F_0); // clean according bits
LPC_UART->LCR |= (UART_LCR_PARITY_EN | UART_LCR_PARITY_EVEN);// enable parity and conifigure Even Parity.
The stop is the same, when you want to configure the SBS, you can clear LCR register bit 2 at first, then use "|" to configure it.
Just make sure you won't influence other bits in the LCR.
About the flow, you can configure it after Chip_UART_Init function.
Wish it helps you!
Please try it on your side.
If you still have question about it, please kindly let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------