baud rate calculation

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

formatting link

Reply to
patilrohit103
Loading thread data ...

this 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.
Reply to
Andy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.