Re: Setting baud rate for PC16550D
From: Leon. (noemail_at_noemail.noemail.com)
Date: Thu, 18 Dec 2003 15:32:37 +1100
"Manoj" <email@example.com> wrote in message
> I have a custom ISA card with PC16550D chip.It clock is 4.9152Mhz.
> For configuring this card i call,register_serial().
> I am passing baud base = 307200(4.9152Mhz/16) in the input structure
> to register serial.
> My problem is while change the baudrate using minicom/stty ,if i set
> the baud rate above 38400, the cat /proc/tty/driver/serial output
> shows a different value.
> ie for 57600 ,it shows 61440
> for 115200, it shows 153600
> for 230400, it shows 307200
> why it is so?
because 'speeds' are actually programmed as "dividers" and dividers have to
be integer, starting from 1.
when the divider is an integer, 1, 2, 3, 4,5
The highest speed is dividor =1. You have already agreed that is 307200
The 2nd highest speed is divider =2, 153600
There is an algorithm is choose the best divider for the speed you want.
but the terminal program tells you the actual speed, to tell you how bad it
is at getting that speed.
You can change the clock chip to get speeds.
The clock for speed S has to be S * 16 * N, N being integer.