Re: Query on UART baud rate calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, usually it is calculated based on the clock frequency which is
feeding to the UART controller.

eg:

                                         Ref Freq
                 Baudrate =   ---------------------------
                                              (UBMR+1)
                                      16*   ----------------
                                               (UMIR+1)

Here Ref Freq is the frequency which is coming out from the UART
controller after frequency division.

eg: Suppose your feeding the 100MHz clock to UART controller again
UART controller has the divider to further divide the frequency based
on your Baudrate...................It is simply writing to the UART
controller registers.

                            There fore i devide my frequency  = 100Mhz
/ 6 ( divider) = 16.6Mhz to achieve 115200 baudrate.

According to above formula.........you have to write the value (
program ) the UBMR & UBIR registers to get your baud.


UBMR = UART BMR ( Binary Rate Multiplier ) Modulator register.
UBIR  =  UART BMR Incremental registers.

 eg:
           Reference Frequency = 19.44 MHz
           UBIR = 0x000F
           UBMR = 0x0014

           For desired  Baud Rate = 925.7 kbit/s


I hope you understand the above logic.....

On Thu, May 28, 2009 at 9:45 AM, Sriram Bhetanabottla
<bsriramprasad@xxxxxxxxx> wrote:
>
> Hi,
>
> This is Sriram Bhetanabottla trying to understand the UART driver ( for educational purposes)  and I could not clearly get how the M,N, and D registers are used in computing the baud rate and how to fine tune these registers for the desired baud rate values.
>
> Is there any good documentation or any source where I can get this clarified? I was searching in google and I came across the article http://www.linuxjournal.com/article/6331 " "The Serial Driver Layer" you wrote on the UART linux device driver and thought you might give me some pointers.
>
> I do apologize if this mail has caused any inconvenience to you and any information on these lines would be very much helpful.
>
> Thanks a lot in advance
> Sriram



--
Regards,
Murali N

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux