home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / modem / mdm400.zip / SFXURT.TXT < prev   
Text File  |  1993-08-18  |  17KB  |  345 lines

  1.  
  2.                           Intel Corportation
  3.                 Personal Computer Enhancements Division
  4.  
  5. May 5, 1992
  6.  
  7. SatisFaxtion 200 & 400 Smart UARTs Overview
  8.  
  9.     The purpose of this paper is to explain the performance and
  10. reliability improvements obtained in multitasking environments like
  11. Windows using the serial port facades inside the SatisFaxtion 200 &
  12. 400 rather than an external modem connected to a PC serial port, or
  13. an internal modem that has a conventional UART configured as a PC
  14. serial port.
  15.  
  16. What is data overrun anyway?
  17.  
  18.     Before getting too deep into how the Smart UART works, let's
  19. review some of the problems encountered using a high speed modem on
  20. a PC serial port.  Many of today's high speed modems implement
  21. error control protocols such as V.42 and MNP that transparently
  22. remove all data errors caused by impairments on the telephone line.
  23. The PC serial port it is connected to only sees the corrected
  24. error-free data.
  25.  
  26.      A communication application (e.g., PROCOMM, etc.) typically
  27. uses a routine called by serial port hardware interrupts to collect
  28. received data in a buffer for when it gets busy doing other things
  29. which take a long time -- for example writing received data to
  30. disk.  As this buffer gets close to filling, flow control is used
  31. to tell the modem to stop sending data to the PC serial port.  Flow
  32. control prevents the PC communication application character buffer
  33. from spilling over and losing good data because it is known in
  34. advance that the buffer is getting full.  The local modem being
  35. held with flow control stalls the remote modem off by sending
  36. special V.42 or MNP messages that tell it to wait for a while.
  37.  
  38.      But now we are using 386 PCs with virtualized, preemptive
  39. multitasking environments like Windows that can distract the PC's
  40. processor for extended periods with no prior warning to the
  41. communication application.  If the modem is not being held off with
  42. flow control and the PC's processor gets distracted for more than 1
  43. character time (or up to 16 characters for a 16550A FIFO UART),
  44. data gets lost at the PC's serial port UART.  Although flow control
  45. does a good job of preventing the communication application's
  46. buffer from overflowing and losing data, it cannot provide the same
  47. service for the UART's tiny buffer.  If characters are lost like
  48. this during a file transfer (Zmodem, etc.), that damaged block must
  49. be sent again as if bad data was coming out of a modem that had no
  50. error control.  If it happens while scrolling your Email, the lost
  51. characters will be missing from the text your are reading (e.g.,
  52. $1000 may appear as $100).
  53.  
  54.     Confused?  Consider this silly analogy.  Let's say that you
  55. have a 10 gallon bucket of water that you want to get filled to
  56. wash the car, but some creep stole your garden hose, and the faucet
  57. is located right over an extremely fragile plant with shallow
  58. roots.  Cleverly, you run into the house and get 2 coffee cups.  As
  59. one cup is filling from the faucet, you are emptying the other into
  60. the bucket that is a foot or two away.  All you have to do to
  61. prevent spilling water is to get that freshly emptied cup
  62. underneath the filling cup before it spills over -- no sweat!  At
  63. about the 2 gallon mark, a bee lands on your nose, and you're
  64. suddenly not so concerned about how quickly you get that empty cup
  65. back under the faucet.  Eventually, the bee decides you're a pretty
  66. raunchy smelling flower, and buzzes off.  You then look over to
  67. just in time to see your shallow rooted plant floating down the
  68. gutter drain!!
  69.  
  70.      So then, think of the receiving modem as the faucet, the PC's
  71. UART as the two cups, and you are the PC's processor -- get it?
  72.  
  73. What the Smart UART does for you
  74.  
  75.     Both the SatisFaxtion 200 & 400 fax modems have a large gate
  76. array device which in addition to other functions, provides special 
  77. circuitry that appears to the PC processor as a standard 16450 
  78. compatible serial port.  In reality, it's just a facade that looks 
  79. just like a serial port.  Instead of shifting the character bits 
  80. serially in from and out to a modem on the far end of an RS-232 cable, 
  81. the characters stay intact as bytes.  These characters are transferred 
  82. directly between the PC processor and the SatisFaxtion 200 & 400 
  83. 80C186-16 on-board processor through the silicon.  The special circuitry
  84. inside the device gives the 80C186-16 complete visibility and control
  85. of the 16450 facade internal workings.  The 80C186-16 knows what
  86. the PC processor is doing on the other side of this facade, and
  87. more importantly, has direct control over what the PC processor
  88. sees.
  89.  
  90.     On SatisFaxtion 200 & 400, since the on-board 80C186-16 knows
  91. whether or not the PC processor has taken the last character that
  92. it deposited into the 16450 interface, it will NEVER try
  93. to put another character in until the previous one is read -- no
  94. data is spilled.  Think of it as a really smart faucet that shuts
  95. off the water if you don't replace the cup in time.  This is true
  96. no matter how fast the data is being moved or how busy the PC
  97. processor is.  The on-board 80C186-16 will wait indefinitely until
  98. the PC processor has taken the last character before trying to give
  99. it a new one.
  100.  
  101.     This protection against data loss enables you to set your
  102. communication application baud rate (DTE rate) as high as you like
  103. with no fear of losing data.
  104.  
  105. UART Rate simulation
  106.  
  107.     The serial port UARTs found on PCs (8250, 16450, etc.) transfer
  108. characters to/from the PC's processor at a rate proportional to the
  109. baud rate set by the communication application software.  For
  110. example, with a setting of 9600 bits per second, a character is
  111. exchanged between the PC processor and the UART at the rate of (10
  112. bits/char) / (9600 bits/sec) = .00104 sec/char.
  113.  
  114.     Unlike a real UART, the SatisFaxtion 200 & 400 could choose to
  115. ignore whatever baud rate the user had selected, transferring data
  116. between the 80C186-16 the PC's processor at the equivalent of
  117. almost 300K bits/sec.  However, by default it intentionally runs
  118. slower than that for the following reasons:
  119.  
  120. Compatibility
  121.  
  122.         During the development of the SatisFaxtion 200, At least one
  123. application (Prodigy) expects data transfers with the UART to occur
  124. at a certain rate, and develops timing problems if the actual
  125. transfer rate is significantly different from the expected rate.
  126.  
  127. Multitasking
  128.  
  129.     When running a file transfer in the background under Windows on
  130. a relatively slow machine (e.g., 16 MHz SX), an unbridled character
  131. interrupt rate may tax the user's machine so heavily that it
  132. completely consumes all of that machine's processor, essentially
  133. shutting down all other windows for brief periods.  This is
  134. particularly true of DOS communication applications running in a
  135. window.  The user may choose to select a lower rate such that they
  136. can be working on something else in another window without periods
  137. of time that make the application seem sluggish or in a hung state.
  138.  
  139. Human factors
  140.  
  141.     Error correcting protocols like V.42 and MNP free up data to
  142. the host PC in blocks rather than one character at a time.  With
  143. SatisFaxtion 200 & 400 running open throttle, text flashes out to
  144. the screen in chunks rather than flowing out in streams like the
  145. lower settings on real UARTs.  This can be a real annoyance in
  146. terms of visual stress, and can also make it really hard to pause
  147. the screen where you want.
  148.  
  149.     The actual rate that is simulated by the SatisFaxtion 400 is
  150. configurable using the AT"B=n command, where the decimal value n
  151. causes the following:
  152.  
  153. n=0 (default) The SatisFaxtion 400 runs the Smart UART 1.05
  154.     times faster than a real UART for a given setting.
  155.  
  156. n=1 The SatisFaxtion 400 runs the Smart UART 2.1 times faster
  157.     than a real UART for a given setting.
  158.  
  159. n=2 The SatisFaxtion 400 runs the Smart UART 4.2 times faster
  160.     than a real UART for a given setting.
  161.  
  162. n=3 (best) The SatisFaxtion 400 runs the Smart UART at full
  163.     80C186-16 processor bandwidth, and also minimizes the
  164.     burden per character for the 80C186-16.  This is nearly the
  165.     equivalent of a 300K bit/sec UART.  Also note that if the
  166.     PC communications software sets the baud rate at 115,200
  167.     bits/sec, the Smart UART also run at full processor
  168.     bandwidth, ignoring any AT"B setting.
  169.  
  170.    The default speed configuration runs at about the same speed as
  171. an actual UART to provide the smoothest and most compatible
  172. environment which will work well for all PC's.  The other settings
  173. are used to obtain higher performance on faster PCs which are not
  174. running timing sensitive communication applications.  The AT"B=3
  175. setting provides the best performance not only because of the high
  176. transfer rate involved, but also removes overhead to the 80C186-16
  177. caused by internal rate simulation routines.  Note that the
  178. SatisFaxtion 200 is fixed at the 4:1 setting with no AT"B command
  179. provision, since there are fewer compatibility issues with a 2400
  180. bit/sec modem.
  181.  
  182. What are some uses of the AT"B command settings?
  183.  
  184.     Modems with V.42bis data compression can utilize a PC serial
  185. port rate at least 4 times that of the raw modem speed to prevent
  186. the uncompressed data from becoming bottlenecked at the PC's serial
  187. port.  Thus to run a V.32bis (14,400 bits/sec) modem such as the
  188. SatisFaxtion 400, a serial port rate of at least 57,600 bits/sec is
  189. desirable.  At times, streams of data are encountered which are
  190. highly compressible and would require a serial port rate much
  191. faster than 4 times the modulation rate to prevent bottlenecks.
  192. With an AT"B=3 setting, the SatisFaxtion 400 can outdistance most
  193. regular modems when the PC communication software doesn't support
  194. faster bit rates.
  195.  
  196.     An example of this is Windows 3.0, where the serial port
  197. drivers do not allow UART settings above 19.2K bits/sec.  Microsoft
  198. chose this limit because operation above 19.2K even on the fastest
  199. machine of that era was believed to be a risky venture with a
  200. 16450.
  201.  
  202.     The new Windows version 3.1 comm drivers allow operation at up
  203. to 57.6 K bits/sec for Windows comm apps, and have also added
  204. 16550A support to lessen overrun problems.  Unfortunately, Windows
  205. comm apps developed prior to Windows version 3.1 don't know how to
  206. ask Windows for the higher rates, so users would ordinarily have to
  207. wait for a Win3.1 update to their comm app.  By using AT"B settings
  208. 1-3, the customer does not have to wait for an update to obtain
  209. outstanding performance with a V.32bis + V.42bis connection.
  210.  
  211.     Before leaving the topic of Windows, there are some nasty
  212. problems that need to be discussed pertaining to Windows 3.0 and
  213. Windows 3.1 communications drivers running in enhanced mode on
  214. slower machines.  These problems even affect operation with the
  215. SatisFaxtion 400, and have nothing to do with loss of characters or
  216. data overrun.  At faster character rates, the 32 bit protected mode
  217. (RING0) drivers inside the Windows WIN386.EXE kernel become
  218. unstable and crash.  The result is a GENERAL PROTECTION FAULT which
  219. sometimes hangs the machine, but most often causes the PC to
  220. cold-boot as if the power switch had been cycled.  Hopefully by
  221. working with Microsoft we'll be able to get them to address this in
  222. their next driver release, but until then AT"B=0 or AT"B=1 are the
  223. recommended settings for operation under Windows enhanced mode.
  224. Note that standard mode operation of Windows does not exhibit this
  225. problem.
  226.  
  227.  
  228. UARTs with FIFOs (16550A, etc.)
  229.  
  230.     So you may also ask, what do the FIFOs in a 16550A do for you?
  231. The 16550A receiver FIFO is a buffer which can hold up to 16
  232. characters before losing any data.  The 16550A has a programmable
  233. receiver trigger which can be configured to request service as soon
  234. as a single character arrives, allowing the host PC's processor to
  235. be distracted for up to 16 more character times without overrunning
  236. the FIFO and losing data.  This can work very well for systems that
  237. occasionally have very long latency problems, but are otherwise not
  238. heavily affected by the overhead caused by having to service the
  239. UART once per each character.
  240.  
  241.     The receiver trigger has 3 other settings which configure the
  242. 16550A not to request service from the PC processor until it has
  243. collected up to 4, 8 or 14 characters, resulting in much less
  244. overhead per request (and less latency protection).  This reduction
  245. in overhead can be used either to give more of the PC processor
  246. back to other applications that are running, or can also be used to
  247. handle a higher data rate.  Note that if more than 4 character
  248. times have elapsed since the last character arrival, the 16550A
  249. will generate a request to prevent data from being trapped in a
  250. partially full FIFO.
  251.  
  252.     Getting back to our analogy, it's the same as having bigger
  253. cups.  Since the cups are larger, you are not constantly busy
  254. swapping cups for a given flow rate.  You can use this extra time
  255. between cup swaps to chat with your neighbor, or if you are
  256. ambitious you could open the faucet more to get the bucket filled
  257. faster.  Just make sure you don't get distracted too long as the
  258. water level approaches your chosen full mark.
  259.  
  260.     Ideally, the 16550A receiver trigger should be set to the
  261. largest number of characters that won't cause any characters to be
  262. lost at that baud rate because of PC processor latency.  On slower
  263. SX machines that take longer to task switch, a low trigger point
  264. may be required.  The lower trigger point causes more frequent
  265. requests (overhead) of the PC processor as well, so a lower DTE
  266. rate setting may be the only alternative if the PC processor can't
  267. keep up with the flow rate.
  268.  
  269.     Interestingly enough, in Windows 3.1 Microsoft chose to set the
  270. 16550A receiver trigger at the highest possible setting of 14
  271. characters, favoring low overhead for PCs fast enough to always
  272. respond to requests within 3 character times.  Although this
  273. provides 3 character times of latency protection whereas before in
  274. 16450 mode there was only one, slower 80386SX equipped may lose
  275. characters at a rate where a receiver trigger setting of 8 may have
  276. provided adequate latency protection and efficiency to operate
  277. error free.
  278.  
  279.     You may be wondering which is better for running under Windows
  280. -- a 16550A that reduces burden, or the SatisFaxtion 200 & 400
  281. Smart UART interface?  The answer is really both!  At a given baud rate,
  282. the 16550A when set to a 14 character receiver trigger will generate
  283. less overhead for the PC Processor.  On the other hand, no matter what 
  284. nasty transient things you may do in Windows that affect latency, the 
  285. Smart UART is never going to drop a character on you.
  286.  
  287. Glossary:
  288.  
  289.  
  290. COM Port
  291.  
  292.     A logical device name used with DOS that references a serial
  293. port in the IBM compatible PC.  COM device names (COM1, COM2, etc.)
  294. are normally assigned in sequence by the order in which they are
  295. discovered by the PC's ROM BIOS when the machine is booted.  These
  296. names are often incorrectly used to indicate the physical IO
  297. address at which a serial port if configured.  See also Serial Port
  298.  
  299. 8250
  300. 16450
  301.  
  302.     These are UART devices developed by National Semiconductor
  303. Inc., which are commonly used in IBM PC compatible computers.  They
  304. each have the ability to buffer only one character for both receive
  305. and transmit.  See also definition of UART below.
  306.  
  307. 16550A
  308.  
  309.     This is a UART device developed by National Semiconductor Inc.
  310. that contains two 16 byte FIFOs, one for receive and one for
  311. transmit.  The receive FIFO reduces the likelihood of losing
  312. received characters caused the hosting microprocessor's inability
  313. to remove the prior character in time, and also reduces the hosting
  314. microprocessor's overhead by collecting more than one character
  315. before interrupting it.  The transmit FIFO reduces the overhead
  316. caused by interrupting the processor each time a character is sent.
  317. It was originally developed for the IBM PS/2 line of personal
  318. computers, but has recently been growing rapidly into ISA and EISA
  319. bus applications as well since the appearance of high speed modems
  320. and laptop serial file transfer packages.
  321.  
  322. FIFO
  323.  
  324.     First In, First Out.  This is a memory or storage area that
  325. preserves the order of data, queuing the data up until the
  326. recipient is able to remove it.
  327. Latency
  328.  
  329.     The delay from when a piece of data or service is requested
  330. until the time it is actually delivered or removed.
  331. Serial Port
  332.  
  333.     The combination of a UART and an external connector (usually
  334. DB-9 or DB-25) which is used to operate devices such as modems,
  335. serial printers, and mice.
  336.  
  337. UART
  338.  
  339.     Universal Asynchronous Receiver/Transmitter.  The purpose of
  340. this device is to break down entire characters into a single bit
  341. serialized stream that is sampled by the remote end at known
  342. intervals and re-assembled into characters.  By using only a single
  343. wire in each direction to carry the information, substantial
  344. savings are realized in cabling and connector costs.
  345.