Sealevel Support http://www.sealevel.com/support/category/154 en-us KnowlageBase RSS Generator How to configure UART-based serial adapters in Linux http://www.sealevel.com/support/article/AA-00525

Linux supports the direct use of 16CXXX UART-based devices with drivers included in the kernel sources. Some Sealevel asynchronous serial devices do not currently have their vendor/product IDs included in this driver. It is necessary to either manually identify the UARTs to the driver or modify the driver by adding the vendor/product IDs.


Option 1: Using the Setserial Command Line Utility.

NOTES

  • This procedure is the ONLY method of accessing a PC/104 or ISA device by using standard device drivers.
  • Since the <IO_ADDRESS> and <IRQ_NUMBER> are static in the case of PC/104 and ISA, a distribution's start-up scripts can easily be modified to enable driver attachment. This assumes that no new plug-and-play serial devices will be added later on as they will be overwritten until the start-up scripts are modified.
  • A recent change in the way the serial driver attaches to <MINOR> numbers may prevent more than 4 serial ports to be attached to the driver at any time. This issue can be remedied by changing the CONFIG_SERIAL_8250_NR_UARTS configuration variable and recompiling the kernel module, which means if this is a PCI device, it may be prudent to enable Plug-and-Play capability.

The setserial program is an open source utility to aide in the configuration of the 8250 async serial port driver. It is included with most Linux distributions or available through that distribution’s package management system (check distribution documentation). Alternatively, the source code can be found at the setserial project website.

Once the setserial utility is available, it is necessary to determine the IO addresses and IRQ line for each of the devices UARTs. If this is an ISA or PC/104 device, these options are configured manually with jumpers on the board. If this is a PCI, PCI Express, or PC/104+ device, these are assigned through a combination of BIOS and OS. To determine what IO address and IRQ line has been assigned, use the lspci command as demonstrated. The d switch filters results to any devices with IDs VENDOR:PRODUCT. By leaving the PRODUCT ID blank, ALL Sealevel devices attached to the PCI bus will be displayed. The vvv option tells the command to be as verbose as possible giving us all the information we will need.

$ lspci -d 135e: -vvv

00:0f.0 Serial controller: Sealevel Systems Inc Unknown device 7203 (rev 01) (prog-if 02 16550])
Subsystem: Sealevel Systems Inc Unknown device 7203
Flags: medium devsel, IRQ 11
Memory at ee000000 (32-bit, non-prefetchable) [size=128]
I/O ports at b000 [size=128]
I/O ports at a800 [size=8]
I/O ports at a400 [size=8]

00:11.0 Serial controller: Sealevel Systems Inc Unknown device 7803 (rev 01) (prog-if 02 16550])
Subsystem: Sealevel Systems Inc Unknown device 7803
Flags: medium devsel, IRQ 10
Memory at ed800000 (32-bit, non-prefetchable) [size=128]
I/O ports at a000 [size=128]
I/O ports at 9800 [size=64]

The <IRQ_NUMBER> can easily be extracted from the output of the lspci command. Next to each device is listed the assigned IRQ. This is one of the two pieces of information we need.

The next piece of information can be extracted from the PCI Regions listed in the lspci output. Each PCI device is different, and a certain amount of thinking must be done to determine which region(s) are mapped to the devices UARTs.

  • Most Sealevel devices with 4 or less ports use individual PCI regions to map each UART's 8 IO registers. Look for IO regions that have sizes of 8. There should be X number of size 8 regions (where X is the number of UARTS on the device).
  • Many newer devices and 16 port devices use one large PCI region to map all of the devices UARTs IO registers. Look for IO regions that have sizes that are 8 times the number of UARTs.
  • This information is usually contained within the device manual. If you are unable to determine the correct IO space, please contact Sealevel's Technical Support for assistance.

Once you know which region(s) correspond to which UARTs, you are interested in the <IO_ADDRESS>. This is a 4-digit hexadecimal number.

Now that all the necessary information has been gathered, it is time to use the setserial utility to attach a device to the 8250 driver. Each UART must be assigned, one at a time, using setserial.

# setserial /dev/ttyS# port <IO_ADDRESS> irq <IRQ_NUMBER> baud_base X

* The baud_base parameter is very, very important. Without a value > 0, the setserial command will fail. The proper baud_base is dependent on the particular piece of hardware being used. The product manual should be consulted to identifiy the proper baud_base.

The /dev/ttyS# (where # is an integer) must correspond to an existing device file. If there aren't enough device files, they can be created with the following command. The <MAJOR> is determined by the 8250 driver, and the <MINOR> is the next incremental integer. ($ ls -al /dev/ttyS#-1 to see what they should be)

# mknod /dev/ttyS# c <MAJOR> <MINOR>


Option 2:  Modify 8250 Driver to Include Sealevel Product/Vendor IDs.

NOTES

  • This method requires kernel sources (NOT HEADERS). These can usually be obtained through the distribution's package management system. Alternatively, the vanilla kernel sources can be downloaded from kernel.org. Recompiling the Linux kernel goes beyond the scope of this document, and may be different depending on the distribution used. Consult the distribution's documentation concerning module building.
  • This method could also be necessary if more than 4 8250 serial ports must be used at the same time. This requires modifying the kernel's configuration to support more ports.
  • For instructions on adding a specific product configuration, contact Sealevel technical support.

