How do I set the UART baud rate?
For an 'N/16' UART (example: UART0 on the C8051F12x), the minimum clock divisor for baud rate generation is 16.
The UART baud rate is determined by the overflow rate of the selected timer. Depending on the device, the available timers for baud rate generation my vary. The UART baud rate will be equal to the selected timer overflow rate divided by 16 when the 'SMODn' bit for the UART is equal to '1'. If 'SMODn' for the UART is equal to '0', the UART baud rate will be equal to the selected timer overflow rate divided by 32.
For example, to configure the UART for a baud rate of 9600 bps using Timer 2 as the baud rate source, you could configure the overflow rate of Timer 2 to equal 9600 * 16 = 153.6 kHz, and set 'SMODn' to '1'.