Sealevel Systems, Inc. will be closed beginning December 20, 2024. Order processing and communication will resume January 2, 2025.

Asynchronous Advanced UART and USB Serial Support

 

Click for the Advanced Properties Page for USB Serial Ports or scroll to the second section of this article.


 

Advanced UART Settings
(PCI Express, PCI, Compact PCI, PCMCIA, PC/104 and ISA)

Asynchronous serial communication is a data transmission method that does not require a clock for synchronization. It was the communication method used on built-in serial ports (i.e., COM1:, COM2:, …) in the original IBM personal computer. The timing required to decode data is encoded into the characters that are transmitted.

At the heart of most serial ports is a UART chip that provides the asynchronous communication capability. The standard UART on most serial ports is the 16550 compatible UART with a 16-byte receive FIFOand a 16-byte transmit FIFO. The 16550 UART offers no control over the Transmit FIFO, and there is limited control over the threshold at which an interrupt occurs in the receive FIFO.

Over the years, the UART has evolved from basic capabilities to offering many advanced features. On the other end of the spectrum, there are 16850 and 16950 UARTs that provide 128-byte transmit and receive FIFOs and offer complete control over when an interrupt is generated.

While most applications will operate using the default configuration, the Sealevel SeaCOM software suite provides access to these advanced features allowing you to configure your system for optimal performance. These advanced features are accessible in Windows Device Manager.

7205e Advanced Properties

Advanced UART Options
This section identifies the type of UART present on this serial port and the size of the FIFO. These two fields are read-only and are for information only.

Trigger Level
A FIFO is the hardware buffer built into the UART. As characters are received by the UART, they are automatically stored in the FIFO. There is significant overhead each time the operating system has to service the interrupt and start the driver, so it is more efficient to hold the characters in the FIFO until a specific level, called the trigger level, is reached. Once the FIFO has reached the trigger level, the UART issues an interrupt request to the processor and the software driver (SeaCOM.sys) is started. The software driver then reads the characters stored in the FIFO.

If you want to immediately respond to very short messages, set your receive trigger level to 1. This generates an interrupt for each character received, giving you the maximum response to incoming data. This puts the heaviest load on the processor because it has to stop and process each individual character.

If you are receiving a fixed-length 10 character message, set the receive trigger level to 10, and the UART only interrupts the processor for each 10 characters that arrive. All 10 characters are stored in the FIFO, and the processor pulls out all 10 characters at once.

At the other extreme, if you are receiving long data streams, set your receive trigger level to 100, and the UART only interrupts the processor after 100 characters are received. The processor retrieves all 100 characters, leaving you 28 characters of FIFO buffer for any characters that are received while the processor is processing the previous 100 characters in the FIFO.

If the trigger level is not reached, the UART automatically requests an interrupt after about 1.5 to 2 character times have elapsed with no more data being received.

When transmitting, if you are transmitting at least 128 characters, all 128 characters are placed in the transmit FIFO. If you are transmitting less than 128 characters, the entire message is placed in the transmit FIFO. As the UART sends out the characters, it monitors the level in the FIFO. When it falls below the Transmit Trigger Level, it interrupts the processor to refill the FIFO. When there are no more characters to send, the software driver notifies the application that the WriteFile process is complete.

FIFO Enabled
There is usually no reason to disable the FIFO. In the event you want to do so, you can uncheck this box.

Suppress Modem Control Interrupts
If your application is using high speeds and/or a long cable, it is possible to get cross-talk between the conductors in the cable if the cable is not terminated properly. Your data lines could induce signals onto the modem control lines. It’s possible to generate up to five modem control interrupts for each character, you can unknowingly put an extremely high processor load on your system. To suppress modem control interrupts, uncheck the box.

RS-422/485 Control Options