Navigate to the directory containing kernel sources (usually /usr/src/linux).

First, verify that the desired device is not already supported by the 8250 driver. Open the header file pci_ids.h located in the include/linux subdirectory.  Find the keyword "SEALEVEL". There will be a list of definitions assigning macro names like "PCI_DEVICE_ID_SEALEVEL_*" to hexadecimal Sealevel product IDs. Scan through the list looking for your device's product number. If it is listed, then that device is already supported by the 8250 driver. If it is not listed, make a new entry with a unique macro name and the corresponding product ID.

.../include/linux/pci_ids.h
#define PCI_DEVICE_ID_SEALEVEL_COMM8   0x7801     //existing entry
#define PCI_DEVICE_ID_SEALEVEL_UCOMM8  0x7804     //new entry

Next, add the device to the 8250's device detection code. Edit the 8250_pci.c file located in the drivers/serial/ subdirectory. Again, find the keyword "SEALEVEL". There will be an array of pci_device structs. Scroll to the last entry with a SEALEVEL vendor macro. Make a new entry using the product ID that was created in the previous step. The last element of this entry will be a descriptor to a specific board configuration, which is hardware dependent.

.../drivers/serial/8250_pci.c
{PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_8_115200 },
{PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_8_115200 },

Next, verify that a reasonable number of 8250 serial ports can be allocated by the device driver. Edit the .config file located in the root of the kernel source directory. Search for the keyword "CONFIG_SERIAL_8250". Verify that appropriate values are used for each variable.

.../.config
CONFIG_SERIAL_8250_NR_UARTS=48
CONFIG_SERIAL_8250_RUNTIME_UARTS=48

Now recompile the driver module, remove the old module and insert the new one.


]]>
Thu, 22 Dec 2011 22:02:56 -0500
How to configure USB serial adapters in Linux http://www.sealevel.com/support/article/AA-00524

The serial USB driver in Linux contains many product IDs for Sealevel devices. However, the newest devices may not be currently included in the driver. This guide consists of example USB device installation instructions using either driver load time parameters or modification of the device driver to natively support the device. There are often subtle differences in Linux distributions. Any distribution specific conflicts should be resolved by consulting the distribution's documentation. 


Option 1: Serial USB Installation Instructions (No Recompile Necessary)

Notes:

  • Commands preceded by '$' can be issued by user-level privileges.
  • Commands preceded by '#' require root-level privileges.
  • This method will ONLY work with single and dual port devices. Any device with more than two ports requires a driver modification and recompile (see Option 2 below).

1) Plug in the Sealevel USB device(s).

2) Open a terminal window and attain root privileges. This varies by distribution, but the most common method is to use the su command as demonstrated below.

$ su -
Password:
#

3) Ensure that the device has been detected by the USB subsystem. This can be accomplished by using the lsusb command as demonstrated below. The -s 0c52 parameter returns only information about Sealevel devices attached to the system's USB subsystem. For this example, we will attach the device driver to the e402 Sealevel hardware, which is the USB to RS-485 bridge used in Sealevel SeaI/O U-series data acquisition modules.

# lsusb -s 0c52
Bus 002 Device 011: ID
0c52:e402 Sealevel Systems, Inc.
Bus 002 Device 010: ID 0c52:2101 Sealevel Systems, Inc. 

4) The kernel driver module for all FTDI based USB serial devices is sometimes configured for automatic load at boot time. Depending on distribution, it may be necessary to unload the driver if it is already loaded. This can be achieved by issuing the following command. This command can be issued without detriment when the driver is not loaded.

# modprobe -r ftdi_sio

5) The FTDI serial USB driver in Linux contains many product IDs for Sealevel devices. However, the newest devices may not be currently included in the driver. The driver allows a single vendor and product pair to be passed at module load time. Using these parameters, it is unnecessary to recompile the driver. To inform the FTDI driver of the Sealevel device's identification information, issue the following command.

# modprobe ftdi_sio vendor=0x0C52 product=0xE402

6) The driver should now have identified the Sealevel device and is ready for communications. It may now be necessary to create the character special file used to interface with the device. Most modern distributions include a method of automatically creating these files in the /dev file system when they are identified by a device driver. The character special files typically use the ttyUSB# nomenclature. Verify their creation by issuing the following command.

# ls -al /dev/ttyUSB*
crw-rw----1 root uucp 188, 0 2008-05-08 10:59 /dev/ttyUSB0
crw-rw----1 root uucp 188, 1 2008-05-08 10:59 /dev/ttyUSB1

7) If the character special files have not been created automatically, or more than one appears, it is necessary to identify the driver major and device minor numbers. The driver major can be determined by searching the devices file in the /proc file system as demonstrated in the following command. The major number is highlighted in yellow below.

# cat /proc/devices | grep -i "ttyUSB"
188 ttyUSB

The device minor number can also be determined by searching a file located in the /proc file system. The tty directory contains information about all of the currently loaded tty drivers. Executing the next command will display a list of all USB serial ports detected by any USB serial drivers currently loaded. If multiple USB serial ports are detected by the system, identify which corresponds to the Sealevel device by checking the vendor and product IDs.

