I am having a problem calculating the baud rate of 9600 bauds for ARM7 (LPC2148) at 12MHZ crystal. I have figured out a value of : U1DLM=0x00; U1DLL=0x62; following is my UART1 initialization code: void init_UART1() { PINSEL0=0x00050000; // FOR UART1 U1LCR=0x83; U1DLM=0x00; U1DLL=0x62; U1LCR=0x03; U1FCR=0x01; } please help me if there is any other solution..... --------------------------------------- Posted through http://www.EmbeddedRelated.com
baud rate calculation
Started by ●March 1, 2011
Reply by ●March 1, 20112011-03-01
On Mar 1, 12:24=A0pm, "patilrohit103" <patilrohit103@n_o_s_p_a_m.rediffmail.com> wrote:> I am having a problem calculating the baud rate of 9600 bauds for ARM7 > (LPC2148) at 12MHZ crystal. I have figured out a value of : > =A0 =A0 =A0 =A0U1DLM=3D0x00; > =A0 =A0 =A0 =A0U1DLL=3D0x62; > > following is my UART1 initialization code: > > void init_UART1() > { > > =A0PINSEL0=3D0x00050000; // FOR UART1 > > =A0U1LCR=3D0x83; > =A0U1DLM=3D0x00; > =A0U1DLL=3D0x62; > =A0U1LCR=3D0x03; > =A0U1FCR=3D0x01; > > } > > please help me if there is any other solution..... > > --------------------------------------- =A0 =A0 =A0 =A0 > Posted throughhttp://www.EmbeddedRelated.comthis looks like a standard 16550, which needs a divisor to give you 16x the desired baud rate. 9600 x 16 =3D 153600. 12e6 / 153600 =3D 78.125, implies 0x4e would be the divisor. Note that async serial can usually tolerate some baud rate deviation as the receiver should resync on the start bit of every character.