Auto RTS RS-485
A popular method of communicating between a computer and equipment in an industrial environment is to use two-wire RS-485, also called half duplex. Although it is called “two-wire”, there are actually three wires in the cable: Data +, Data – and Ground. One advantage to this form of communication is that you can daisy-chain the cable from the computer to the first piece of equipment then to the second piece of equipment, continuing to the last piece of equipment. Since the signal and its inverse are transmitted on the two data wires, any electrical noise that is induced into the cable affects both wires and can be removed by the receivers. Since all devices share the same two wires, all devices must electrically remove their transmitter from the circuit, referred to as tri-stating your transmitter, so that other devices can talk. Many Sealevel serial adapters handle tri-stating the transmitter in hardware, but there are some situations where the software driver needs to control this. SeaCOM provides the ability to control the tri-stating without involving the application program, which allows existing applications not designed for this form of communication to be used without modification.

If you have a Sealevel product that automatically controls tri-stating, you will not need to check any of these boxes.

If you want SeaCOM to control tri-stating the transmitter, check the ‘Auto RTS RS-485’ check box.

16950 RS-485 Enable
The Oxford 16950 and 16954 UARTs can control tri-stating in hardware. If you have a Sealevel adapter with either of these UARTs, checking this box will cause the UART to control tri-stating instead of the software driver.

RS-485 Echo Off
If you are using two-wire RS-485, your receiver and transmitter are connected together.  Everything you transmit, you will also receive. You can ensure the data was transmitted properly by comparing the data sent with the data you intended to send. You can use this method to catch two devices that are trying to transmit at the same time (called <data contention>). If you are not using this capability, check the RS-485 Echo Off box to supress receiving data while you are transmitting. The application not will see what was tranmitted, only what was received.

PCMCIA Hardware Control
For Sealevel PCMCIA serial cards that can be used in either RS-485 or RS-422 mode, check the radio button to select the correct mode.

Software Selectable Cards
This section applies to Sealevel PC/104 serial cards with software selectable interfaces.

RS-232
The PC/104 cards default to RS-485 mode. If you need RS-232, check this box.

Termination In
If you are using the card in RS-422 or RS-485 mode, you should have the incoming data lines terminated with a 120 ohm resistor between the (+) and (-) lines if the cards are physically at either end of the cable. Do not terminate cards that are not at the cable ends. If the card is installed at the end of the cable and the data lines are not terminated, check this box.

RS-422
As noted above, the card defaults to RS-485. If you want the card in RS-422 mode, check this box and ensure the RS-232 box is not checked.

Echo Enable
If you are using two-wire RS-485, your receiver and transmitter are connected together. Everything you transmit, you will also receive. You can ensure the data was transmitted properly by comparing the data sent with the data you intended to send. You can use this method to catch two devices that are trying to transmit at the same time (called <data contention>). If you want this capability, check the ‘Echo Enable’ box to allow receiving what you send.

RS-485 4-Wire
It is possible to use RS-485 in a four-wire configuration called full duplex. It actually uses five wires, but the Ground is not counted. In this mode, one unit is called the master and its transmitter pairs are connected to all of the slaves’ receivers. All of the slaves’ transmitters are connected to the pair of wires that go to the master’s receiver. While this setup requires twice the wiring, it provide two advantages. The slaves only see the master’s messages, not each other’s responses. Additionally, one slave can respond to the master’s last message while the master sends a message to the next slave, effectively doubling the overall message rate.

16950 ISO Synchronous

Enable Isochronous Mode
The Oxford 16950 UART has the ability to receive a clock signal that is synchronized to the incoming asynchronous data. While the incoming data still has start and stop bits, there is a clock transition in the middle of each bit period. While this clock signal can be used to enable higher data rates, it is usually employed in situations where you have jitter or skew on the data signal, which can happen when using satellites or radio communications. The idea is that the clock signal will be skewed the same as the data signal, and if the receiver uses this clock to decode the data, the data can be received properly.