# cat /proc/tty/driver/usbserial
usbserinfo:1.0 driver:2.0
0: module:ftdi_sio name:"FTDI USB Serial Device" vendor:0c52 product:2101 num_ports:1
port:1 path:usb-0000:00:1d.1-1.2
1: module:ftdi_sio name:"FTDI USB Serial Device" vendor:0c52 product:e402 num_ports:1
port:1 path:usb-0000:00:1d.1-1.4

8) If the character special file for the Sealevel device was not present in step 6, it may be created by executing the following command. It may also be beneficial to you to create any extra special files corresponding to other USB serial devices that are not currently present. Be sure to replace the major and minor numbers listed below with those listed by the commands demonstrated in step 7 as they may vary from system to system.

# mknod /dev/ttyUSB0 c 188 0
# mknod /dev/ttyUSB1 c 188 1

9) User applications may now interactive with Sealevel device through the character special file with major and minor numbers corresponding to those determined in step 7. To check the major and minor numbers that are associated with the character special files in /dev file system, use the ls command as demonstrated. The major/minor pair is highlighted in yellow for each file.

# ls -al /dev/ttyUSB*
crw-rw----1 root uucp 188, 0 2008-05-08 10:59 /dev/ttyUSB0
crw-rw----1 root uucp 188, 1 2008-05-08 10:59 /dev/ttyUSB1

10) Ensure that all users account which must access the Sealevel device may do so. There are many ways to configure the file permissions to accomplish this goal, depending on the system and requirements. Distribution documentation on the chmod and chown commands should be consulted. To simply allow full access to any USB serial device, use the following command.

# chmod 777 /dev/ttyUSB*

The Sealevel device can now be accessed through the character special file corresponding to the major/minor pair of the device. In the examples shown here, the file would be /dev/ttyUSB1.


Option 2: Serial USB Installation Instructions (Hardcoded Driver Support)

Notes:

  • Commands preceded by '$' can be issued by user-level privileges.
  • Commands preceded by '#' require root-level privileges.
  • This is the ONLY way a device with more than 2 ports will work in Linux.
  • This method requires full Kernel source (see your distribution documentation for specific instructions to acquire and configure)

1) Open the ftdi_sio.h file for editing located in your kernel source directory.
(<source>/drivers/usb/serial/ftdi_sio.h)

2) Search for SEALEVEL_VID. This will bring you to a list of #define's for Sealevel USB serial devices.

3) Add new entries for each Sealevel listing discovered with the lspci command as described in Step 3 of the previous section.

...
#define SEALEVEL_2803_8_PID 0x2883 // SeaLINK+8 2803
#define SEALEVEL_E402_PID   0xE402 // << adding new E402 product ID
...

4) Close and save the changes to the header file.

5) Next open the ftdi_sio.c file for editing. It is located in the same directory as the header file.

6) Search for SEALEVEL_VID. This will bring you to an array of vendor/product id structures.

7) Add new entries for each new #define added in Step 3.

...
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) },
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_E402_PID) }, // << adding new E402 ID
...

8) Now recompile kernel driver modules. Consult your specific distribution documentation.

# cd <source>
# make modules && make modules_install

9) Now reload the ftdi_sio kernel module.

# modprobe -r ftdi_sio
# modprobe ftdi_sio

10) Continue from Step 6 of Option 1 above.


]]>
Thu, 22 Dec 2011 22:02:26 -0500
How to integrate the 2107 USB to serial adapter into your RS-485 network http://www.sealevel.com/support/article/AA-00523

The 2107 is designed for two-wire (half duplex) RS-485 applications and provides reduced wiring costs and protection against EMI and other induced line noise.

2107 TB34 Application Example

To integrate the 2107 with your RS-485 network, start by installing the 2107 per the instructions in the user manual. Since termination and biasing are always present on the 2107, it can be placed at either end of your RS-485 network. Detach the included removable terminal block adapter (TB34) from the 2107. Wire the terminal block on the TB34 as noted in the table.

2107 Pin Out Table

Connect the TB34 to the 2107's DB9M connector and secure the thumbscrews. Your 2107 is now ready to communicate with other RS-485 devices at data rates up to 921.6K bps.


]]>
Wed, 07 Dec 2011 21:23:34 -0500
How to fix "crazy mouse" syndrome with USB serial adapters http://www.sealevel.com/support/article/AA-00487

