[104582] in Cypherpunks

home help back first fref pref prev next nref lref last post

Re: need to read serial data at non-standard rate (2700 baud)

daemon@ATHENA.MIT.EDU (Andreas Bogk)
Fri Oct 23 13:48:31 1998

Date: Fri, 23 Oct 1998 18:47:11 +0200
From: Andreas Bogk <ich@andreas.org>
To: Steven Cooper <scoop@insight.cas.mcmaster.ca>, coderpunks@toad.com
In-Reply-To: <199810231617.MAA13245@insight.cas.mcmaster.ca>; from Steven Cooper on Fri, Oct 23, 1998 at 12:17:09PM -0400
Reply-To: Andreas Bogk <ich@andreas.org>

On Fri, Oct 23, 1998 at 12:17:09PM -0400, Steven Cooper wrote:
> Does anybody on this list know enough about standard PC UARTs to know
> how to set an appropriate divide-by constant to achieve the desired bit rate?

PC UARTs generate the baud rate by dividing 115200 by an integer value.
So the closest you can get to 2700 is 115200/43 = 2679. This is an error
of less than 1%, so it should work.

If you are using Linux, use the setserial command to set a custom divisor
of 43. If you enable a custom divisor, it is used instead of the default one
when you select a baud rate of 38400.

So, do

$ setserial /dev/ttyS0 spd_cust divisor 43

and then select a baud rate of 38400 in your application.

On other OSes, you're probably on your own.

Andreas

-- 
Gwydion Dylan Development -> http://www.randomhacks.com/dylan
"We're fully buzzword-compliant."


home help back first fref pref prev next nref lref last post