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

New Message Reply About this list Date view Thread view Subject view Author view

Ben Laurie (ben@algroup.co.uk)
Fri, 23 Oct 1998 21:01:00 +0100


Andreas Bogk wrote:
>
> 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.

Some, and I thought that included Linux, let you set the baud rate, then
work out the divisor for themselves.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/


New Message Reply About this list Date view Thread view Subject view Author view

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

The following archive was created by hippie-mail 7.98617-22 on Sat Apr 10 1999 - 01:15:22