Overview
This condition is potentially encountered in Microsoft Windows when connecting a serial GPS device to a serial port. It is caused when the NMEA 0183 GPS serial data is misinterpreted as mouse data by the serial port enumerator (serenum.sys), resulting in erratic mouse cursor activity. The following steps will cure the "crazy mouse" syndrome with Sealevel USB to serial adapters. The instructions were tested in Windows 7 and can be adapted for Windows Vista or XP operating systems.

    Unplug or Disable the Serial GPS Device

  1. To gain control of the mouse, first make sure that the attached NMEA data source (e.g., GPS, AIS, Sonar) is either powered off or unplugged from the serial port on the USB serial adapter.
  2. Keep the USB to serial adapter connected to the USB port.

  3. Locate the USB Serial COM Port in Windows Device Manager

  4. Click on the Start menu.
  5. Right click on 'Computer' ('My Computer' in Windows XP).
  6. In the fly-out menu, left click 'Manage', as shown.


  7. In the 'Computer Management' window, left click on Device Manager.
  8. In the right pane, expand the ‘Ports (COM & LPT)’ section by clicking on the triangle ('+' symbol in Windows XP), as shown.
  9. Under 'Ports (COM & LPT)', double click on the USB serial device entry to bring up the Device Properties dialog box. Sealevel devices will be labeled 'SeaLINK' or 'SeaPORT'.



  10. Disable the Serial Port Enumerator (Serenum.sys)

  11. In the Device Properties window, click the 'Port Settings' tab.
  12. Then click the 'Advanced' button, as shown, to open the Advanced Settings window.


  13. In the Advanced Settings window, locate the Miscellaneous Options section and uncheck the box for 'Serial Enumerator', as shown. This will prevent serenum.sys from being associated with this COM port.


  14. Click the OK button to confirm your changes.
  15. Click the OK button to close the Device Properties window.
  16. Close the Computer Management window by clicking the 'X' in the top-right corner.

Contact our technical support department if you continue to experience symptoms of "crazy mouse" syndrome.


]]>
Mon, 28 Feb 2011 23:59:48 -0500
Why don’t standard asynchronous serial adapters support 9-bit protocols? http://www.sealevel.com/support/article/AA-00462

Applications that require 9-bit protocols are rare so the chips that support them are more expensive than standard 8-bit UARTs.

Most 8-bit UARTs can simulate 9-bit protocols by setting the parity bit to mark or space. This was an easy solution on the 16C450 UART and other 8-bit UARTs without FIFO buffers. Modern 8-bit UARTs like the 16C550 and 16C850 have FIFO buffers that make 9-bit support more complicated to implement.

The 16C950 UART and 16C954 quad-port UART solve this issue by including 9-bit data buffers in hardware. Most Sealevel asynchronous serial adapters can be upgraded with 16C950 or 16C954 UARTs for a nominal charge. Call for details.

Note: USB serial adapters use a different communications chipset and cannot support 9-bit data framing.


]]>
Tue, 31 Aug 2010 15:51:26 -0400
What Sealevel asynchronous serial adapters support 9-bit protocols? http://www.sealevel.com/support/article/AA-00461

Any Sealevel asynchronous serial adapter that includes a 16C950 UART or 16C954 quad-port UART natively supports 9-bit framing in hardware. USB serial adapters use a different chipset and are not capable of 9-bit data framing. Other Sealevel serial adapters can be upgraded with a 16C950 or 16C954 UART for a nominal charge. Call for details.


]]>
Tue, 31 Aug 2010 15:50:09 -0400
How do I perform a loopback test with my serial adapter configured for 2-wire RS-485? http://www.sealevel.com/support/article/AA-00460

2-wire RS-485 connects the transmitter and receiver to the same data channel. Many applications are not designed to receive the same data they are transmitting and expect the serial port to be set to ‘No Echo’. Therefore, when the serial port is transmitting data, the receiver is disabled. For this reason an external loopback adapter will not work with 2-wire RS-485.

To successfully perform a loop back test with 2-wire RS-485, the easiest method is to connect two adjacent serial ports together and use the BERT function in WinSSD. Set the first port to transmit and, the second port to receive and verify the data sent is the data received. Next, set the first port to receive and the second port to transmit to complete the loopback test.

On single port serial adapters configured for 2-wire RS-485, enable ‘Echo’ to allow the receiver to listen during transmission. This allows you to perform an internal loopback test. No external loopback adapter is required.

Note: Some single-port 2-wire RS-485 adapters do not support ‘Echo’. These must be configured for RS-422 or 4-wire RS-485 in order to perform a loopback test.


]]>
Tue, 31 Aug 2010 15:39:08 -0400
USB-to-Synchronous Cable Enables IP Data Communications for Tactical Radios http://www.sealevel.com/support/article/AA-00454

The ACC-188 USB synchronous serial radio adapter (Item# 9065) and free software from DISA enables tactical radios with the capability to transmit and receive IP data such as email, text messages, GPS maps, images, coordinates, and other communications. The system is nonproprietary and MIL-STD-188-184 compliant, allowing for interoperability with various radios without multiple connections or additional equipment.

Learn how warfighters can benefit greatly from having fully interoperable radio IP-based data communications at the theater level in our "USB to Synchronous Cable Enables IP Data Communications for Tactical Radios" White Paper. Download the PDF file below.


]]>
Tue, 29 Jun 2010 15:04:09 -0400
How to change asynchronous serial COM Port assignments in Sealevel’s Port Manager or Advanced Ports Utilities http://www.sealevel.com/support/article/AA-00442

Sealevel recommends using the installed COM numbers if at all possible to avoid system conflicts. If you previously installed a USB or PCMCIA serial interface, it will still have resources that have been assigned by the operating system. If the device is not currently connected to your computer, these COM assignments will not be apparent. It is possible to force a new COM port assignment when the device is removed that will create a conflict when the device is reconnected at a later time.

