# LPC2148 baud rate equation

I'm little confused about the baud rate calculating equation of LPC2148

In data sheet equation is

But in every tutorial I could find

equation is

Second equation sets the baud rate as required.

Am I missing something?

Tutorials that I checked

• I have no experience with LPC2148, but equations are same if U0 stand for oversampling which is usually 16 (or 8 with faster baud rates). – Rokta Oct 11 '18 at 6:53
• @Rokta Here U0 stands for UART0, U0DLL & U0DLM are device latch registers of UART0 – Athul Oct 11 '18 at 6:56

The only thing that makes sense is that the equation in the datasheet has an error.

That same datasheet says:

The U0DLL and U0DLM registers together form a 16 bit divisor where U0DLL contains the lower 8 bits of the divisor and U0DLM contains the higher 8 bits of the divisor

That suggests it should be 256*DLM+DLL as written in tutorials. In example tables below, it's also treated as 16-bits altogether (upper 8 + lower 8).

Note that April 2012 version of datasheet [1] contains the corrected equation.

• I gave DLM = 1, DLL = 97, MULVAL = 14 & DIVADDVAL = 1, If equation was the one with 16 in denominator, Calculated baud rate would be 7743, and Equation with 256 in denominator would give 2478. I checked the value in Keil debugger, and the answer is 2478. So equation with 256 is the right one. – Athul Oct 12 '18 at 19:15
• Can you tell me how you got the denominator as 256 by the info of U0DLL & U0DLM – Athul Oct 12 '18 at 19:17
• Upper 8 bits means 1<<8 or 2**8, which is 256. – domen Oct 14 '18 at 9:03