Here is a code segment to initialize the UART0 peripheral. It uses Timer 1 to generate the baud rate at 57,600 using the 8-bit auto reload mode. The reload value is stored in TH1, and that value is also used to initialize the timer register itself so that the first count sequence is the correct length. The CKCON register sets the clock source for the timer to be the system clock at 24.500000Hz and the SCON register enables the receiver and sets the UART mode to 8-bit.