One scenario where you would have to change the COM port assignments is when your legacy application only works at COM1 through COM4 and the Sealevel serial device you installed comes in at COM5 or higher. Another scenario might occur when you install a multiport serial card and the COM port numbers are not assigned consecutively and you want them to appear consecutive.

Windows 95, 98, ME, and NT did not provide a way to change COM port assignments in Device Manager. Sealevel developed the Port Manager utility (Advanced Ports in NT) to address this Windows limitation. Port Manager is automatically installed when you install the SeaCOM serial driver. In Windows NT, the SeaCOM software driver installs the Sealevel Advanced Ports utility in the Control Panel.

To change COM port assignments using Port Manager in Windows 95, 98, or ME operating systems, follow these steps:

1) Click Start -> All Programs -> SeaCOM -> Port Manager


2) In the Port Manager window, select your current Device in the table by clicking on it to highlight.


3) Change the COM port assignment by choosing an available COM number in the Port Name drop box.


4) Click on the Apply button, and then the OK button to confirm changes.


5) Verify your changes in Device Manager under the Ports (COM & LPT) listing.



To change COM port assignments using Advanced Ports in Windows NT, follow these steps:

1) Click Start -> Control Panel
2) In the Control Panel window, double-click the Advanced Ports icon.
2) In the Advanced Ports window, select your current Device in the table by clicking on it to highlight.
3) Change the COM port assignment by choosing an available COM number in the Port Name drop box.
4) Click on the Apply button, and then the OK button to confirm changes.
5) Verify your changes in Device Manager under the Ports (COM & LPT) listing.

Contact our technical support department if you are still experiencing problems with serial COM port assignments.


]]>
Fri, 30 Apr 2010 21:13:26 -0400
How to change asynchronous serial COM port assignments in Windows Device Manager http://www.sealevel.com/support/article/AA-00441

Sealevel recommends using the installed COM numbers if at all possible to avoid system conflicts. If you previously installed a USB or PCMCIA serial interface, it will have resources assigned by the operating system. If the device is not currently connected to your computer, these COM assignments will not be apparent and forcing new COM port assignments will create a conflict when the devices are reconnected at a later time.

One scenario where you would have to change the COM port assignments is when your legacy application only works at COM1 through COM4 and the Sealevel serial device you installed comes in at COM5 or higher. Another scenario might occur when you install a multiport serial card and the COM port numbers are not assigned consecutively and you want them to appear consecutive.

In Windows 7, Vista, XP or 2000 operating systems, you can change the COM number assignment using Windows Device Manager.  To change the COM port assignments in Device Manager, follow these basic steps:

1) Click the Start button.

2) Right-click on My Computer.

3) In the fly-out menu, click Manage.

4) In the Computer Management Window, click on Device Manager.


5) In the right-hand pane, expand the Ports (COM & LPT) listing by clicking the "+" symbol.


6) Right-click on the COM number you want to change and select Properties from the fly-out menu.


7) In the Communications Port Properties window, click the Port Settings tab and then click the Advanced button.


8) In the Advanced Settings window, you can select the new COM port number from the drop box (be careful not to select a COM number already in use).


9) Click the OK button to confirm your changes. If Windows detects a conflict, choose another COM port number.


10) Click the OK button to close the Communications Port Properties window.

11) When Device Manager refreshes the hardware list, the COM assignment will reflect your changes. To get Device Manager to refresh the window on Windows XP, you may need to click 'Action' in the menu and then click 'Scan for hardware changes' in the sub-menu (Note: If 'Scan for hardware changes' isn't listed in the sub-menu, click on the computer name in the right pane and then repeat this step).



Contact our technical support department if you are still experiencing problems with serial COM port assignments.


]]>
Fri, 30 Apr 2010 20:48:38 -0400
Overview of Serial Communication Standards http://www.sealevel.com/support/article/AA-00148

Asynchronous Communications Overview
Asynchronous communications is the standard means of serial data communication for PC compatibles and PS/2 computers. Serial data communications implies that individual bits of a character are transmitted consecutively to a receiver that assembles the bits back into a character. Data rate, error checking, handshaking, and character framing (start and stop bits) are predefined and must correspond at both the transmitting and receiving ends. Serial asynchronous communications is typically implemented with a Recommended Standard (RS). The standard usually defines signal levels, maximum bandwidth, connector pin-out, supported handshaking signals, drive capabilities, and electrical characteristics of the serial lines. The following sections briefly describe some of the more common communication standards. Voltage levels that are stated are typical and may vary due to line characteristics. All interfaces accept a range of acceptable electrical and physical parameters and may even operate in excess to the specified standard under certain line characteristics. The full specification for each standard is available from almost any dealer of engineering documents. For a more detailed explanation of asynchronous serial communications, Sealevel technical support recommends the book Technical Aspects of Data Communications by John E. McNamara, published by Digital Press (DEC) 1982.

