Dear All,
I have a problem with baud 9600 rate.
This is configuration that I found in many samples
U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit*/ U1DLL = 3; /* for 12MHz PCLK Clock 115200 */ U1FDR = 0x67; /* Fractional Divider */ U1LCR = 0x03; /* DLAB = 0 */
but I want to change the baud rate with 9600
U1DLL for 9600 = 12 000 000 / 16 * 9600 = 194 or C2
how U1FDR ?
If you write this code I not see nothing char on serial
U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit*/ U1DLL = C2; /* for 12MHz PCLK Clock 9600 */ U1FDR = 0x67; /* Fractional Divider */ U1LCR = 0x03; /* DLAB = 0 */
Thanks in advance
Michele
You should look at the LPC2300 User Manual.
Using fractional divider requires more complex equations to get the desired baudrate but the baudrate is more accurate. There is no need to use the fractional divider in your case since the baudrate is low.
When PCLK for UART is 12MHz and the desired baudrate is 9600 without using the fractional divider (U1FDR = 0) then you can calculate the divider as:
DL = 12 000 000 / (16 * 9600) = 78.125
U1DLL = 78, U1DLM = 0, U1FDR = 0
The actual baudrate is
BR = 12 000 000 / (16 * 78) = 9615 (0.16% error)