9-Bit Protocol
9-bit protocol means that there is an additional bit transmitted along with the normal 8-bits of data. The extra bit is set to indicate the remaining 8 bits is an Address. If the extra bit is cleared, it means the remaining 8-bits are data. 9-bit protocol is used in RS-485 communications where you have a master device simultaneously talking to multiple slave devices. Using this method, the receiving station can compare its address to the byte with the address bit set. If they don’t match, the receiver can ignore the remainder of the message. If the extra bit is set, the first character of a WriteFile will be sent with the address bit set and the remainder of the message will be sent with the address bit off. 9-bit protocol is generally used in a “poll-response” situation, so the address/data bit is ignored on reception and only the 8-bits of data is returned to the application.

Oscillator Options
The standard oscillator frequency on most serial ports is 1843200 Hz (1.8432 MHz). The UART examines each bit sixteen times during reception (1843200 / 16 = 115200). The standard oscillator frequency is why most serial ports have a maximum data rate of 115.2K bps (115200 baud). Most Sealevel serial adapters uses 7.3728 MHz or 14.7456 MHz oscillators, which allow you to achieve higher data rates. The oscillator value needs to be entered in this field so that the software driver knows how to configure the UART based on the data rate requested by the software application. Sealevel also allows customers to order a custom oscillator frequency to achieve a specific data rate (i.e., if a customer want to communicate at 500K bps, it would require an 8 MHz oscillator (e.g., 500000 X 16 = 8,000,000). The user would then enter ‘8000000’ into this field.


 

Advanced USB Settings
(USB Serial Ports)

 

USB Advanced Properties

COM Port Number
When you plug in the USB device, the computer system automatically assigns COM port numbers to each port. You can use this drop down box to select a different COM port. Unless you have a specific reason for doing so, you should only select COM port number that are not flagged as being in use. Having two devices assigned to the same port number can prevent either of them from operating properly. You will be warned if you try to set more than one device to a com port number.

USB Transfer Size
The default values are fine for most situations. If you are using very low data rates or sending large buffers at high speed, you can change these values to optimize your throughput. Select lower settings to correct performance problems at low baud rates. Select higher settings for faster performance.

BM Options
The Latency Timer is the value that has the most impact on applications when converting from a traditional serial port to a USB serial port. As data comes into the USB port, the USB hardware accumulates this data in a buffer instead of sending each byte across the USB link. This buffering minimizes the impact on the processor having to service each character. By default, the data will be buffered for 16 milliseconds (16/1000 seconds). If your application needs faster response to incoming data, you can set this value as low as 2, at which point the USB serial adapter will send data every two milliseconds.

Timeouts
The Timeout values are the minimum that can be set by your application. Leave these set to zero unless instructed to change them by Sealevel Technical Support.

Miscellaneous Options

Serial Enumerator
If you are going to connect a serial mouse or serial modem to the USB serial adapter, check the box. Otherwise, leave the box unchecked.

Serial Printer
If enabled, serial printer will disable timeouts to allow for long delays associated with paper loading.

Cancel If Power Off
The Cancel If Power Off option can be used to assist with problems encountered when going into a hibernate or suspend condition. This will cancel any requests received by the driver when going into hibernate or suspend.

Event On Surprise Removal
The Event On Surprise Removal option is generally left deselected. If an application sets SERIAL_EV_EVENT2 in it’s event bitmask and this feature is enabled, the driver will signal this event on surprise removal.

Set RTS on Close
Selecting the Set RTS On Close option will set the RTS signal on closing the port.

Disable Modem Control at Startup
This option is used to control the modem control signals DTR and RTS at startup. In normal operation, the modem control signals at startup follow the behaviour of the legacy port. However, due to timing differences between a legacy COM port and a virtual COM port, a spike on one of these signals in the legacy port can appear as an assertion of the signal in the virtual COM port.

Devices that monitor these signals can enter the wrong state after an unplug/replug cycle on USB.

Note that if the ‘Serial Enumerator’ option in the property page is selected, then the enumeration sequence causes the modem control signals to change at startup. So if it is necessary to select ‘Disable Modem Ctrl At Startup’, then it is likely that ‘Serial Enumerator’ should be unchecked in the property page.