Synchronous Communications Overview
"Synchronous Communications is used for applications that require higher data rates and greater error checking procedures. Character synchronization and bit duration are handled differently than asynchronous communications. Bit duration in synchronous communications is not necessarily predefined at both the transmitting and receiving ends. Typically, a clock signal is provided in addition to the data signal. This clock signal will mark the beginning of a bit cell on a predefined transmission. The source of the clock is predetermined and sometimes multiple clock signals are available. For example, if two nodes want to establish synchronous communications, point A could supply a clock to point B that would define all bit boundaries that A transmitted to B. Point B could also supply a clock to point A that would correspond to the data that A received from B. This example demonstrates how communications could take place between two nodes at completely different data rates.

Character synchronization with synchronous communications is also very different from the asynchronous method of using start and stop bits to define the beginning and end of a character. When using synchronous communications, a predefined character or sequence of characters is used to let the receiving end know when to start character assembly. This predefined character is called a sync character or sync flag. Once the sync flag is received, the communications device will start character assembly. Sync characters are typically transmitted while the communications line is idle or immediately before a block of information is transmitted. To illustrate with an example, let's assume that we are communicating using eight bits per character. Point A is receiving a clock from point B and sampling the receive data pin on every upward clock transition. Once point A receives the pre-defined bit pattern (sync flag), the next eight bits are assembled into a valid character. The following eight bits are also assembled into a character. This assembly will repeat until another pre-defined sequence of bits is received (either another sync flag or a bit combination that signals the end of the text, i.e., EOT). The actual sync flag and protocol varies depending on the sync format (SDLC, BISYNC, etc.).

Serial communications, synchronous or asynchronous is typically implemented with a Recommended Standard (RS). In most cases, the standard is set by the Electronic Industries Association (EIA). The standard usually defines signal levels, maximum bandwidth, connector pin-out, supported handshaking signals, drive capabilities, and electrical characteristics of the serial lines. The following section briefly describes some of the more common communication standards. Voltage levels stated are typical and may vary due to line characteristics. All interfaces accept a range of acceptable electrical and physical parameters and may even operate in excess to the specified standard under certain line characteristics. The full specification for each standard is available from a number of engineering document dealers. For a detailed explanation of serial communications, please refer to the book Technical Aspects of Data Communications by John E. McNamara, published by Digital Press (DEC) 1982."

Electrical Interface Standards

RS-232
Probably the most widely used communication standard is RS-232. This implementation has been defined and revised several times and is often referred to as RS-232C or EIA-232. The most common implementation of RS-232 is on a standard 25 pin D sub connector, although the IBM PC computer defined the RS-232 port on a 9 pin D sub connector. Both implementations are in wide spread use. RS-232 is capable of operating at data rates up to 20 Kbps / 50 ft. The absolute maximum data rate may vary due to line conditions and cable lengths. RS-232 often operates at 38.4 Kbps over very short distances. The voltage levels defined by RS-232 range from -12 to +12 volts. RS-232 is a single ended interface, meaning that a single electrical signal is compared to a common signal (ground) to determine binary logic states. A voltage of +12 volts (usually +3 to +10 volts) represents a binary 0 and -12 volts (-3 to -10 volts) denotes a binary 1.

RS-422
The RS-422 specification defines the electrical characteristics of balanced voltage digital interface circuits. RS-422 is a differential interface that defines voltage levels and driver / receiver electrical specifications. On a differential interface, logic levels are defined by the difference in voltage between a pair of outputs or inputs. In contrast, a single ended interface, for example RS-232, defines the logic levels as the difference in voltage between a single signal and a common ground connection. Differential interfaces are typically more immune to noise or voltage spikes that may occur on the communication lines. Differential interfaces also have greater drive capabilities that allow for longer cable lengths. RS-422 is rated up to 10 Megabits per second and can have cabling 4000 feet long. RS-422 also defines driver and receiver electrical characteristics that will allow 1 driver and up to 32 receivers on the line at once. RS-422 signal levels range from 0 to +5 volts. RS-422 does not define a physical connector.

RS-423
The RS-423 specification defines the electrical characteristics of unbalanced voltage digital interface circuits. The voltage levels defined by RS-423 range from -5 to +5 volts. RS-423 is a single ended interface, meaning that a single electrical signal is compared to a common signal (ground) to determine binary logic states. A voltage of +5 volts represents a binary 0 and -5 volts denotes a binary 1. RS-423 is rated up to 100K bits per second. RS-423 defines driver and receiver electrical characteristics. RS-423 does not define a physical connector.

RS-449
RS-449 (a.k.a. EIA-449) compatibility means that RS-422 signal levels are met, and the pin-out for the DB-37 connector is specified. The EIA (Electronic Industry Association) created the RS-449 specification to detail the pin-out, and define a full set of modem control signals that can be used for regulating flow control and line status.

