Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ns-mx!umaxc.weeg.uiowa.edu!williams From: williams@umaxc.weeg.uiowa.edu (Kent Williams) Newsgroups: comp.sys.ibm.pc.hardware Subject: Re: How to set serial port to 115k baud? Message-ID: <3815@ns-mx.uiowa.edu> Date: 7 Jan 91 19:34:13 GMT References: <1991Jan5.034731.15478@d.cs.okstate.edu> <1839@gold.gvg.tek.com> Sender: news@ns-mx.uiowa.edu Reply-To: williams@umaxc.weeg.uiowa.edu.UUCP (Kent Williams) Organization: U of Iowa, Iowa City, IA Lines: 49 In article <1839@gold.gvg.tek.com> grege@gold.gvg.tek.com (Greg Ebert) writes: > > ong@d.cs.okstate.edu (ONG ENG TENG) writes: >#Any one know how to set a serial port to 115k baud? I know how to >#set it up to 9600 baud and do i/o. But I have seen some software >#use it at 115k. How do you do it? Please also provide any >#general serial port hints you have (that is not found in >#Norton's PC Programmer book). ># > >My 16450 data sheet says you can't do it. The AT runs the 16450 with a >1.8432Mhz clock, which is 16x 115Kbaud. Thus, the divisor in the 16450 >is 1 (unity). But, the sheet says : > > S T U F F D E L E T E D > >If you want to play with it anyway, set the divisor to 1. Because you are You can't run asynchronous communications with a divide by 1. The reason (which EE types all seem to know, but only tell software people after they bang their heads on the problem for a while) is that Async chips work by sampling the input stream at clock edges to find the start bit. Since there will be some drift between the clocks on two communicating systems, this sampling process has a window in which to operate, which is usually 1/2 a bit width at the current transfer rate. The idea is that you see a bit state two clock edges in a row, you know what it is. If you do a divide by one clock, then you only get the bit value right a certain regrettably low percentage of the time, since the sample frequency is the same as data frequency. It's the old A to D rule: sample at twice the maximum frequency to get an accurate sample. The effect I saw when I used a divide by one clock is that it garbled bytes about 1% of the time, which makes it worthless for any kind of reliable transmission. > >What, pray tell, are you talking to at this speed ? > Lots of things. Usually you go synchronous, though, in which case you wouldn't bother with a 16450; you'd use a Zilog SIO. I've heard of 115K baud fast-wire transfers, but I think they do that with bit-banging and timing loops. -- Kent Williams --- williams@umaxc.weeg.uiowa.edu "'Is this heaven?' --- 'No, this is Iowa'" - from the movie "Field of Dreams" "This isn't heaven, ... this is Cleveland" - Harry Allard, in "The Stupids Die"