home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / SERIALPT.ZIP / SERIAL.PT2 < prev    next >
Internet Message Format  |  1994-03-06  |  46KB

  1. Path: nlbbs!jaxsat!pagesat.net!news.cerf.net!ihnp4.ucsd.edu!swrinde!gatech!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!news.dfn.de!news.coli.uni-sb.de!chris
  2. From: chris@pfsparc02.phil15.uni-sb.de (Chris Blum)
  3. Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.hardware.comm
  4. Subject: The Serial Port, rel. 12, part 2/3
  5. Message-ID: <2l3c0u$jdg@coli-gate.coli.uni-sb.de>
  6. Date: 3 Mar 1994 00:46:22 GMT
  7. Organization: Institut fuer nutzlose Forschung und angewandte Energieverschwendung
  8. Lines: 1091
  9. NNTP-Posting-Host: pfsparc02.phil15.uni-sb.de
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12.  
  13. [... continued ...]
  14.  
  15.  
  16. Registers
  17. =========
  18.  
  19. First some tables; full descriptions follow. Base addresses as specified by
  20. IBM.
  21.  
  22.  
  23. COM1 COM2 COM3 COM4 Offs. DLAB  Register
  24. ------------------------------------------------------------------------------
  25. 3F8h 2F8h 3E8h 2E8h  +0     0   RBR  Receive Buffer Register (read only) or
  26.                                 THR  Transmitter Holding Register (write only)
  27. 3F9h 2F9h 3E9h 2E9h  +1     0   IER  Interrupt Enable Register
  28. 3F8h 2F8h 3E8h 2E8h  +0     1   DL   Divisor Latch (LSB)  These registers can
  29. 3F9h 2F9h 3E9h 2E9h  +1     1   DL   Divisor Latch (MSB)  be accessed as word
  30. 3FAh 2FAh 3EAh 2EAh  +2     x   IIR  Interrupt Identification Register (r/o) or
  31.                                 FCR  FIFO Control Register (w/o, 16550+ only)
  32. 3FBh 2FBh 3EBh 2EBh  +3     x   LCR  Line Control Register
  33. 3FCh 2FCh 3ECh 2ECh  +4     x   MCR  Modem Control Register
  34. 3FDh 2FDh 3EDh 2EDh  +5     x   LSR  Line Status Register
  35. 3FEh 2FEh 3EEh 2EEh  +6     x   MSR  Modem Status Register
  36. 3FFh 2FFh 3EFh 2EFh  +7     x   SCR  Scratch Register (16450+ and some 8250s,
  37.                                      special use with some boards)
  38.  
  39.  
  40.            80h      40h      20h      10h      08h      04h      02h      01h
  41. Register  Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0
  42. -------------------------------------------------------------------------------
  43. IER         0        0        0        0      EDSSI    ELSI     ETBEI    ERBFI
  44. IIR (r/o) FIFO en  FIFO en    0        0      IID2     IID1     IID0    pending
  45. FCR (w/o)  - RX trigger -     0        0      DMA sel  XFres    RFres   enable
  46. LCR       DLAB     SBR    stick par  even sel Par en  stopbits  - word length -
  47. MCR         0        0        0      Loop     OUT2     OUT1     RTS     DTR
  48. LSR       FIFOerr  TEMT     THRE     Break    FE       PE       OE      RBF
  49. MSR       DCD      RI       DSR      CTS      DDCD     TERI     DDSR    DCTS
  50.  
  51. EDSSI:       Enable Delta Status Signals Interrupt
  52. ELSI:        Enable Line Status Interrupt
  53. ETBEI:       Enable Transmitter Buffer Empty Interrupt
  54. ERBFI:       Enable Receiver Buffer Full Interrupt
  55. FIFO en:     FIFO enable
  56. IID#:        Interrupt IDentification
  57. pending:     an interrupt is pending if '0'
  58. RX trigger:  RX FIFO trigger level select
  59. DMA sel:     DMA mode select
  60. XFres:       Transmitter FIFO reset
  61. RFres:       Receiver FIFO reset
  62. DLAB:        Divisor Latch Access Bit
  63. SBR:         Set BReak
  64. stick par:   Stick Parity select
  65. even sel:    Even Parity select
  66. stopbits:    Stop bit select
  67. word length: Word length select
  68. FIFOerr:     At least one error is pending in the RX FIFO chain
  69. TEMT:        Transmitter Empty (last word has been sent)
  70. THRE:        Transmitter Holding Register Empty (new data can be written to THR)
  71. Break:       Broken line detected
  72. FE:          Framing Error
  73. PE:          Parity Error
  74. OE:          Overrun Error
  75. RBF:         Receiver Buffer Full (Data Available)
  76. DCD:         Data Carrier Detect
  77. RI:          Ring Indicator
  78. DSR:         Data Set Ready
  79. CTS:         Clear To Send
  80. DDCD:        Delta Data Carrier Detect
  81. TERI:        Trailing Edge Ring Indicator
  82. DDSR:        Delta Data Set Ready
  83. DCTS:        Delta Clear To Send
  84.  
  85.  
  86.  
  87. RBR (Receive Buffer Register)                       3F8h 2F8h 3E8h 2E8h +0 r/o
  88. ------------------------------------------------------------------------------
  89.  
  90. This is where you get received characters from. This register is read-only.
  91.  
  92.  
  93.  
  94. THR (Transmitter Holding Register)                  3F8h 2F8h 3E8h 2E8h +0 w/o
  95. ------------------------------------------------------------------------------
  96.  
  97. Send characters by writing them to this register. It is write-only.
  98.  
  99.  
  100.  
  101. IER (Interrupt Enable Register)                     3F9h 2F9h 3E9h 2E9h +1 r/w
  102. ------------------------------------------------------------------------------
  103.  
  104. Enable several interrupts by setting these bits:
  105.    Bit 0:   If set, DR (Data Ready) interrupt is enabled. It is generated
  106.             if data waits to be read by the CPU.
  107.    Bit 1:   If set, THRE (THR Empty) interrupt is enabled. This interrupt
  108.             tells the CPU to write characters to the THR.
  109.    Bit 2:   If set, Status interrupt is enabled. It informs the CPU of
  110.             occurred transmission errors during reception.
  111.    Bit 3:   If set, Modem status interrupt is enabled. It is triggered
  112.             whenever one of the delta-bits is set (see MSR).
  113. Bits 4-7 are not used and should be set 0.
  114.  
  115.  
  116.  
  117. DL (Divisor Latch)                                  3F8h 2F8h 3E8h 2E8h +0 r/w
  118. ------------------------------------------------------------------------------
  119.  
  120. To access this *WORD*, set DLAB in the LCR to 1. Then write a word (16 bits)
  121. to this register or write the lower byte to base+0 and the higher byte to
  122. base+1 (the order is not important) to program the bps rate as follows:
  123.  
  124.      xtal frequency in Hz / 16 / desired rate = divisor
  125.      xtal frequency in Hz / 16 / divisor      = obtained rate
  126.  
  127. Your PC uses an xtal frequency of 1.8432 MHz (that's 1843200 Hz :-).
  128.  
  129. Do *NOT* use 0 as a divisor (your maths teacher told you so)! It results in
  130. a rate of about 3500 bps, but it is not guaranteed to work with all chips in
  131. the same way.
  132.  
  133. An error of up to 3-5 percent is irrelevant.
  134.  
  135. Some values (1.8432 MHz quartz, as in the PC):
  136.  
  137.      bps rate    Divisor (hex)   Divisor (dec)   Percent Error
  138.          50          900             2304            0.0%
  139.          75          600             1536            0.0%
  140.         110          417             1047            0.026%
  141.         134.5        359              857            0.058%
  142.         150          300              768            0.0%
  143.         300          180              384            0.0%
  144.         600           C0              192            0.0%
  145.        1200           60               96            0.0%
  146.        1800           40               64            0.0%
  147.        2000           3A               58            0.69%
  148.        2400           30               48            0.0%
  149.        3600           20               32            0.0%
  150.        4800           18               24            0.0%
  151.        7200           10               16            0.0%
  152.        9600            C               12            0.0%
  153.       19200            6                6            0.0%
  154.       38400            3                3            0.0%
  155.       57600            2                2            0.0%
  156.      115200            1                1            0.0%
  157.  
  158. The 16450 is capable of up to 512 kbps according to NS.
  159.  
  160. NS specifies that the 16550A is capable of 256 kbps if you use a 4 MHz
  161. or an 8 MHz crystal. But a staff member of NS Germany (I know that this
  162. abbreviation is not well-chosen :-( ) told one of my friends on the phone
  163. that it runs correctly at 512 kbps as well; I don't know if the 1488/1489
  164. manage this, though. This is true for the 16C552, too.
  165.  
  166. BTW: Ever tried 1.76 bps? Kindergarten kids write faster.
  167.  
  168. The Microsoft mouse uses 1200 bps, 7n1, the Mouse Systems mouse uses 1200
  169. bps, 8n1. See the Mouse chapter for details.
  170.  
  171.  
  172.  
  173. IIR (Interrupt Identification Register)            3FAh 2FAh 3EAh 2EAh  +2 r/o
  174. ------------------------------------------------------------------------------
  175.  
  176. This register allows you to detect the cause of an interrupt. Only one
  177. interrupt is reported at a time; they are priorized. If an interrupt occurs,
  178. Bit 0 tells you if the UART has triggered it. Follow the information in this
  179. register, then test bit 0 again. If it is still not set, there is another
  180. interrupt to be serviced. BTW: If you AND the value of this register with
  181. 06h, you get a pointer to a table of four words... ideal for near calls.
  182. Another hint: make sure your software reads this register just once and then
  183. follows the information it got before it is read again, otherwise your code
  184. won't work.
  185.  
  186. The bits 6 and 7 allow you to detect if the FIFOs of the 16550+ have been
  187. activated.
  188.  
  189.  
  190.    Bit 3  Bit 2  Bit 1  Bit 0    Priority   Source    Description
  191.      0      0      0      1                 none      no interrupt pending
  192.      0      1      1      0      highest    Status    OE, PE, FE or BI of the
  193.                                                       LSR set. Serviced by
  194.                                                       reading the LSR.
  195.      0      1      0      0      second     Receiver  DR or trigger level rea-
  196.                                                       ched. Serviced by read-
  197.                                                       ing RBR 'til under level
  198.      1      1      0      0      second     FIFO      No Receiver FIFO action
  199.                                                       since 4 words' time
  200.                                                       (neither in nor out) but
  201.                                                       data in RX-FIFO. Serviced
  202.                                                       by reading RBR.
  203.      0      0      1      0      third      Transm.   THRE. Serviced by read-
  204.                                                       ing IIR (if source of
  205.                                                       int only!!) or writing
  206.                                                       to THR.
  207.      0      0      0      0      lowest     Modem     One of the delta flags
  208.                                                       in the MSR set. Serviced
  209.                                                       by reading MSR.
  210.    Bit 6 & 7: 16550A: set if FCR bit 0 set.
  211.               16550:  bit 7 set, bit 6 cleared if FCR bit 0 set.
  212.    others: clear.
  213.  
  214. In most software applications bits 3, 6 & 7 should be masked when servicing
  215. the interrupt since they are not relevant. These bits cause trouble with
  216. old software relying on that they are cleared...
  217.  
  218. NOTE! Even if some of these interrupts are disabled, the service routine
  219. can be confronted with *all* states shown above when the IIR is loop-polled
  220. until bit 0 is set (don't ask me why; it's just that I encontered this, and
  221. it's not much more work to play it safe). Check examples in the Programming
  222. section.
  223.  
  224.  
  225.  
  226. FCR (FIFO Control Register)                        3FAh 2FAh 3EAh 2EAh  +2 w/o
  227. ------------------------------------------------------------------------------
  228.  
  229. This register allows you to control the FIFOs of the 16550+. It does not exist
  230. on the 8250/16450.
  231.  
  232.    Bit 0:    FIFO enable.
  233.    Bit 1:    Clear receiver FIFO. This bit is self-clearing.
  234.    Bit 2:    Clear transmitter FIFO. This bit is self-clearing.
  235.    Bit 3:    DMA mode (pins -RXRDY and -TXRDY), see below
  236.    Bits 6-7: Trigger level of the DR-interrupt.
  237.  
  238.    Bit 7  Bit 6    Receiver FIFO trigger level
  239.      0      0          1
  240.      0      1          4
  241.      1      0          8
  242.      1      1         14
  243.  
  244. Note: if bit 0 is cleared, all other bits are ignored.
  245.  
  246. DMA mode operation is not available with your PC, but for the sake of
  247. completeness... here we go.
  248.  
  249. If bit 3 is 0, DMA mode 0 is selected. The -RXRDY pin goes active-low
  250. whenever there is at least one character in the RX FIFO or in the RBR if
  251. the FIFO is disabled. -TXRDY goes active-low when the TX FIFO or the THR
  252. is empty. It goes high if one character is written to the THR (same as THRE,
  253. that's bit 5 of the LSR).
  254.  
  255. If this bit is 1, DMA mode 1 is selected. The -RXRDY pin goes low if
  256. the trigger level of the RX FIFO is reached or if reception timed out
  257. (no characters received for a time that would have allowed to receive 4
  258. characters). -TXRDY goes low when the TX FIFO is empty. It goes high again
  259. if the FIFO is completely full. If the FIFOs are disabled, DMA mode 1 operates
  260. in the same way as DMA mode 0.
  261.  
  262.  
  263.  
  264. LCR (Line Control Register)                        3FBh 2FBh 3EBh 2EBh  +3 r/w
  265. ------------------------------------------------------------------------------
  266.  
  267. This register allows you to select the transmission protocol. It also contains
  268. the DLAB bit which switches the function of the addresses +0 and +1.
  269.  
  270.    Bit 1  Bit 0    word length         Bit 2      Stop bits
  271.      0      0        5 bits              0            1
  272.      0      1        6 bits              1          1.5/2
  273.      1      0        7 bits         (1.5 if word length is 5)
  274.      1      1        8 bits   (1.5 does not work with some chips, see above)
  275.  
  276.    Bit 5  Bit 4  Bit 3     Parity type       Bit 6   SOUT condition
  277.      x      x      0       no parity           0     normal operation
  278.      0      0      1       odd parity          1     forces TxD 'high' (break)
  279.      0      1      1       even parity       Bit 7   DLAB
  280.      1      0      1       mark parity         0     normal registers
  281.      1      1      1       space parity        1     divisor at reg 0, 1
  282.  
  283.   Mark parity: The parity bit is always '1' (the line is 'low').
  284.   Space parity: The parity bit is always '0' (the line is 'high').
  285.  
  286.  
  287.  
  288. MCR (Modem Control Register)                       3FCh 2FCh 3ECh 2ECh  +4 r/w
  289. ------------------------------------------------------------------------------
  290.  
  291. This register allows to program some modem control lines and to switch to
  292. loopback mode.
  293.  
  294.    Bit 0:   Programs -DTR. If set, -DTR is low and the DTR pin of the port
  295.             goes 'high'.
  296.    Bit 1:   Programs -RTS. dito.
  297.    Bit 2:   Programs -OUT1. Normally not used in a PC, but used with some
  298.             multi-port serial adapters to enable or disable a port. Best
  299.             thing is to write a '1' to this bit.
  300.    Bit 3:   Programs -OUT2. If set to 1, interrupts generated by the UART
  301.             are transferred to the ICU (Interrupt Control Unit) while 0
  302.             sets the interrupt output of the card to high impedance.
  303.             (This is PC-only).
  304.    Bit 4:   '1': local loopback. All outputs disabled. This is a means of
  305.             testing the chip: you 'receive' all the data you send.
  306.  
  307.  
  308.  
  309. LSR (Line Status Register)                         3FDh 2FDh 3EDh 2EDh  +5 r/w
  310. ------------------------------------------------------------------------------
  311.  
  312. This register allows error detection and polled-mode operation.
  313.  
  314.    Bit 0    Data Ready (DR). Reset by reading RBR (but only if the RX FIFO is
  315.             empty, 16550+).
  316.    Bit 1    Overrun Error (OE). Reset by reading LSR. Indicates loss of data.
  317.    Bit 2    Parity Error (PE). Indicates transmission error. Reset by LSR.
  318.    Bit 3    Framing Error (FE). Indicates missing stop bit. Reset by LSR.
  319.    Bit 4    Break Indicator (BI). Set if RxD is 'high' for more than 1 word
  320.                ('break'). Reset by reading LSR.
  321.    Bit 5    Transmitter Holding Register Empty (THRE). Indicates that a new
  322.             word can be written to THR. Reset by writing THR. Note that this
  323.             bit works in a weird way when FIFOs are enabled: it goes 0
  324.             whenever there are characters in the TX-FIFO, not when the FIFO
  325.             is full!
  326.    Bit 6    Transmitter Empty (TEMT). Indicates that no transmission is
  327.             running. Reset by reading LSR.
  328.    Bit 7    (16550+ only) Set if at least one character in the RX FIFO has
  329.             been received with an error. Cleared by reading LSR if there is
  330.             no further error in the FIFO. Clear with all other chips.
  331.  
  332.  
  333.  
  334. MSR (Modem Status Register)                        3FEh 2FEh 3EEh 2EEh  +6 r/w
  335. ------------------------------------------------------------------------------
  336.  
  337. This register allows you to check several modem status lines. The delta bits
  338. are set if the corresponding signals have changed state since the last reading
  339. (except for TERI which is only set if -RI changed from active-low to
  340. inactive-high, that is if the RI line at the port changed from 'high' to
  341. 'low' and the phone stopped ringing).
  342.  
  343.    Bit 0:   Delta CTS. Set if CTS has changed state since last reading.
  344.    Bit 1:   Delta DSR. Set if DSR has changed state since last reading.
  345.    Bit 2:   TERI. Set if -RI has changed from low to high (ie. RI at port
  346.             has changed from 'high' to 'low').
  347.    Bit 3:   Delta DCD. Set if DCD has changed state since last reading.
  348.    Bit 4:   CTS. 1 if 'high' at port.
  349.    Bit 5:   DSR. dito.
  350.    Bit 6:   RI. If loopback is selected, it shows the state of OUT1.
  351.    Bit 7:   DCD.
  352.  
  353.  
  354.  
  355. SCR (Scratch Register)                             3FFh 2FFh 3EFh 2EFh  +7 r/w
  356. ------------------------------------------------------------------------------
  357.  
  358. This is an all-purpose 8 bit store. NS recommends to store the value of the
  359. FCR (which is w/o) in this register for further use, but this is not
  360. mandatory and not recommended by me (see below). This register is only
  361. available with the 16450+; the standard 8250 doesn't have a scratch register
  362. (but then again some versions do).
  363.  
  364. On some boards (especially RS422/RS485-boards), this register has a special
  365. meaning (enable receiver/transmitter drivers etc.), and with multi-port
  366. serial adapters it is often used to select the interrupt levels of the
  367. several ports and to determine which port has triggered interrupt. So you
  368. shouldn't use it for anything else in your programs.
  369.  
  370.  
  371.  
  372. Excursion: Why and how to use the FIFOs (by Scott C. Sadow)
  373. -----------------------------------------------------------
  374.  
  375.   Normally when transmitting or receiving, the UART generates one
  376.   interrupt for every character sent or received. For 2400 bps, typically
  377.   this is 240/second. For 115,200 bps, this means 11,520/second. With FIFOs
  378.   enabled, the number of interrupts is greatly reduced.
  379.   
  380.   A transmitter holding register empty interrupt is not generated until the
  381.   FIFO is empty (last byte is being sent).
  382.   
  383. So if you know it's a 16550A and the FIFOs are enabled, your TX interrupt
  384. routine can write up to 16 characters to the THR. Monitoring bit 5 (THRE) of
  385. the LSR is _no_good_ because this bit will be cleared immediately after your
  386. routine has written the first character to the THR! The chip gives you no
  387. feedback at all.
  388.   
  389.   Thus, the number of transmitter interrupts is reduced by a factor of 16.
  390.   For 115,200 bps, this means only 720 interrupts per second. For receive
  391.   data interrupts, the processing is similar to transmitter interrupts. The
  392.   main difference is that the number of bytes in the FIFO (the trigger level)
  393.   can be specified. When the trigger level is reached, a receive data
  394.   interrupt is generated; any other data received is just put in the FIFO.
  395.   The receive data interrupt is not cleared until the number of bytes in the
  396.   FIFO is below the trigger level again.
  397.  
  398.   To add 16550A support to existing code, there are 2 requirements to be met:
  399.  
  400.      1) When reading the IIR to determine the interrupt source, only
  401.         use the lower 3 bits.
  402.  
  403.      2) After the existing UART initialization code, try to enable the
  404.         FIFOs by writing to the FCR. (A value of C7 hex will enable FIFO
  405.         mode, clear both FIFOs, and set the receive trigger level at 14
  406.         bytes). Next, read the IIR. If Bit 6 of the IIR is not set, the
  407.         UART is not a 16550A, so write 0 to the FCR to disable FIFO mode.
  408.  
  409.  
  410. Multi-Port Serial Adapters
  411. --------------------------
  412.  
  413. This is material I received from Mike Surikov.
  414.  
  415.   I want to give you some information on Multi-Serial adapters that
  416.   provide four or eight asynchronous serial communication ports.
  417.  
  418.   Some of them have an Interrupt Vector (one for each four
  419.   channels).  The Interrupt Vector is used to enable/disable
  420.   global interrupt and to detect which of the four channels is
  421.   creating the interrupt (one IRQ is used for a group of four
  422.   channels).  Bit 7 of the Interrupt Vector is used to enable or
  423.   disable ALL four channels by writing a logical 1 to enable or 0
  424.   to disable interrupts.  At the same time, each channel can be
  425.   enabled or disabled separately by programming the OUT2 (and/or
  426.   OUT1) signal in the 16450 chip.
  427.  
  428.   When you read the interrupt vector, you get an indication which
  429.   port has triggered the interrupt, as it is shown below.
  430.  
  431.   [Since this may be different with each board, check your manual for
  432.   details.]
  433.  
  434.   MSB           LSB
  435.   7 6 5 4 3 2 1 0 <-- Interrupt Vector Register
  436.                 Channel 0 interrupt indicator (0-active)
  437.       N/A     Channel 1 interrupt indicator (0-active)
  438.             Channel 2 interrupt indicator (0-active)
  439.           Channel 3 interrupt indicator (0-active)
  440.   Global interrupt: 1-enable; 0-disable
  441.  
  442.   For example, an 8 PORT RS-232 CARD can have the following
  443.   configuration:
  444.      
  445.           Base      IRQ    Channel  Interrupt 
  446.          Address   Level   Number     Vector  
  447.      
  448.            2A0       7        0        2BF    
  449.            2A8       7        1        2BF    
  450.            2B0       7        2        2BF    
  451.            2B8       7        3        2BF    
  452.            1A0       5        0        1BF    
  453.            1A8       5        1        1BF    
  454.            1B0       5        2        1BF    
  455.            1B8       5        3        1BF    
  456.  
  457.   [The base addresses should be set by jumpers or DIP switches.]
  458.  
  459.   Note that the Interrupt Vector Registers overlap Scratch
  460.   Registers, so the detect_UART routine must be changed for these
  461.   boards. [See the Programming Section.]
  462.  
  463.  
  464.  
  465. Some words about timing
  466. -----------------------
  467.  
  468. The 8250 is a rather slow peripheral chip; it has a cycle delay for both
  469. reading and writing of 500nsec, which means that after every read or write
  470. access to any of the chip's registers the CPU has to wait at least 500nsec
  471. before reading or writing a register again. Good thing that this chip is
  472. only used with some old XTs... the 8088/8086/V20/V30 family is slow enough
  473. for that.
  474.  
  475. The 16450 and 16550A are rather fast; they need a delay of 125nsec after
  476. read access and 150nsec after write access before any other transfer.
  477. This means we have a problem with these fancy new machines that allow
  478. cycle times of 50nsec and less. Luckily they add wait states to I/O bus
  479. accesses (wait states are additional cycles during which the bus does
  480. not change its state) or use a slower clock speed for I/O transfers (8 or
  481. 12 MHz). So if you have 12 MHz I/O clock speed and one wait state for I/O
  482. transfers, you don't have to worry.
  483.  
  484. Some people believe in delaying I/O operations by adding NOPs or JMP $+2 to
  485. every I/O instruction (both do nothing but wasting time), but I don't think
  486. that's any good with a chip that needs stable data lines for at least
  487. 100nsec (so the CPU or the bus controller has to add a wait state anyway).
  488. You can always blame the hardware or the setup if your program doesn't work
  489. for timing reasons. :)
  490.  
  491. However, there may be a problem with block instructions, esp. OUTSB. This
  492. instruction allows you to fill the Tx fifo of the 16550A rather fast (just
  493. 5 cycles per transfer on the 286, others take longer), but even a 25MHz 286
  494. takes 200nsec for each transfer, so this should be on the safe side, too.
  495. I don't use this instruction, but for other reasons than timing difficulties.
  496. It's just not very useful: it takes more time to make sure in advance that
  497. you don't overrun your buffer margins during an OUTSB than to check for
  498. the margins after every single transfer.
  499.  
  500. Please note that all this relates to ISA boards. I don't have any experience
  501. with EISA or other fancy things like VLB!
  502.  
  503.  
  504.  
  505. Handshaking
  506. -----------
  507.  
  508. The method of exchanging signals for data flow control between computers
  509. and data sets is called handshaking. The most popular and most often used
  510. handshaking variant is called XON/XOFF; it's done by software, while other
  511. methods are hardware-based.
  512.  
  513. XON/XOFF
  514.  
  515.   Two bytes that are not mapped to normal characters in the ASCII charset are
  516.   called XON (DC1, Ctrl-Q, ASCII 17) and XOFF (DC3, Ctrl-S, ASCII 19).
  517.   Whenever either one of the sides wants to interrupt the data flow from the
  518.   other (eg. full buffers), it sends an XOFF ('Transmission Off'). When its
  519.   buffers have been purged again, it sends an XON ('Transmission On') to
  520.   signal that data can be sent again. (With some implementations, this can
  521.   be any character).
  522.  
  523.   XON/XOFF is of course limited to text transmission. It cannot be used with
  524.   binary data since binary files tend to contain every single one of the 256
  525.   characters...
  526.  
  527.   That's why hardware handshaking is normally used with modems, while
  528.   XON/XOFF is often used with printers and plotters and terminals.
  529.  
  530. DTR/DSR
  531.  
  532.   The 'Data Terminal Ready' and 'Data Set Ready' signals of the serial port
  533.   can be used for handshaking purposes, too. Their names express what they
  534.   do: the computer signals with DTR that it's ready to send and receive data,
  535.   while the data set sets DSR. With most modems, the meaning of these signals
  536.   is slightly different: DTR is ignored or causes the modem to hang up if it
  537.   is dropped, while DSR signals that a connection has been established.
  538.  
  539. RTS/CTS
  540.  
  541.   While DTR and DSR are mostly used to establish a connection, RTS and CTS
  542.   have been specially designed for data flow control. The computer signals
  543.   with RTS ('Request To Send') that it wishes to send data to the data set,
  544.   while the data set (modem) sets CTS ('Clear To Send') when it's ready to
  545.   do one part of its job: to send data thru' the phone wires.
  546.  
  547. A normal handshaking protocol between a computer and a modem looks like this:
  548.  
  549.  
  550. DTR  ___--------------------------------------------------------------____
  551.  
  552. DSR  _____-------------------------------------------------------------___
  553.  
  554. RTS  ___________-----------------------_____----------------------________
  555.  
  556. CTS  ____________-------____------------_____----------------------_______
  557.  
  558.        (1)(2) (3)(4)   (5) (6)      (7)(8)(9)(10)            (11)(12)(13)
  559.  
  560. (1)  The computer sets DTR to indicate that it wants to make use of the
  561.      modem.
  562. (2)  The modem signals that it is ready and that a connection has been
  563.      established.
  564. (3)  The computer requests permission to send.
  565. (4)  The modem informs the computer that it is now ready to receive data from
  566.      the computer and send it through the phone wires.
  567. (5)  The modem drops CTS to signal to the computer that its internal buffers
  568.      are full; the computer stops sending characters to the modem.
  569. (6)  The buffers of the modem have been purged, so the computer may continue
  570.      to send data.
  571. (7)  This situation is not clear; either the computer's buffers are
  572.      full and it wants to inform the modem of this, or it doesn't have any
  573.      more data to be send to the modem. Normally, modems are configured to
  574.      stop any transmission between the computer and the modem when RTS is
  575.      dropped.
  576. (8)  The modem acknowledges RTS by dropping CTS.
  577. (9)  RTS is again raised by the computer to re-establish data transmission.
  578. (10) The modem shows that it is ready to do its job.
  579. (11) No more data is to be sent.
  580. (12) The modem acknowledges this.
  581. (13) DTR is dropped by the computer; this causes most modems to hang up.
  582.      After hang-up, the modem acknowledges with DSR low. If the connection
  583.      breaks, the modem also drops DSR to inform the computer about it.
  584.  
  585.  
  586. BIOS API (Application Programs Interface)
  587. -----------------------------------------
  588.  
  589. PC programs are meant to use the BIOS routines to program the UARTs.
  590. Even though this is *NOT RECOMMENDED* by me, I give you the BIOS calls as
  591. specified by Big Blue. Call INT 14h with:
  592.  
  593.  
  594.   AH=00h    Serial port - Initialize
  595.  
  596.      AL: see table
  597.      DX: Port number (0-3; 0 equ. 0x3f8, 1 equ. 0x2f8, etc., see Hardware)
  598.  
  599.      Bit 7  Bit 6  Bit 5      Rate [bps]         Bit 4  Bit 3     Parity
  600.        1      1      1        9600                 0      0       none
  601.        1      1      0        4800                 1      0       none
  602.        1      0      1        2400                 0      1       odd
  603.        1      0      0        1200                 1      1       even
  604.        0      1      1         600
  605.        0      1      0         300               Bit 1  Bit 0     Data bits
  606.        0      0      1         150                 0      0         5
  607.        0      0      0         110                 0      1         6
  608.                                                    1      0         7
  609.      Bit 2   0 -> 1 stop bit, 1 -> 2 stop bits     1      1         8
  610.  
  611.      Returns:
  612.      AH: RS-232 line status bits
  613.        Bit
  614.         0: RBF  - input data is available in buffer
  615.         1: OE   - data has been lost
  616.         5: THRE - room is available in output buffer
  617.         6: TEMT - output buffer empty
  618.      AL: Modem status bits
  619.         3: always 1
  620.         7: DCD - carrier detect
  621.  
  622.    AH=01h    Serial port - Write character
  623.  
  624.      AL: character to be sent
  625.      DX: Port
  626.  
  627.      Returns:
  628.      AH: Bit 7 clear if successful, set if not. Bits 0-6 see INT 14h AH=03h
  629.  
  630.    AH=02h    Serial port - Read character
  631.  
  632.      DX: Port
  633.  
  634.      Returns:
  635.      AH: Line Status (see AH=03h)
  636.      AL: Received character (if AH bit 7 is clear)
  637.  
  638.      Note:
  639.      This routine times out if DSR is not asserted, even if data is
  640.      available!
  641.  
  642.    AH=03h    Serial port - Get port status
  643.  
  644.      DX: Port
  645.  
  646.      Returns:
  647.      AH: Line Status
  648.         Bit 7: Timeout
  649.         Bit 6: TEMT Transmitter empty
  650.         Bit 5: THRE Transmitter Holding Register Empty
  651.         Bit 4: Break (broken line detected)
  652.         Bit 3: FE Framing error
  653.         Bit 2: PE Parity error
  654.         Bit 1: OE Overrun error
  655.         Bit 0: RDF Receiver buffer full (data available)
  656.      AL: Modem Status
  657.         Bit 7: DCD Carrier detect
  658.         Bit 6: RI Ring indicator
  659.         Bit 5: DSR Data set ready
  660.         Bit 4: CTS Clear to send
  661.         Bit 3: DDCD Delta carrier detect
  662.         Bit 2: TERI Trailing edge of ring indicator
  663.         Bit 1: DDSR Delta data set ready
  664.         Bit 0: DCTS Delta Clear to send
  665.  
  666.  
  667. BIOS variables in the Data Segment at segment 40h:
  668.  
  669.      Offset   Size     Description
  670.       00h     WORD     Base I/O address of 1st serial I/O port, zero if none
  671.       02h     WORD     Base I/O address of 2nd serial I/O port, zero if none
  672.       04h     WORD     Base I/O address of 3rd serial I/O port, zero if none
  673.       06h     WORD     Base I/O address of 4th serial I/O port, zero if none
  674.      Note: Above fields filled in turn by POST as it finds serial
  675.      ports. POST never leaves gaps. DOS and BIOS serial device
  676.      numbers may be redefined by re-assigning these fields.
  677.      [POST: Power-On Self Test. CB]
  678.      [Madis Kaal told me that there are BIOSes that leave gaps in the table,
  679.                     and I know of some that don't recognize COM4 correctly.]
  680.  
  681.  
  682. This information is sneaked from Ralf Brown's famous interrupt list (hope
  683. he doesn't mind). If you want more detailed facts on this interrupt, refer
  684. to this list. It's available from several FTP sites.
  685.  
  686.  
  687.  
  688. Mice
  689. ----
  690.  
  691. The Microsoft Serial Mouse (or compatibles) is the device that is most often
  692. used with the Serial Port of the PC; it's the one with the two buttons. Mouse
  693. Systems compatible mice have three buttons. Here's some information I
  694. received from Stephen Warner and Angelo Haritsis:
  695.  
  696. Pins Used:
  697.  
  698.   TxD, RTS, DTR are used as power sources for the mouse.
  699.   RxD is used to receive data from the mouse.
  700.  
  701. Mouse reset:
  702.   Set UART to 'broken line' state (set bit 6 of the LCR) and clear the bits
  703.   0-1 of the MCR; wait a while and reverse the bits again.
  704.  
  705. Serial Data Parameters:
  706.  
  707.   Microsoft Mouse        1200 bps, 7 data bits, 1 stop bit, no parity
  708.   Mouse Systems Mouse    1200 bps, 8 data bits, 1 stop bit, no parity
  709.  
  710. Data packet format of the Microsoft mouse:
  711.  
  712.   The data packet consists of 3 bytes. It is sent to the computer every time
  713.   the mouse changes state (ie. the mouse is moved or the buttons are released/
  714.   pressed)
  715.  
  716.               D6    D5    D4    D3    D2    D1    D0
  717.  
  718.   1st byte    1     LB    RB    Y7    Y6    X7    X6
  719.   2nd byte    0     X5    X4    X3    X2    X1    X0
  720.   3rd byte    0     Y5    Y4    Y3    Y2    Y1    Y0
  721.  
  722.   The byte marked with 1 is sent first and then the others. The bit D6 in the
  723.   first byte is used for synchronizing the software to the mouse packets
  724.   if it goes out of sync.
  725.  
  726.   LB is the state of the left  button (1 being the LB is pressed)
  727.   RB is the state of the right button (1 being the RB is pressed)
  728.   X0-7 movement of the mouse in the X direction since last packet (+ right)
  729.   Y0-7 movement of the mouse in the Y direction since last packet (+ down )
  730.  
  731. Data packet format of the Mouse Systems mouse:
  732.  
  733.   The data packet consists of 5 bytes.
  734.  
  735.               D7    D6    D5    D4    D3    D2    D1    D0
  736.  
  737.   1st byte    1     0     0     0     0     LB    MB    RB
  738.   2nd byte    X7    X6    X5    X4    X3    X2    X1    X0
  739.   3rd byte    Y7    Y6    Y5    Y4    Y3    Y2    Y1    Y0
  740.   4th byte    equal to 2nd byte
  741.   5th byte    equal to 3rd byte
  742.  
  743.   Bits 7-3 of the 1st byte are used for synchronization; it's rather
  744.   improbable that they appear the same way in any of the other bytes.
  745.  
  746.   LB is the state of the left button (1 being the LB is pressed)
  747.   MB is the state of the middle button (1 being the MB is pressed)
  748.   RB is the state of the right button (1 being the RB is pressed)
  749.   X0-7 movement of the mouse in the X direction since last packet (+ right)
  750.   Y0-7 movement of the mouse in the Y direction since last packet (+ up   )
  751.  
  752. The mouse should rather be used with the mouse driver software; this
  753. ensures compatibility to future changes and greatly reduces software
  754. overhead. See Ralf Brown's interrupt list, interrupt 33h.
  755.  
  756.  
  757. Modems
  758. ======
  759.  
  760. This chapter is rather brief for several reasons. I'm no modem expert at all
  761. and there exist better sources than this document if you want information on
  762. modems. Patrick Chen, the author of "The Joy of Telecomputing", has written
  763. such a file, and there's one available from Sergey Shulgin, too (I don't have
  764. their internet addresses). You can obtain these files from the AFD service;
  765. they are named "modem1" and "modem2".
  766.  
  767.  
  768. A modem (MOdualtor-DEModulator) is an interface between the serial port of
  769. your computer and the public telephone network. Modern modems are small
  770. computers of their own; they accept commands, do the dialing for you, buffer
  771. incoming data, perform data compression and such things. Several standards
  772. have been established (Bell, CCITT), and several "command languages" are in
  773. use, with the Hayes and Microcom commands being the most popular ones.
  774.  
  775. Modems have two internal modes: the command mode and the data mode. After
  776. power-up, the modem is in the command mode, and this mode can be restalled
  777. by sending an 'escape sequence' (normally a pause of at least 1 second,
  778. then three '+' signs in one second, then a pause of at least 1 second).
  779.  
  780. All I know about modems is some commands and some encoding schemes; I
  781. share this knowledge with you - please share yours with me!
  782.  
  783.  
  784. Encoding schemes
  785. ----------------
  786.  
  787. I've sneaked this table from the posting 'FAQ zu /Z-NETZ/TELECOM/ALLGEMEIN'
  788. of Kristian Koehntopp <kris@black.toppoint.de> in 'de.newusers.questions'.
  789. He has copyrighted his posting, so please contact him if you wish to reproduce
  790. this information in any commercial way.
  791.  
  792.   These are the schemes recommended by CCITT (more than one speed means
  793.   auto-retrain speeds):
  794.  
  795.           Transmission speed in bps  Baud  Modulation duplex     usage
  796.    --------------------------------------------------------------------
  797.    V.17        14400                 2400     TCM      half       FAX
  798.                12000, 9600, 7200     2400     TCM      half       FAX
  799.                 4800                 2400     QAM      half       FAX
  800.    V.21          300                  300     FSK      full
  801.    V.22         1200                  600    DPSK      full
  802.    V.22bis      2400                  600     QAM      full
  803.    V.23         1200/75              1200/75  FSK   asymmetric    BTX
  804.    V.27ter      4800                 1600    DPSK      half       FAX
  805.                 2400                 1200    DPSK      half       FAX
  806.    V.29         9600                 2400     QAM      half       FAX
  807.                 7200                 2400     QAM      half       FAX
  808.    V.32         9600                 2400   TCM/QAM    full
  809.                 4800                 2400     QAM      full
  810.    V.32bis     14400                 2400     TCM      full
  811.                12000, 9600, 7200     2400     TCM      full
  812.                 4800                 2400     QAM      full
  813.  
  814.        FSK     Frequency Shift Keying
  815.        DPSK    Differential Phase Shift Keying
  816.        QAM     Quadrature Amplitude Modulation
  817.        TCM     Trellis Coded Modulation
  818.  
  819.    Other V-Recommendations often heard of:
  820.  
  821.    V.24    - Meaning of the signals at the serial port.
  822.    V.28    - Electrical levels (V.24, V.28, and ISO 2110 are equivlaent to EIA
  823.              RS232.)
  824.    V.42    - Data protection method, not dependening on the modulation scheme
  825.              in use.
  826.    V.42bis - Compression scheme, also called BTLZ.
  827.  
  828.  
  829.  
  830. Hayes commands
  831. --------------
  832.  
  833. Each command line starts with 'AT', then several commands, then carriage
  834. return.
  835.  
  836. The list is not comprehensive at all; most modems have several commands of
  837. their own, but these commands are available with most modems:
  838.  
  839. A/  Repeat last command
  840.  
  841. A   Take over phone line (if you've already dialed with your phone or
  842.     if you've picked up the phone).
  843.  
  844. B   Set communications standard.
  845.     B0 - CCITT
  846.     B1 - Bell
  847.  
  848. C   Switch carrier on/off.
  849.     C0 - carrier off
  850.     C1 - carrier on
  851.  
  852. D   Dial a number. Normally followed by
  853.     T - tone dial
  854.     P - pulse dial
  855.     nothing - according to actual setting (see ATP/ATT)
  856.     then a sequence of the follwing characters:
  857.     0-9 - the numbers to be dialed
  858.     W - wait for dial tone
  859.     , - wait 2 seconds
  860.     @ - wait 5 seconds (?)
  861.     ! - flash (put the phone on the hook for 1/2 second)
  862.     > - earth key
  863.     R - start connection right after dialing (eg. ATDPR equals ATA)
  864.  
  865. E   Echo on/off in the command mode
  866.     E0 - no echo
  867.     E1 - echo
  868.  
  869. H   Hang up
  870.  
  871. L   Volume control; followed by 0-3 (0 equ. lowest, 3 equ. highest volume)
  872.  
  873. M   Monitor
  874.     M0 - Speaker off
  875.     M1 - Speaker on while dialing and establishing a connection
  876.     M2 - Speaker always on
  877.     M3 - Speaker on while establishing a connection
  878.  
  879. O   Switch to data mode
  880.     O0 - promptly
  881.     O1 - with retrain (reduction of the data rate)
  882.  
  883. P   Pulse dial
  884.  
  885. Q   Responses to commands on/off
  886.     Q0 - on
  887.     Q1 - off
  888.  
  889. S   Set/read internal register, eg.
  890.     S17=234 set reg. 17 to 234
  891.     S17?    read reg. 17
  892.  
  893. T   Tone dial
  894.  
  895. V   Verbose mode on/off
  896.     V0 - short responses
  897.     V1 - full responses
  898.  
  899. X   Phone tones recognition on/off
  900.     X0 - Ignore busy sign, don't wait for dial tone, and just answer with
  901.          "CONNECT" when a connection has been established (other settings
  902.          produce more detailed messages)
  903.     X1 - Ignore busy sign, don't wait for dial tone, but give full connect
  904.          message
  905.     X2 - Ignore busy sign but wait for dial tone
  906.     X3 - Don't ignore busy sign, but don't wait for dial tone
  907.     X4 - Don't ignore anything
  908.  
  909. Y   Break setting
  910.     Y0 - Don't hang up when break signal is detected
  911.     Y1 - Hang up when break is detected (&D2, &M0)
  912.  
  913. Z   Initialize modem
  914.     Z  - Default parameters
  915.     Z0 - Setting 0
  916.     Z1 - Setting 1
  917.  
  918. &C  DCD mode
  919.     &C0 - always 1
  920.     &C1 - DCD according to carrier
  921.  
  922. &D  DTR mode
  923.     &D0 - ignore DTR
  924.     &D1 - switch to command mode when DTR goes 0
  925.     &D2 - hang up if DTR goes 0
  926.     &D3 - initialize modem when DTR goes 0
  927.  
  928. &F  Set operation mode
  929.     &F0 - according to Hayes, no data protocol
  930.     &F1 - according to Microcom; MNP1-4 or MNP5 as specified by %C
  931.     &F2 - according to Sierra; MNP1-4 or MNP5 as specified by %C
  932.     &F3 - according to Sierra, V.42 or V.42bis as specified by %C
  933.  
  934.     These are the default settings:
  935.     &F0 - B0, E1, L2, M1, P, Q0, V1, Y0, X1, &C1, &D0, &G0, &R0, &S0,
  936.           S0=0, S1=0, S2=43, S3=13, S4=10, S5=8, S6=2, S7=30, S8=2,
  937.           S9=6,S10=14, S11=75, S12=50, S14=AAh, S16=80h, S21=20h,
  938.           S22=76h, S23=7, S25=5, S26=1, S27=40h
  939.     &F1 - \A3, \C0, \E0, \G0, \K5, \N1, \Q0, \T0, \V0, \X0, %A0, %C1,
  940.           %E1, %G0, &G1, S36=7h, S46=138h, S48=128h, S82=128h
  941.     &F2 - \A3, \C2, \E0, \G1, \K5, \N3, \Q1, \T0, \V1, \X0, %A13, %C1,
  942.           S36=7h, S46=138h, S48=128h, S82=128h
  943.     &F3 - \A3, \C0, \E0, \G0, \K5, \N3, \O1, \T0, \V1, \X0, %A0, %C1,
  944.           %E0, S36=7h, S46=138h, S48=7h, S82=128h
  945.  
  946. &G  Guard tone
  947.     &G0 - off
  948.     &G1 - 550 Hz
  949.     &G2 - 1800 Hz
  950.  
  951. &K  Data flow control
  952.     &K0 - none
  953.     &K3 - bidirectional RTS/CTS handshaking
  954.     &K4 - bidirectional XON/XOFF
  955.     &K5 - unidirectional XON/XOFF
  956.  
  957. &M  Synchronous/asynchronous operation
  958.     &M0 - asynchronous (the usual thing)
  959.     &M1 - command mode asynchronous, data mode synchronous.
  960.     &M2 - switch to synchronous mode, start dialing after DTR 0->1
  961.     &M3 - switch to synchronous mode, don't dial
  962.  
  963. &Q  Further specification of the communication
  964.     &Q0 to &Q3 - no V.42bis
  965.     &Q5 - V.42bis
  966.     &Q6 - V.42bis off, buffer data
  967.  
  968. &R  CTS mode
  969.     &R0 - CTS follows RTS with the delay time of S26
  970.     &R1 - CTS is 1 if the modem is in the data mode
  971.  
  972. &S  DSR mode
  973.     &S0 - DSR always 1
  974.     &S1 - according to CCITT V.24
  975.  
  976. &T  Test
  977.     &T0 - normal operation (no test)
  978.     &T1 - local analog loopback
  979.     &T3 - local digital loopback
  980.     &T4 - accept distant digital loopback
  981.     &T5 - ignore distant digital loopback
  982.     &T6 - start distant digital loopback
  983.     &T7 - start distant digital loopback and self test
  984.     &T8 - start distant analog loopback and self test
  985.  
  986. &V  Show modem status
  987.  
  988. &Wn Save actual configuration (some modems only). Setting can be
  989.     restored with ATZn. n normally ranges between 0 and 1.
  990.     The following parameters are stored:
  991.     B, C, E, L, M, P/T, Q, V, X, Y, &C, &D, &G, &R, &S, &T4/&T5,
  992.     S0, S14, S18, S21, S22, S25, S26, S27
  993.  
  994. &X  Specify clock source for synchronous operation
  995.     &X0 - modem generates clock
  996.     &X1 - modem synchronizes with local clock
  997.     &X2 - modem synchronizes with distant clock
  998.  
  999. &Y  Define default setting (see &W and Z)
  1000.     &Y0 - setting 0 is default
  1001.     &Y1 - setting 1 is default
  1002.  
  1003. &Z  Store phone number in diary
  1004.     &Zn=XXXXXX stores phone number XXXXXX under index n, where
  1005.     XXXXXX can be up to 30 digits and n ranges between 0 and 3.
  1006.  
  1007.  
  1008. Microcom commands
  1009. -----------------
  1010.  
  1011. \A  Set block length for MNP
  1012.     \A0 - 64 characters
  1013.     \A1 - 128 characters
  1014.     \A2 - 192 characters
  1015.     \A3 - 256 characters
  1016.  
  1017. \Bn Send break signal for n times 100ms (MNP defaults to n=3).
  1018.  
  1019. \C  Set buffering
  1020.     \C0 - none at all
  1021.     \C1 - buffer data for 4 seconds as long as 200 characters aren't
  1022.           reached or as long as no MNP block is found
  1023.     \C2 - don't buffer. Switch back to normal operation after reception
  1024.           of the control character (fall-back, see %C)
  1025.  
  1026. D/n Dial phone number n in the diary (see &Z)
  1027.  
  1028. DL  Redial last number
  1029.  
  1030. \E  Echo on/off in data mode
  1031.     \E0 - no echo
  1032.     \E1 - echo
  1033.  
  1034. \G  Data flow on/off (see \Q)
  1035.     \G0 - off
  1036.     \G1 - on
  1037.  
  1038. \J  Data rate adjust
  1039.     \J0 - the data rates computer-modem and modem-modem are independent
  1040.     \J1 - the data rate computer-modem follows the data rate modem-modem
  1041.  
  1042. \Kn Break setting (don't know anything about this, just that it exists ;-)
  1043.  
  1044. \N  MNP select
  1045.     \N0 - standard mode, no MNP, data is buffered
  1046.     \N1 - direct mode, no MNP, no buffering
  1047.     \N2 - MNP, data is buffered
  1048.     \N3 - allow MNP on/off during connection, data is buffered
  1049.  
  1050. \O  Switch on MNP during connection (the rest of the line is being ignored!)
  1051.  
  1052. \Pn Same as &Z
  1053.  
  1054. \Q  Set handshake (compare &K)
  1055.     \Q0 - no handshaking
  1056.     \Q1 - XON/XOFF
  1057.     \Q2 - modem controls data flow with CTS
  1058.     \Q3 - data flow control with RTS/CTS
  1059.  
  1060. \S  List complete configuration
  1061.  
  1062. \Tn Set idle timer
  1063.     \T0 - timer off
  1064.     \Tnn - break connection after nn minutes without data exchange
  1065.            (1-90)
  1066.  
  1067. \U  Acknowledge MNP operation; rest of line is ignored!
  1068.  
  1069. \V  Verbose mode
  1070.     \V0 - messages according to Hayes, even if MNP (no \REL)
  1071.     \V1 - messages according to Microcom (\REL appended if MNP)
  1072.  
  1073. \X  Filter XON/XOFF characters
  1074.     \X0 - filter XOM/XOFF characters
  1075.     \X1 - don't filter them (the usual thing)
  1076.  
  1077. \Y  Same as AT\O\U with the difference that it is not necessary to
  1078.     first send AT\O to one modem and then AT\U to the other; just
  1079.     send AT\Y to each modem within 5 seconds
  1080.  
  1081. %An Specify control character that provokes fallback from MNP to
  1082.     normal operation (see \C2). n=0..255 (ASCII code)
  1083.  
  1084. %C  MNP5
  1085.     %C0 - not allowed
  1086.     %C1 - allowed
  1087.  
  1088. %E  auto-retrain
  1089.     %E0 - no auto-retrain allowed
  1090.     %E1 - auto-retrain allowed according to CCITT
  1091.  
  1092. %R  Show all S registers
  1093.  
  1094. %V  Same as I3 (but don't ask me what it is ;-) Gives info on the firmware
  1095.     version with some modems.
  1096.     
  1097.    
  1098. [... continued ...]
  1099.  
  1100.  
  1101. --
  1102. Chris Blum  -  finger chris@pfsparc02.phil15.uni-sb.de for details
  1103.