RS-485
RS-485 is backwardly compatible with RS-422; however, it is optimized for partyline or multi-drop applications. The output of the RS-422/485 driver is capable of being Active (enabled) or Tri-State (disabled). This capability allows multiple ports to be connected in a multi-drop bus and selectively polled. RS-485 allows cable lengths up to 4000 feet and data rates up to 10 Megabits per second. The signal levels for RS-485 are the same as those defined by RS-422. RS-485 has electrical characteristics that allow for 32 drivers and 32 receivers to be connected to one line. This interface is ideal for multi-drop or network environments. RS-485 tri-state driver (not dual-state) will allow the electrical presence of the driver to be removed from the line. The driver is in a tri-state or high impedance condition when this occurs. Only one driver may be active at a time and the other driver(s) must be tri-stated. The output modem control signal Request to Send (RTS) controls the state of the driver. Some communication software packages refer to RS-485 as RTS enable or RTS block mode transfer. RS-485 can be cabled in two ways, two wire and four wire mode. Two wire mode does not allow for full duplex communication, and requires that data be transferred in only one direction at a time. For half-duplex operation, the two transmit pins should be connected to the two receive pins (Tx+ to Rx+ and Tx- to Rx-). Four wire mode allows full duplex data transfers. RS-485 does not define a connector pin-out or a set of modem control signals. RS-485 does not define a physical connector.

RS-530
RS-530 (a.k.a. EIA-530) compatibility means that RS-422 signal levels are met, and the pin-out for the DB-25 connector is specified. The EIA (Electronic Industry Association) created the RS-530 specification to detail the pin-out, and define a full set of modem control signals that can be used for regulating flow control and line status. The RS-530 specification defines two types of interface circuits, Data Terminal Equipment (DTE) and Data Circuit-Terminating Equipment (DCE). The Sealevel Systems adapter is a DTE interface.

Current Loop
This communication specification is based on the absence or presence of current, not voltage levels, over the communication lines. The logic of a Current Loop communications circuit is determined by the presence or absence of current (typically + or - 20mA). When referring to the specification, the current value is usually states (i.e. 20mA Current Loop). Current Loop is used for point to point communication and there are typically two current sources, one for transmit and one for receive. These two current sources may be located at either end of the communication line. To ensure a proper current path to ground, or loop, the cabling of two current loop communication ports will depend on the location of the current sources. Current Loop is normally good for data rates up to 19.2 Kbps. This limitation is due to the fact that the drivers and receivers are usually optically isolated circuits that are inherently slower than non-isolated equivalent circuits.

MIL-188
This communications standard comes is two varieties, MIL-188/C and MIL-188/114. Both of these interfaces are military standards that are defined by the US Department of Defense. MIL-188/114 is a differential interface and MIL-188/C is an unbalanced or single ended interface. Both MIL-188 interfaces are implemented on an RS-530 connector. MIL-188/C and MIL-188/114 have signal levels from +6 volts to -6 volts and are ideal for long distances at high speeds.


]]>
Wed, 09 Dec 2009 14:04:45 -0500
Eliminate the Risk of RS-485 Data Corruption http://www.sealevel.com/support/article/AA-00147 How-To Overcome the Perils of Moving Data via RS-485

I. Background and Objective
The RS-485 communications standard was introduced in 1983 by the Electronic Industries Alliance (EIA) as a two-wire, half-duplex, multi-drop alternative to the point-to-point RS-232 interface. (Note: RS-485 can also be wired using 4-wires to enable full-duplex communication). RS-485 uses differential signaling to allow up to 32 devices to communicate peer to peer at distances up to 4000 feet. However, the EIA RS-485 specification does not stipulate the method for controlling the driver, therefore a number of alternatives have evolved.

Learn which method is most effective for minimizing the risk of communication errors in our "Eliminate the Risk of RS-485 Data Corruption" White Paper (138kb printer-friendly PDF). Download the file below.

RS-485 Data Contention Image

]]>
Wed, 09 Dec 2009 14:04:28 -0500
What Is 9-Bit Data Framing? http://www.sealevel.com/support/article/AA-00146

Definition of 9-bit framing
9-bit data framing is a simple, yet effective, method of allowing many embedded devices on a multidrop network to maximize processing time. This data transfer method is designed to improve the performance of the embedded devices in these networks.

Typical 5-8 bit data framing
When using typical 5-8 bit data framing, a communication layer protocol must be used to identify the target of the message. In order for the target to ensure it gets the message, it must constantly check incoming data to see if it is a message intended for the device. This continuous data checking reduces the amount of processing time available to the embedded device.

How 9-bit framing saves time
Many embedded multidrop devices can use 9-bit data framing to significantly reduce wasted time checking network messages. 9-bit data framing uses the bit typically associated with parity error detection (see figure 1) to identify address messages. Embedded devices equipped to communicate using 9-bit data framing will ignore any serial data that does not have the address bit set unless it has previously identified an address message associated with it.

Figure 1. Comparison of 8-bit and 9-bit Asynchronous Data Framing

When a command needs to be sent to a device, the action is triggered by first sending an address message which all of the embedded devices will check. If the address identified is not associated with the device, it will simply go back to its normal tasks ignoring any incoming data messages. If the address identified indicates the next data messages are intended for the device, it will act on the messages appropriately.

9-bit data framing is a simple, yet effective, method of allowing many embedded devices on a multidrop network to maximize processing time.

]]>
Wed, 09 Dec 2009 14:04:14 -0500
Test Report: USB to Serial Adapter Designs http://www.sealevel.com/support/article/AA-00145

Impact of Architecture on Performance of USB to Serial Adapters

"We were stunned at the performance difference
between brands of multiport USB to serial adapters."
Design architecture is the critical element.

