https://embetronicx.com/tutorials/microcontrollers/pic16f877a/pic16f877a-serial-communication-tutorial/
PIC16F877A - USART Tutorial