SIO Technical Reference Manual Copyright (c) 1993 by Raymond L. Gwinn 12469 Cavalier Drive Woodbridge, Virginia 22192 All Rights Reserved January 7, 1994 CompuServe: 71154,575 InterNet: p00321@psilink.com Voice: 1-703-494-4673 FAX: 1-703-494-0595 BBS: 1-703-494-0098 INTRODUCTION Documentation of software is often more difficult than writing the program itself (at least it is for this author). I will do my best though. But who do I document for? The user that is setting up a BBS just wants to get SIO installed and to move on to more important things. The user that is having problems needs information about serial I/O communications in general and the PC specifically. The application developer (programmer) needs detailed information about each individual function and the information generated. The answer is, more than one manual is needed. This manual is intended as a reference for use by application programmers that desires to use SIO. A separate Users Manual is included in the distribution file(s). This manual and the software described is provided as is and with no guarantees. Use at your own risk. ii WHAT IS SIO . . . . . . . . . . . . . . . . . . . . . . . . . 1 DISTRIBUTION, ORDERING AND SUPPORT . . . . . . . . . . . . . 2 Distribution and Ordering . . . . . . . . . . . . . . . 2 SIO Distribution and Support BBS . . . . . . . . . 2 Support . . . . . . . . . . . . . . . . . . . . . . . . 2 OS/2 Vendor Forum on CompuServe . . . . . . . . . . 2 File System Requests . . . . . . . . . . . . . . . . . . . . 3 Driver Initialization . . . . . . . . . . . . . . . . . 3 Read . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Input Status . . . . . . . . . . . . . . . . . . . . . . 3 Input Flush . . . . . . . . . . . . . . . . . . . . . . 4 Write . . . . . . . . . . . . . . . . . . . . . . . . . 4 Output Status . . . . . . . . . . . . . . . . . . . . . 4 Output Flush . . . . . . . . . . . . . . . . . . . . . . 4 Open . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Initial Open . . . . . . . . . . . . . . . . . . . 5 Additional Open . . . . . . . . . . . . . . . . . . 5 Close . . . . . . . . . . . . . . . . . . . . . . . . . 5 Intermediate Close . . . . . . . . . . . . . . . . 6 Last Close . . . . . . . . . . . . . . . . . . . . 6 Device I/O Control (IOCtl) Commands . . . . . . . . . . . . . 7 41h - Set Bit Rate . . . . . . . . . . . . . . . . . . . 8 42h - Set Line Characteristics . . . . . . . . . . . . . 9 43h - Extended Set Bit Rate . . . . . . . . . . . . . 10 44h - Transmit Byte Immediate . . . . . . . . . . . . 11 45h - Set Break Off . . . . . . . . . . . . . . . . . 11 46h - Set Modem Control Signals . . . . . . . . . . . 12 47h - Hold Transmit . . . . . . . . . . . . . . . . . 13 48h - Start Transmit . . . . . . . . . . . . . . . . . 13 4Bh - Set Break on . . . . . . . . . . . . . . . . . . 14 53h - Write Device Control Block (DCB) . . . . . . . 14 54h - Write Extended Mode Parameters . . . . . . . . . 17 61h - Query Current Bit Rate . . . . . . . . . . . . . 18 62h - Query Line Characteristics . . . . . . . . . . . 18 63h - Query Extended Bit Rate . . . . . . . . . . . . 19 64h - Query SIO Status . . . . . . . . . . . . . . . . 20 65h - Query Transmit Data Status . . . . . . . . . . . 21 66h - Query Current Modem Output Control Signals . . . 22 67h - Query Current Modem Input Signals . . . . . . . 22 68h - Query Number of Characters in Receive Buffer . . 23 6Dh - Query SIO Error . . . . . . . . . . . . . . . . 24 72h - Query SIO Event Information . . . . . . . . . . 25 73h - Read Device Control Block (DCB) . . . . . . . . 26 74h - Read Enhanced Mode Parameters . . . . . . . . . 26 Differences between SIO/VSIO and COM/VCOM . . . . . . . . . 27 Appendix A, Hardware Port and IRQ Assignments . . . . . . . 28 iii Addresses and IRQs for COM1 and COM2 . . . . . . . . . 28 Defacto standard for COM3 and COM4 . . . . . . . . . . 28 Addresses and IRQ for COM3 through COM8 on the PS/2 . 28 Appendix B, SIO Chips . . . . . . . . . . . . . . . . . . . 29 8250 . . . . . . . . . . . . . . . . . . . . . . . . . 29 8250A . . . . . . . . . . . . . . . . . . . . . . . . 29 16450 . . . . . . . . . . . . . . . . . . . . . . . . 30 16C451 . . . . . . . . . . . . . . . . . . . . . . . . 30 16550 (Non A . . . . . . . . . . . . . . . . . . . . . 30 16550A . . . . . . . . . . . . . . . . . . . . . . . . 30 16550AF . . . . . . . . . . . . . . . . . . . . . . . 30 16550AFN . . . . . . . . . . . . . . . . . . . . . . . 30 16550s Made by Western Digital . . . . . . . . . . . . 31 16C551 . . . . . . . . . . . . . . . . . . . . . . . . 31 16C552 . . . . . . . . . . . . . . . . . . . . . . . . 31 16C554 . . . . . . . . . . . . . . . . . . . . . . . . 31 82510 . . . . . . . . . . . . . . . . . . . . . . . . 31 Appendix C, Multi-Port Serial I/0 Cards . . . . . . . . . . 32 STB 4COM . . . . . . . . . . . . . . . . . . . . . . . 32 Appendix D, Advanced SIO Options . . . . . . . . . . . . . 33 Protection . . . . . . . . . . . . . . . . . . . . . . 33 Locked Baud Rate . . . . . . . . . . . . . . . . . . . 33 IRQ Reflection to DOS Process . . . . . . . . . . . . 33 I/O Port Mapping to DOS Process . . . . . . . . . . . 33 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1 WHAT IS SIO SIO is a Serial Input/Output (SIO) communications character device driver. It provides an interface between application programs and the serial communications hardware. SIO had been designed as a high performance replacement for the OS/2 device driver COM.SYS. This manual documents the known differences between COM.SYS and SIO.SYS. SIO only works with 8250 (type) serial I/O devices. Such devices include, but is not limited to the 8250A, 16450, 16550, 16550A and the 82510. If you have a PC that is an IBM or near compatible which has a serial communication port, it is likely that it contains one of these devices. SIO will identify the type of serial devices that it finds at load time. Like other Device Drivers, SIO will do very little standing alone. There must be an application(s) program that makes use of SIO's functions before one will benefit from the use of SIO. 2 DISTRIBUTION, ORDERING AND SUPPORT Distribution and Ordering The entire package collectively known as SIO is ShareWare. It is not free software or freeware. See LICENSE.TXT and ORDER.TXT for additional information. The ShareWare version of SIO is distributed electronically. One may check their favorite electronic hangout for the latest version of SIO. The latest copy of the ShareWare version is always posted for downloading from the BBS at 1-703-494-0098. Registered versions of SIO are distributed by US Mail and electronically from the SIO Distribution and Support BBS. Users desiring to register electronically, may call the BBS and register on line (1-703-494-0098) and immediately download their registered version of SIO. Use the ORDER command at the main BBS prompt. Registrations/Orders can also be placed by phone, mail, FAX, and email. See the front cover of this manual for the phone numbers and addresses. Also see ORDER.TXT for and order form that may be used. Support Extensive testing has been done to insure that this product works on the widest possible range of OS/2 V2 (and up) systems. In most cases, problems can be resolved by reading this manual carefully. Registered users of SIO can update to the latest version using the BBS and its UPDATE command. All variations (number of ports) of SIO are available for immediate download from the BBS. Support is provided in section 1 (Other Vendors) of the OS/2 Vendor Forum on CompuServe (GO OS2AVEN). Regular checks are made in this Forum for SIO support questions. In addition, support is provided by BBS, Email and FAX. Voice support would overwhelm the author. If, after reading the manual carefully, you are unable to resolve a problem, you may fill out PROBLEM.TXT (adding information as necessary) and Email/FAX it to one of the following: Email CompuServe 71154,575 Internet p00321@psilink.com FAX 1-703-494-0595 BBS 1-703-494-0098 PROBLEM.TXT is included in the distribution ZIP. 3 File System Requests SIO processes all file system requests made to it in one way or another. The following file system requests and how SIO processes them may be of use to the application programmer. INIT Driver initialization. Read Data transfer from driver to program. Input Status Get input status. Input Flush Terminate all pending input requests. Write Data transfer from program to driver. Output Status Get output status. Output Flush Terminate all pending output requests. Open Open the device for use. Close Close the device. IOCTL Device I/O control commands. Each of these file system requests are discussed in more detail in the following. Driver Initialization During device driver initialization the command line is parsed, memory for data and control buffers are allocated and the system environment is examined. Buffers are allocated for the maximum number of ports that the installed version of SIO can support (up to 16). The mouse port is determined and if it is a serial mouse, that port is excluded from use by SIO. In the absents of any command line parameters, SIO will only support (look for) COM1 and COM2 at the standard addresses. COM3 and up will not be supported (or looked at) unless they are specifically identified in the SIO command line. Read If another read is already in progress, the process issuing the additional read is blocked (suspended) until the previous read command completes. When a read is started, that read is not interrupted by additional reads. If multiple reads are issued, they are not necessarily processed in the order they were issued. Thus, applications may not see the read requests complete in the order in which they were issued. The conditions that control when the read will complete are controlled by the active (current) DCB when the read is started. Input Status 4 This function returns with "device busy" set if there is no data in the receive buffer. That is, busy is returned if the process may be blocked if the application issues a read command. Input Flush This function causes the receive buffer to be cleared (made empty). Any threads that are blocked, waiting for a read, will be restarted when this function is issued. Write If another write is already in progress, the process issuing the additional write is blocked (suspended) until the previous write command completes. When a write is started, that write is not interrupted by additional writes. If multiple writes are issued, they are not necessarily processed in the order they were issued. Thus, applications may not see the write requests complete in the order in which they were issued. The conditions that control when the write will complete are controlled by the current DCB when the write is started. Output Status This function returns with "device busy" set if the output buffer is more than three quarters full. That is, busy is returned if the process may be blocked if the application issues a write command. Output Flush This function causes the transmit buffer to be cleared (made empty). Any threads that are blocked, waiting for a read, will be restarted when this function is issued. Open There are basically two kinds of open. They are, an Initial Open and Additional (shared) Opens. The IBM documentation calls the initial open a First Level Open. An Initial Open is an open that occurs when no other process has the communications port open. An Additional Open is when an open occurs and another process already has the communications port open. For an Additional Open to occur, the Initial Opener must have issued an open allowing shared access to the port. 5 Initial Open The IRQ associated with the comm port is claimed (taken) when the Initial Open occurs. If the associated IRQ is not available a "Port in Use" error is returned. At the time of this writing, the IRQ is claimed allowing sharing. However, the shared IRQ claiming is done to circumvent anomalies in the OS, and in actuality SIO will not concurrently share an IRQ with another device driver. The author found it necessary to claim (reset) all interrupts directed to the interrupt service routine in order to prevent lock ups of a communications port. The IRQ mess may be cleaned up at a future date when the OS problems are corrected. During Initial Opens, DTR and RTS are set in accordance with the current Device Control Block (DCB) settings. If DTR Control Mode is the "Enabled" option ( bits 1 and 0 of the DCB Flags1 byte equal 01), then DTR is turned on. Otherwise, DTR is unchanged by the Initial Open. Similarly, if RTS Control Mode is the "Enabled" option ( bits 7 and 6 of the DCB Flags1 byte equal 01), then RTS is turned on. Otherwise, RTS is unchanged by the Initial Open. The following actions also occur during an Initial Open: The Xon and Xoff characters are set to 11h and 13h respectively. The transmit and receive buffers and structures are cleared and re-initialized. Status bits are reset. If the Initial Opener is an OS/2 process (not a DOS process) then the Read time out processing is set to "Normal" in the current DCB. Additional Open A count of active opens is incremented. No changes are made to current comm settings. Close There are two basic kinds of closes. They are, an Intermediate Close and a Last Close. 6 Intermediate Close An intermediate close occurs when a process issues a close and other processes still have the communications port opened. This type of close simply decrements an open count and returns. No action or changes take place at the communications port. Last Close The last close occurs when a process issues a close and no other process has the communications port open. If there are any writes pending or incomplete, the process is blocked (suspended) until the writes complete or time out. If 60 seconds pass with no activity at the communications port, the port is forced to close and all writes are terminated. If any processes are blocked (suspended) waiting on a read, they are forced to return to the process that issued the read. If either DTR Control Mode or RTS Control Mode are set to "Enabled" by the current DCB, then the appropriate signal(s) is turned off. Finally, the IRQ is released back to the OS. 7 Device I/O Control (IOCtl) Commands The following Generic IOCtl functions are supported by SIO. 41h - Set Bit Rate 42h - Set Line Characteristics 43h - Extended Set Bit Rate 44h - Transmit Byte Immediate 45h - Set Break Off 46h - Set Modem Control Signals 47h - Hold Transmit 48h - Start Transmit (after hold) 4Bh - Set Break On 53h - Write Device Control Block (DCB) 54h - Write Extended Mode Parameters 61h - Query Current Bit Rate 62h - Query Line Characteristics 63h - Query Extended Bit Rate 64h - Query SIO Status 65h - Query Transmit Data Status 66h - Query Current Modem Output Control Signals 67h - Query Current Modem Input Signals 68h - Query Number of Characters in Receive Buffer 69h - Query Number of Characters in Transmit Buffer 6Dh - Query SIO Error 72h - Query SIO Event Information 73h - Read Device Control Block (DCB) 74h - Read Enhanced Mode Parameters All IOCtl functions are called with a uniform set of parameters. This uniform set of parameters is: DWORD Address of a data packet. WORD Size of the data packet in bytes. DWORD Address of the parameter packet. WORD Size of the parameter packet in bytes. WORD Function code. WORD Category code (01 for SIO). WORD Handle for the opened device. Each IOCtl function may or may not have a data or parameter packet. If a given IOCtl function specifies a NULL parameter or data packet, the address of the appropriate item must be NULL (zero) in the parameters. Passing an invalid data or parameter packet may result in a General Protection Fault. Each of these IOCtl commands are described in detail on the following pages. 8 41h - Set Bit Rate Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Bit/Baud Rate ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Bit Rate" is any number from 1 to 65535. SIO does not attempt to validate a given bit rate. SIO rounds the given bit rate to the nearest multiple of 10. For example, 75 is rounded to 80 and 134 is rounded to 130. Note that the hardware may not be able to generate the given bit rate. For example, if a computer has a standard communications card installed and if a bit rate of 65500 is specified, the nearest bit rate that can be generated will be set, 57600 in this case. To set bit rates in excess of 57600, see IOCtl function 43h, Extended Set Bit Rate. Some commonly used bit rates that can be set with this function are: 110 3600 150 4800 300 7200 600 9600 1200 19200 1800 28800 2000 38400 2400 57600 Data Packet - None 9 42h - Set Line Characteristics Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Data Bits Per Character ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Parity Setting ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Stop Bit Setting ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ Data Bits Per Character may be 5, 7, or 8, all other values are invalid. Parity Setting may have the following values, all other values are invalid: 0 - No parity bit. 1 - Odd parity. 2 - Even parity. 3 - Mark parity (1). 4 - Space parity (0). Stop Bit Setting may have the following values, all other values are invalid: 0 - 1 stop bit. 1 - 1.5 stop bit (valid with 5 data bit characters). 2 - 2 stop bits. Data Packet - None 10 43h - Extended Set Bit Rate Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Bit/Baud Rate ³ DWORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Fraction ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Bit Rate" is the desired bit/baud rate. As of this writing, the maximum bit rate supported by SIO is 115200. SIO does not attempt to validate a given bit rate. SIO rounds the given bit rate to the nearest multiple of 10. For example, 75 is rounded to 80 and 134 is rounded to 130. Note that the hardware may not be able to generate the given bit rate. For example, if a computer has a standard communications card installed and if a bit rate of 65500 is specified, the nearest bit rate that can be generated will be set, 57600 in this case. "Fraction" is used to set the fractional part of the bit rate when a high degree of accuracy is needed. As of this writing, SIO does not support a "Fraction" other than zero. Some commonly used bit rates that can be set with this function are: 110 3600 115200 150 4800 300 7200 600 9600 1200 19200 1800 28800 2000 38400 2400 57600 Data Packet - None 11 44h - Transmit Byte Immediate Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Character to Transmit ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Character to Transmit" will be the next character loaded into the UART for transmission. If a previous transmit immediate byte is still pending, it is lost. This function does not wait for the character to transmit before returning. This function may be used by an application program as one of a set of functions to implement its own Xon/Xoff type handshaking. Data Packet - None 45h - Set Break Off Parameter Packet - None Look!! No Parameter Packet! Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ SIO Error Word ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 6Dh "Query SIO Error" for a description of the SIO Error Word. This function does not reset any bits in the SIO Error Word. 12 46h - Set Modem Control Signals Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ DTR and RTS on mask ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ DTR and RTS off mask ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ Attempted changes in the the setting of signals that are used as flow control signals are ignored. The current DCB determines if either or both RTS and DTR are used as a flow control signal. The setting of bit 0 affects DTR and the setting of bit 1 affects RTS. Ones in the "on mask" specifies which of the two signals are to be turned on, and zeros in the "off mask" specify which of the two signals are to be turned off. Some examples are: On Mask Off Mask 01h 0FFh Turn DTR on 00h 0FEh Turn DTR off 02h 0FFh Turn RTS on 00h 0FDh Turn RTS off 03h 0FFh Turn RTS and DTR on 00h 0FCh Turn RTS and DTR off If both on and off are specified for the setting of a signal, the result is undefined. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ SIO Error Word ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 6Dh "Query SIO Error" for a description of the SIO Error Word. This function does not reset any bits in the SIO Error Word. 13 47h - Hold Transmit Parameter Packet - None Data Packet - None This function will disable the transmitter. The transmitter will not be enabled again unless IOCtl function 48h is issued. If the transmitter is already disabled, this call has no effect. This function can be used as part of a set that allows an application to implement its own Xon/Xoff type handshaking. Note that this is different from how COM.SYS implements this function. COM.SYS will re-enable the transmitter if an Xon is received while SIO will not. 48h - Start Transmit Parameter Packet - None Data Packet - None This function will enable the transmitter, usually following an IOCtl function 47h. If the transmitter is already enabled, this call has no effect. This function can be used as part of a set that allows an application to implement its own Xon/Xoff type handshaking. 14 4Bh - Set Break on Parameter Packet - None Look!! No Parameter Packet! Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ SIO Error Word ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 6Dh "Query SIO Error" for a description of the SIO Error Word. This function does not reset any bits in the SIO Error Word. 53h - Write Device Control Block (DCB) This is where the action is! See also function 73h (Read DCB). Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Write Timeout ³ WORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Read Timeout ³ WORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Flags1 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Flags2 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Flags3 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Error Replacement Byte ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Break Replacement Byte ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Xon Character ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Xoff Character ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Write Timeout" The write timeout is given in hundredths of a second, relative to zero. That is, 0 specifies 0.01 seconds and 1 specifies 0.02 seconds. 15 "Read Timeout" The read timeout is given in hundredths of a second, relative to zero. That is, 0 specifies 0.01 seconds and 1 specifies 0.02 seconds. "Flags1" is a bit flag. The bits in the flag specify the following: Bits 1 and 0 DTR Control Mode. 00 - Disable changing DTR during Open and Close. 01 - Enable Changing DTR during Open and Close. 10 - DTR used for input handshaking (not supported by SIO). 11 - Invalid Bit 2, Must be zero Bit 3, Off to ignore CTS. Forced on if RTS is handshake. Bit 4, DSR is handshake. Not supported by SIO. Bit 5, DCD required to transmit. Not supported by SIO. Bit 6, DSR required to receive. Bit 7, Must be zero. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ "Flags2" is a bit flag. The bits in the flag specify the following: Bit 0, SIO is to honor Xon/XOff received from remote. Bit 1, SIO may send Xon/Xoff to the remote. Bit 2, Enable error replacement character. Not supported by SIO. Bit 3, Enable null stripping. Not supported by SIO. Bit 4, Enable break replacement character. Not supported by SIO. Bit 5, Enable Full duplex. Half duplex is not supported by SIO. Bits 7 and 6 RTS Control Mode 00 - Disable changing RTS during Open and Close. 01 - Enable Changing RTS during Open and Close. 10 - RTS used for input handshaking. 11 - Toggle on transmit (half duplex). Not supported by SIO. 16 "Flags3" is a bit flag. The bits in the flag specify the following: Bit 0, Enable infinite write timeout processing. When set, a write timeout will not occur. Bits 2 and 1 Read timeout processing 00 - Invalid. 01 - Normal read time out. 10 - Wait for something. Reads will return before a timeout occurs if something received. 11 - No Wait. Reads will return immediately with any available data. Bits 4 and 3 FIFO Control 00 - No change in FIFO state. 01 - Disable FIFO buffers. 10 - Enable FIFO buffers. 11 - Dynamic enabling and disabling of FIFOS. **Note, SIO forces bits 4 and 3 to "10". Bits 6 and 5 Set receive trigger level 00 - 1 character. 01 - 4 characters. 10 - 8 characters. 11 - 14 characters. **Note, SIO forces bits 6 and 5 to "10". Bit 7 Transmit load count 0 - Load 1 character. 1 - Load 16 characters. **Note, SIO forces bit 7 to "1". "Error Replacement Byte" Not supported by SIO. "Break Replacement Byte" Not supported by SIO "Xon Character" Any value, default is 11h. "Xoff Character" Any value, default is 13h. Data Packet - None 17 54h - Write Extended Mode Parameters Parameter Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Enhanced Flags1 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Reserved ³ DWORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ This function is not supported (ignored) by SIO. However the bits are defined here for completeness. Enhanced Flags1 Bit 0 - Enhanced mode hardware available (Query only 74h). Bit 1 - Enable enhanced mode. Bits 3 and 2 DMA Receive Operation 00 - Disable DMA receive capability. 01 - Enable DMA receive capability. 10 - Dedicate a DMA channel to receive. 11 - Reserved. Bits 5 and 4 DMA Transmit Operation 00 - Disable DMA transmit capability. 01 - Enable DMA transmit capability 10 - Dedicate a DMA channel to transmit. 11 - Reserved. Bit 6 - Receive in DMA mode (Query only, 74h). Bit 7 - Transmit in DMA mode (Query only, 74h). Data Packet - None. 18 61h - Query Current Bit Rate Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Bit/Baud Rate ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 41h for more information. 62h - Query Line Characteristics Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Data Bits Per Character ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Parity Setting ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Stop Bit Setting ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Transmitting Break ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 42h for a definition of Data, Parity and Stop Bits. "Transmitting Break" is set to 1 if a break is being transmitted. Otherwise, it is set to zero. 19 63h - Query Extended Bit Rate Parameter Packet - None Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Current Bit/Baud Rate ³ DWORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Fraction of Current ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Minimum Bit/Baud Rate ³ DWORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Fraction of Minimum ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Maximum Bit/Baud Rate ³ DWORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Fraction of Maximum ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Current Bit/Baud Rate" is a 32 bit integer defining the current bit rate. "Fraction of Current" is always 0 when returned by SIO. "Minimum Bit/Baud Rate" is the minimum value that can be passed to SIO as a bit/baud rate. "Fraction of Minimum" is always 0 when returned by SIO. "Maximum Bit/Baud Rate" is the maximum value that can be passed to SIO as a bit/baud rate. "Fraction of Maximum" is always 0 when returned by SIO. 20 64h - Query SIO Status Parameter Packet - None Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ SIO Status Byte ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "SIO Status Byte" is a bit flag. The bits have the following meanings: Bit 0 - Set if SIO is waiting for CTS before transmitting. Bit 1 - Set if SIO is waiting for DSR before transmitting. Bit 2 - Set if SIO is waiting for DCD before transmitting. Bit 3 - Set if SIO is waiting because Xoff received or transmitter is disabled (see function 47h). Bit 4 - Reserved, not used by SIO. Bit 5 - Set if SIO is waiting because break is being sent. Bit 6 - Set if a transmit immediate is pending. Bit 7 - Reserved, not used by SIO. 21 65h - Query Transmit Data Status Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Transmit Status ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "SIO Status Byte" is a bit flag. The bits have the following meanings: Bit 0 - Set if write in progress or pending. Bit 1 - Set if any data is in the transmit buffer. Bit 2 - Set if UART is currently transmitting. Bit 3 - Set if a transmit immediate is pending. Bit 4 - Set if an Xon needs to be sent. Bit 5 - Set if an Xoff needs to be sent. Bit 6 - Reserved Bit 7 - Reserved 22 66h - Query Current Modem Output Control Signals Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Modem Output Signals ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Modem Output Signals" is a bit flag. The bits have the following meanings: Bit 0 - Set if DTR is currently on. Bit 1 - Set if RTS is currently on. Bits 2-7 Reserved, set to zero by SIO. 67h - Query Current Modem Input Signals Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Modem Input Signals ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "Modem Output Signals" is a bit flag. The bits have the following meanings: Bits 0-3 Reserved, set to zero by SIO. Bit 4 - Clear To Send (CTS) is active. Bit 5 - Data Set Ready (DSR) is active. Bit 6 - Ring Indicator (RI), trailing edge detected. Bit 7 - Data Carrier Detect (DCD) is active. 23 68h - Query Number of Characters in Receive Buffer Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Number of Bytes Buffered ³ WORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Byte Size of the Buffer ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ Self explaining. 69h - Query Number of Characters in Transmit Buffer Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Number of Bytes Buffered ³ WORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Byte Size of the Buffer ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ Self explaining. 24 6Dh - Query SIO Error Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ SIO Error Word ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "SIO Error Word" is a bit flag. The bits have the following meaning: Bit 0 - Set if a buffer overrun has occurred. Bit 1 - Set if an overrun occurred at the UART. Bit 2 - Set if the UART detected a parity error. Bit 3 - Set if the UART detected a framing error. Bits 4-15 Reserved, set to zero by SIO. All bits of the SIO Error Word are reset prior to returning to the caller. 25 72h - Query SIO Event Information Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ SIO Event Word ³ WORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ "SIO Event Word" is a bit flag. The bits have the following meaning: Bit 0 - Set when a receive character is transferred from the UART to the receive buffer. Bit 1 - Set when a receive (Read) timeout occurs. Bit 2 - Set if the transmit buffer is empty. Bit 3 - Set if Clear To Send (CTS) has changed state. Bit 4 - Set if Data Set Ready (DSR) has changed state. Bit 5 - Set if Data Carrier Detect (DCD) has changed state. Bit 6 - Set if a break has been detected. Bit 7 - Set if a framing, parity, or overrun error has occurred. Bit 8 - Set if trailing edge of Ring Indicator (RI) has occurred. Bits 9-15 Reserved, set to zero by SIO. All bits are reset prior to returning to the caller. 26 73h - Read Device Control Block (DCB) Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Write Timeout ³ WORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Read Timeout ³ WORD ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Flags1 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Flags2 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Flags3 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Error Replacement Byte ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Break Replacement Byte ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Xon Character ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Xoff Character ³ BYTE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 53h for a description of the parameters. 74h - Read Enhanced Mode Parameters Parameter Packet - None. Data Packet ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Item Type ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ´ ³ Enhanced Flags1 ³ BYTE ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´ ³ Reserved ³ DWORD ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ See function 54h for a description of the Flags1 Byte. 27 Differences between SIO/VSIO and COM/VCOM What follows is some of the differences between SIO/VSIO and COM/VCOM that are know to the author. 1 - COM.SYS will automatically seek out and support four comm ports, COM1 through COM4. SIO.SYS will automatically seek out and support only COM1 and COM2. If SIO.SYS is to support more than two comm ports, they must be defined in the command line that loads SIO.SYS. For example, DEVICE=SIO.SYS (COM3) (COM4) will cause SIO.SYS to support four comm ports. 2 - In the absence of overrides in the command line, COM.SYS will seek out four comm ports in the sequence of I/O ports 3F8h, 2F8h, 3E8h and 2E8h. The first port found in this sequence is given the logical name COM1, the second is COM2 etc. This means that the comm port at 2F8h could become COM1. In the opinion of the author, this confuses some users to frustration. With no command line overrides, SIO.SYS uses a fixed I/O port concept. That is, COM1 is always at I/O port 3F8h, COM2 is always at 2F8h, etc. Another way of looking at this is; if no comm port exists at port 3F8h, then you do not have a COM1. SIO.SYS will not move another (found) comm port into the logical COM1 slot. 3 - VSIO opens a comm port for a DOS session with sharing allowed. VCOM uses an "exclusive use" open for DOS sessions. 4 - SIO.SYS will accept any number between 50 and 115200 as a valid baud rate. For example, if an application program attempts to set a baud rate of 9990 bps, COM.SYS will reject it and SIO.SYS will accept it. 5 - The last decimal digit of a baud rate given to SIO must be zero. SIO.SYS will not support baud rates like 75 or 134. If given, they will be rounded to 80 and 130 respectively. 6 - SIO/VSIO execute faster than COM/VCOM. This means that some applications, that are timing dependant, may not work under SIO/VSIO that do work under COM/VCOM. 7 - VSIO optionally (and by default) simulates a 16550A for DOS sessions. VCOM simulates a 8250/16450. 28 Appendix A, Hardware Port and IRQ Assignments I have obtained the following information from various sources. Accuracy is not guaranteed. In fact, nothing in this document is guaranteed. Addresses and IRQs for COM1 and COM2 COM1 uses 03F8h and IRQ4 COM2 uses 02F8h and IRQ3 Defacto standard for COM3 and COM4 for PC, XT and AT COM3 uses 03E8h and IRQ4 COM4 uses 02E8h and IRQ3 Addresses and IRQ for COM3 through COM8 on the PS/2 COM3 uses 3220h and IRQ3 COM4 uses 3228h and IRQ3 COM5 uses 4220h and IRQ3 COM6 uses 4228h and IRQ3 COM7 uses 5220h and IRQ3 COM8 uses 5228h and IRQ3 All PCs (know to the author) prior to the PS/2 and EISA only use 10 bits to address hardware I/0 ports. Systems prior to the PS/2 and EISA can not address the standard PS/2 addresses for COM3 through COM8. If an AT or below attempts to address COM3 through COM8 using the PS/2 addresses, only the low 10 bits of the address are used. That is, the high 6 bits of the address will be ignored by the hardware. This means that any reference to COM3 through COM8 will actually address ports 220h through 22Fh on older PCs. One should avoid expansion boards that use ports 220h through 22Fh unless the expansion board is a serial I/O board. SIO will (attempt to) determine the hardware architecture (ISA/EISA and PS/2) that it is being executed on and use the appropriate hardware port addresses for COM1 thru COM4 as defaults. 29 Appendix B, SIO Chips The following is a collection of comments developed from hearsay, random documents, experience, and technical specifications. So, take it with a grain of salt. Order information from the various manufactures if you want accurate information. Very good reference books are available from National Semiconductor Corporation. They cover most of the SIO devices (also called UARTs) that you will find in many PCs and clones. I am not sure that books can be ordered directly from National Semiconductor. They may require that you get it from a distributor. In any case, the address on the back of the one manual is: National Semiconductor Corporation 2900 Semiconductor Drive P.O. Box 58090 Santa Clara, CA 95052-8090 Tel:(408)721-5000 TWX:(910)339-9240 8250 As best that I know, the 8250 was the first SIO chip (integrated circuit) that was used by the IBM PC and many clones. In my opinion, it was a poor choice on the part of IBM. I feel many superior devices, at comparable prices, were readily available. At that time, I feel the 8251A or the 8530 would have been better choices. But, they used the 8250 and therefore we must use it. From a hardware standpoint the 8250 is a relatively slow device. It is advisable that programmers not perform successive inputs or outputs to this device. It seems that software programs can load the various registers of the 8250 faster than it can process the information. The 8250 had a total of 7 registers. The specifications state that 56kb is the maximum baud rate. 8250A I believe the 8250A is the 8250 with some bug fixes. I have no idea what the bugs may have been. A quick glance at the specifications shows the speed of the 8250 and 8250A to be much the same. The 8250A added an 8th register. This additional register enables software to detect if an 8250 is installed. The specifications state that 56kb is the maximum baud rate. 30 16450 The 16450 seems to be a speeded up version of the 8250A. There is no direct way (that I know of) for software to detect the difference between an 8250A and a 16450. I believe the 16450 was developed to eliminate the need for software to insert delays between successive accesses to the device. The specifications indicate the 16450 is a much faster device than its predecessors. The additional speed is only the speed at which the processor can access the device. The maximum baud rate for the 16450 is still stated at 56kb. However, I have been told by some people that they have run the 16450 successfully at much higher speeds. I do not believe there was ever a 16450A. 16C451 The 16C451 is a CMOS version of the 16450. CMOS is a term for the material and manufacturing process used to make the part. CMOS typically uses less power than other technologies. If you are not designing hardware, you should view the 16C451 as a 16450. 16550 (Non A) It is hard to find a 16550 (Non A). I was told by National Semiconductor that they did everything they could to get all 16550s back. SIO will detect a 16550 and tell you if you have one. I am told that the 16550 was installed in early PS/2 systems. The 16550 was the first shot at a FIFOed version of the 8250 family from National semiconductor. However, I was told by National Semiconductor that the FIFOs of the 16550 are not reliable and they should not be enabled. SIO will treat a 16550 like a 16450. In this mode, they are reliable. National Semiconductor would not provide me with a specification for the 16550. However, I suspect its maximum baud rate is the same as the 16550A which is 256kb. 16550A, 16550AF and 16550AFN In the manuals that I have, National Semiconductor does not explain the differences between the 16550A and the 16550AF. I suspect the AF part may have a few bug fixes. I believe the N in AFN describes packaging, ceramic versus plastic, DIP versus surface mount etc. In the opinion of the author, there is no substitute for the 16550A (and its successors) in the 8250 type series. The 16550A is compatible with most software written for the entire family of 8250 type devices. Programs that are 16550A aware can provide much improved performance over previous devices. 31 The maximum baud rate for the 16550A is specified at 256kb. However, due to the hardware design of the PC et al, 115kb is the maximum baud rate that can be programmed by software. The 16550A can be plugged into the same socket that contains an 8250, 8250A or 16450. If your SIO expansion board has the SIO chips in sockets, you can upgrade to the 16550A by simply removing the old chips and replacing them with 16550As. The key to the performance increase of the 16550A is its FIFOs. It has 16 byte FIFOs for both transmit and receive data. 16550s Made by Western Digital I have been told, but I have not verified for myself, that 16550s made by Western Digital have a problem with their FIFOs when working at 2400 baud or below. 16C551 The 16C551 is a CMOS version of the 16550AF. See the above description of the 16C451 for a discussion of CMOS. Do not feel you need to upgrade from a 16550A or AF to a 16C551. There is no gain from an existing users point of view. 16C552 The 16C552 is two 16C551s on a single chip. 16C554 The 16C554 is four 16C551s on a single chip. 82510 I believe Intel is the only company that manufactures the 82510. The 82510 is feature rich with several modes of operation. Its default mode is to operate as a 16450. The 82510 has a 4 byte FIFO for both transmit and receive data. A 4 byte FIFO is sufficient to provide significant performance over a basic 16450. The 82510 is small in size. Therefore, it is found in many lap tops. The 82510 is somewhat of a sleeper. I believe it would be much more widely used if Intel had promoted it more. However, given a choice between the 82510 and the 16550A, I would select the 16550A. 32 Appendix C, Multi-Port Serial I/0 Cards I have received many requests for information about multi-port serial I/O card. I will describe the boards that I know about (or have heard about) here. I will add to the list as I receive precise information from users or develop it myself. STB 4COM (ISA buss) I am very impressed with the STB 4COM card, they have almost got it. Yes, its the same company that makes the VGA cards. The 4COM card uses a 16554 which is the equivalent of four 16550A. Comm ports can use IRQs 2/9, 3, 4, 5, 10, 11, 12, and 15. Any or all ports can share IRQs, and they have done this right. I tested SIO with all four ports of the 4COM on IRQ12 and they worked correctly. The user can select any of the following I/O port address for a comm port: 3F8, 2F8, 3E8, 2E8, 1A8, 1E8, 1F8, 2A8. I purchased my 4COM card (for $119) from Steve Winter. Steve can be reached at 800-735-5266 or 919-286-1502. 33 Appendix D, Advanced SIO Options The following is provided for the experienced user. Inexperienced users get themselves into a lot of trouble when trying to use these options and they cause an inordinate number of support problems. Therefore, the following are unsupported options. If you use them, you must work out the problems yourself or ask a friend how they got it working. Protection Placing a dash "-" in the fourth parameter position, eg (COM1,3F8,IRQ4,-), causes SIO not to provide any protection for that port. The OS may still protect the port somewhat. When the dash parameter is used the port is wide open (like DOS) for any process to access it. Locked Baud Rate Placing a colon and a baud rate following the communications port, eg (COM1:38400,3F8,IRQ4), causes the port to be locked at that baud rate. No program, OS2 or DOS, is allowed to change the baud rate. IRQ Reflection to DOS Process Normally the IRQ that is reflected to a DOS process is the same as the actual hardware IRQ. Placing a colon and an additional IRQ following the normal IRQ, eg (COM1,3F8,IRQ12:IRQ4), causes SIO/VSIO to reflect the IRQ to a DOS process on IRQ4 (in this example) even though the real hardware IRQ is IRQ12. If one wishes SIO to automatically locate the hardware IRQ, then the following construct can be used: (COM1,3F8,:IRQ4). Notice that the hardware IRQ is simply NOT specified. I/O Port Mapping to DOS Process Some DOS programs, such as CompuServe's CIM, insist that COM1 be at I/O port 03F8, COM2 at 02F8, etc. On OS/2 systems, comm ports can have any I/O port address as specified by a command line. If COM1 is not at I/O port 03F8 for some DOS programs, then COM1 can not be used by the DOS program. The SIO command line allows the I/O ports to be mapped to a different address for DOS sessions, eg (COM1,FF80:03F8,IRQ12:IRQ4). In this example, the real COM1 is at FF80 on IRQ12, but is reflected to DOS processes on I/O ports 03F8 at IRQ4. It is NOT necessary to map both the I/O port address and the IRQ. When the I/O port is mapped to a DOS session, the UART will appear at BOTH I/O port addresses (FF80 and 03F8 in the given example). 34 Index 16450 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 16550 Non A . . . . . . . . . . . . . . . . . . . . . . . . . 30 16550A . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 16550AF . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 16550AFN . . . . . . . . . . . . . . . . . . . . . . . . . . 30 16550s Made by Western Digital . . . . . . . . . . . . . . . 31 16C451 . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 16C551 . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 16C552 . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 16C554 . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 8250 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 8250A . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 82510 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Additional Open . . . . . . . . . . . . . . . . . . . . . . . . 5 Addresses and IRQ for COM3 through COM8 on the PS/2 . . . . . 28 Addresses and IRQs for COM1 and COM2 . . . . . . . . . . . . 28 Appendix A, Hardware Notes . . . . . . . . . . . . . . . . . 28 Appendix B, SIO Chips . . . . . . . . . . . . . . . . . . . . 29 Appendix C, Multi-Port Serial I/0 Cards . . . . . . . . . . . 32 Appendix D, Advanced SIO Options . . . . . . . . . . . . . . 33 BBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 CompuServe . . . . . . . . . . . . . . . . . . . . . . . . . . 2 DCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Defacto standard for COM3 and COM4 . . . . . . . . . . . . . 28 Device Control Block . . . . . . . . . . . . . . . . . . . . . 5 Differences between SIO/VSIO and COM/VCOM . . . . . . . . . . 27 Distribution . . . . . . . . . . . . . . . . . . . . . . . . . 2 Driver Initialization . . . . . . . . . . . . . . . . . . . . . 3 DTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 DTR Control Mode . . . . . . . . . . . . . . . . . . . . . 5, 6 Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Extended Set Bit Rate . . . . . . . . . . . . . . . . . . . . 10 FAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . 30, 31 File System Requests . . . . . . . . . . . . . . . . . . . . . 3 First Level Open . . . . . . . . . . . . . . . . . . . . . . . 4 Hold Transmit . . . . . . . . . . . . . . . . . . . . . . . . 13 I/O Port Mapping to DOS Process . . . . . . . . . . . . . . . 33 Initial Open . . . . . . . . . . . . . . . . . . . . . . . . . 5 Input Flush . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Input Status . . . . . . . . . . . . . . . . . . . . . . . . . 3 Intermediate Close . . . . . . . . . . . . . . . . . . . . . . 6 IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 IRQ Reflection to DOS Process . . . . . . . . . . . . . . . . 33 Last Close . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Locked Baud Rate . . . . . . . . . . . . . . . . . . . . . . 33 National Semiconductor Corporation . . . . . . . . . . . . . 29 Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 35 OS2AVEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Output Flush . . . . . . . . . . . . . . . . . . . . . . . . . 4 Output Status . . . . . . . . . . . . . . . . . . . . . . . . . 4 Protection . . . . . . . . . . . . . . . . . . . . . . . . . 33 Query Current Bit Rate . . . . . . . . . . . . . . . . . . . 18 Query Current Modem Input Signals . . . . . . . . . . . . . . 22 Query Current Modem Output Control Signals . . . . . . . . . 22 Query Extended Bit Rate . . . . . . . . . . . . . . . . . . . 19 Query Line Characteristics . . . . . . . . . . . . . . . . . 18 Query Number of Characters in Receive Buffer . . . . . . . . 23 Query Number of Characters in Transmit Buffer . . . . . . . . 23 Query SIO Error . . . . . . . . . . . . . . . . . . . . . . . 24 Query SIO Event Information . . . . . . . . . . . . . . . . . 25 Query SIO Status . . . . . . . . . . . . . . . . . . . . . . 20 Query Transmit Data Status . . . . . . . . . . . . . . . . . 21 Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Read Device Control Block (DCB) . . . . . . . . . . . . . . . 26 Read Enhanced Mode Parameters . . . . . . . . . . . . . . . . 26 RTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 RTS Control Mode . . . . . . . . . . . . . . . . . . . . . 5, 6 Set Bit Rate . . . . . . . . . . . . . . . . . . . . . . . . . 8 Set Break Off . . . . . . . . . . . . . . . . . . . . . . . . 11 Set Break on . . . . . . . . . . . . . . . . . . . . . . . . 14 Set Line Characteristics . . . . . . . . . . . . . . . . . . . 9 Set Modem Control Signals . . . . . . . . . . . . . . . . . . 12 SIO Chips . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Start Transmit . . . . . . . . . . . . . . . . . . . . . . . 13 STB 4COM . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Transmit Byte Immediate . . . . . . . . . . . . . . . . . . . 11 UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 WHAT IS SIO . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Write Device Control Block (DCB) . . . . . . . . . . . . . . 14 Write Extended Mode Parameters . . . . . . . . . . . . . . . 17