Xref: utzoo comp.sys.ibm.pc:35831 comp.arch:11673 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!munnari.oz.au!csc!ccadfa!usage!basser!metro!bunyip!mincom!hitech!clyde From: clyde@hitech.ht.oz (Clyde Smith-Stubbs) Newsgroups: comp.sys.ibm.pc,comp.arch Subject: Re: programming the com port Message-ID: <409@hitech.ht.oz> Date: 5 Oct 89 01:46:40 GMT References: <446@usage.csd.unsw.oz> Followup-To: comp.sys.ibm.pc Organization: HI-TECH Software, Brisbane, QLD, Australia Lines: 49 From article <446@usage.csd.unsw.oz>, by troy@mr_plod.cbme.unsw.oz (Troy Rollo): > From article <927@eutrc3.urc.tue.nl>, by wsdwgk@eutrc3.urc.tue.nl (g.v.kooij): > wsdwgk> Hello > > wsdwgk> I want to program the 8250 in a PC clone to communicate with a MIDI device, > wsdwgk> which uses the standard MIDI baudrate of 31250 baud. Unfortunately, my docs > wsdwgk> say that you can only program it for 9600 (and slower), 19200 and 38400. > wsdwgk> Is it possible to do what I want ? Or should I buy additional hardware ?? > > The clock rate for the UART is 1.8432 MHz, implying that the value for the > divisor should be 589, or 2 (high), 77 (low). I have a sneaking suspicion that > this needs to be divided by 16... or perhaps even multiplied by 16..... try > all of those and see. Nope, 1.8432Mhz divided by 31250 is 59, not 589. And therein lies a problem. The actual division value you program in has to be Clock rate/baud rate/16 and 1843200 Hz/31250 bps/16 gives us a value of 3.686. There is no way to program fractional division ratios. That is why 38400 baud can be programmed but not 31250. 38400 requires a division ratio of 3, which is an integer. That is actually why the crystal frequency was chosen. To program 31250 you will need to change the crystal. You could use clock rate = baud rate*16*N where N is any integer (i.e. the division ratio you will end up with) So keeping it close to the original, clock rate = 31250 * 16 * 3 = 1.5Mhz In other words, change the crystal to 1.5MHz and program the baud rate division to 3 and you will get 31250 baud. Maybe this where 31250 came from? It obviously can be generated from clock rates which are fairly rounded numbers. ------------------------ Clyde Smith-Stubbs HI-TECH Software, P.O. Box 103, ALDERLEY, QLD, 4051, AUSTRALIA. ACSnet: clyde@hitech.ht.oz INTERNET: clyde@hitech.ht.oz.au PHONE: +61 7 300 5011 UUCP: uunet!hitech.ht.oz.au!clyde FAX: +61 7 300 5246 -- Clyde Smith-Stubbs HI-TECH Software, P.O. Box 103, ALDERLEY, QLD, 4051, AUSTRALIA. INTERNET: clyde@hitech.ht.oz.au PHONE: +61 7 300 5011 UUCP: uunet!hitech.ht.oz.au!clyde FAX: +61 7 300 5246