Findings
There is a significant difference in performance between the "Sealevel architecture" and "industry average architecture" for USB serial adapters. Performance testing of 8-port USB serial adapters proved that the architecture determines the maximum baud rate and more importantly, the throughput of connected serial devices.

USB to 8-Port RS-232 Serial Adapters Peak Sustained Data Rates

The "Sealevel architecture" uses a USB UART interface that delivers significantly faster and more reliable communications.

The "industry average architecture" 8-port USB serial adapter utilizes a USB microcontroller and a single FPGA wired to all eight serial ports. The interface between the microcontroller and FPGA creates a bottleneck because the serial devices are sharing the throughput of the microcontroller. As a result, each additional serial device added substantially reduces the speed of all eight serial ports.

Learn how multiport USB serial architecture affects your applications in our Test Report: Impact of Architecture on Performance of USB to Serial Adapters (pdf) white paper. Download the file below.

All Sealevel USB serial adapters have a dedicated USB UART design. Click on the link to see our full line of USB serial adapters.


]]>
Wed, 09 Dec 2009 14:03:55 -0500
SeaI/O RS-232 Communication via Bluetooth http://www.sealevel.com/support/article/AA-00144

Bluetooth Communication
Communicating via wireless connection has become commonplace in the 21st century. Cell phones, laptops, PDAs and other electronics constantly remind us of this trend. As this capability has become more widespread, so has the desire to enjoy the benefits of wireless communications in traditionally wired applications. In this application note, you will see several examples showing the benefits of accessing Sealevel SeaI/O RS-232 data acquisition modules via a Bluetooth wireless connection.

Bluetooth is an open specification for seamless wireless short-range communications to establish a Personal Area Network, or "PAN", between electronic devices. Sealevel offers a Bluetooth serial adapter (Item # BT-SD100) that interfaces to SeaI/O RS-232 data acquisition modules to allow wireless communication with any Bluetooth enabled host up to 100 meters away. An included RJ45 to DB9 cable connects the SeaI/O device with the RS-232 to Bluetooth adapter and supplies the required 5V power. Using the Sealevel universal mounting plate (Item # KT125), the Bluetooth adapter is easily mounted to the SeaI/O module using a plastic or Velcro tie wrap as shown below.

SeaI/O RS-232 module with Bluetooth adapter mounted to universal mounting bracket

Image 1: Sealevel SeaI/O RS-232 module with Bluetooth adapter mounted to universal mounting bracket (Item# KT125)

For applications where it’s not convenient to mount the Bluetooth serial adapter to the SeaI/O module, standard DB9 RS-232 serial extension cables can be used to extend the Bluetooth adapter further away from the SeaI/O module. Since SeaI/O RS-232 modules provide power through the cable, extra cables and bulky power supplies are not needed to power the Bluetooth serial adapter.

SeaI/O module with remote mounted Bluetooth adapter

Image 2: Sealevel SeaI/O module with remote mounted Bluetooth adapter

Once connected to the Bluetooth adapter, the SeaI/O module is easily accessed via any Bluetooth enabled host as shown in the following examples:

Bluetooth Enabled PDA Host:
A Bluetooth enabled PDA running a mobile supervisory monitoring and control program communicates with a Bluetooth enabled SeaI/O module. SeaI/O modules are a convenient way to expand your supervisory control system with optically isolated inputs, Reed and Form C relay outputs, and TTL interfaces to industry standard relay racks.

Bluetooth enabled PDA allows mobile monitoring and control of Bluetooth enabled SeaI/O module

Image 3: A Bluetooth enabled PDA allows mobile supervisory monitoring and control of a Bluetooth enabled SeaI/O module

Bluetooth Enabled Laptop Host:
A Bluetooth enabled laptop running a third-party monitoring and control program interfaces two separate Bluetooth enabled SeaI/O RS232 modules. Each SeaI/O module operates as a separate slave device. Up to seven Bluetooth enabled slave devices can communicate concurrently with the host laptop.

Laptop running third-party monitoring and control program accesses data from different SeaI/O modules via Bluetooth

Image 4: A laptop running third-party monitoring and control program accesses data from different SeaI/O modules via Bluetooth

Bluetooth Enabled HMI Host:
A Bluetooth enabled host HMI system is used to interface to a network of SeaI/O modules. The Bluetooth serial adapter adds a wireless Bluetooth connection to the first SeaI/O RS232 module. Up to 246 additional SeaI/O expansion modules can be added to the network via convenient RS-485 pass-through connectors on the SeaI/O module. This overcomes the traditional point-to-point limitation of RS-232 and the seven device limitation of Bluetooth.

Host HMI system allows wireless monitoring of SeaI/O module and control via touchscreen

Image 5: Host HMI system allows wireless monitoring of SeaI/O module and control of I/O via touchscreen input

Existing monitoring and control programs that use a wired RS-232 serial port will work using a wireless Bluetooth connection. Applications where Bluetooth performs well include serial cable replacement, wireless factory monitoring, control system diagnostics, and wireless vehicle monitoring, just to name a few. Call us at 864.843.4343 to discuss your specific application requirements


]]>
Wed, 09 Dec 2009 14:03:32 -0500