UART have a feature called IDLE line detection and we are going to use this to sole the problem mentioned above. Idle line is detected on RX line when there is no received byte for more than 1 byte time length.
We continuously check for incoming data and when data is received, display it on the lcd.
2.) Use interrupt. Microcontroller does it’s normal operations, and whenever the data receiving completes, an interrupt is generated and ISR is executed, after completing ISR, control returns back to normal operation.