Jan Axelson's Lakeview Research

Home > Serial Port Central

Serial Port Central

Serial links and networks: RS-232, RS-485, COM ports, USB virtual COM ports, and more

My Example Code | USB Virtual COM Ports | Wireless
Chips | Applications | Connecting Two PCs | Hardware | Software
Standards and Protocols | Articles

Send comments, suggestions, error reports, etc. via .

What's New

Serial Port Complete Second Edition

Serial Port CompleteMy book Serial Port Complete Second Edition covers COM ports, USB virtual COM ports, and ports for embedded systems.

Serial (COM) Ports and .NET

The .NET Version 2.0 Framework's class library includes a SerialPort class for accessing COM ports, including USB Virtual COM Ports. My COM Port Terminal application shows how to use the SerialPort class in Visual Basic and Visual C#.

My Example Code

Code for PCs and PIC microcontrollers.

PC

Com Port Demo

As described in Access Serial Ports with VisualBasic.Net (Nuts & Volts, April 2008 issue)

com_port_demo.zip

Terminal application

COM_Port_Terminal for Visual Basic .NET. Created with Visual Studio 2008. Updated April 1, 2009.

COM_Port_Terminal for Visual C# .NET. Created with Visual Studio 2008. Updated April 1, 2009.

Microchip PIC Microcontroller (PIC18F4520)

Serial communications demo

Basic (PICBASIC PRO)
C (Microchip C18)

RS-485 network

Basic (PICBASIC PRO)
C (Microchip C18)

USB Virtual COM Ports

Some USB devices appear as COM ports on PCs. Applications can access these devices in the same way they access physical COM ports.

A USB virtual COM-port device can use a dedicated-function USB device controller that requires no USB-specific firmware or a general-purpose USB device controller programmed to serve a COM-port function.

Dedicated-function Controller

Some USB controller chips have support for virtual COM-port communications built into the hardware. The device's CPU communicates with the controller via a serial or parallel interface. PC applications access the chips via drivers provided by the chip vendors.

FTDI. Options with serial and parallel ports. Also various modules for developing.

MosChip Semiconductor Technology Ltd. USB to UART bridge.

Prolific Technology. USB to Serial bridges.

Silicon Laboratories. USB to UART bridge.

General-purpose Device Controller with CDC Firmware

A device that uses just about any general-purpose full- or high-speed USB device controller can function as a virtual COM-port device. If the device firmware identifies the device as belonging to USB's communication devices class (CDC), the device can use the USB CDC driver included with Windows.

Communication Device Class (CDC) firmware and application note for the Microchip PIC18F4550.

How to achieve speed of 128 kB/sec. with Microchip CDC firmware (PIC18F4550 firmware + Borland Builder 6 application). From Tomasz Ostrowski.

USB Communication Device Class - Migration from RS-232 to USB. Application note from Atmel.

AN10420: USB virtual COM port on LPC214x. The source code (virtualcom.zip) is available from the file area of the LPC2000 yahoo discussion group. More information. From NXP Semiconductor.

Composite CDC Devices

To create a composite USB device that contains a CDC function, use an interface association descriptor to specify the CDC interfaces. For Windows XP systems, you must also install the two hotfixes described in these articles:

The Usbser.sys driver may not load when a USB device uses an IAD. Microsoft Knowledge Base article ID 918365. Updates usbser.sys to version 5.1.2600.2930.

A Tablet PC that is running Windows XP Tablet PC Edition 2005 stops responding (hangs) when you put it into standby or into hibernation. Microsoft Knowledge Base article ID KB935892. Updates usbccgp.sys to version 5.1.2600.3116.

USB Host Drivers

Instead of using the USB CDC class driver, a general-purpose device controller can use a vendor-specific driver on the host PC. The driver can provide improved performance or support additional capabilities.

Walter Oney Software has a USB virtual COM-port driver.

USB Serial Port Migration Products. From MCCI.

USB CDC/ACM Class Driver for Windows. From Thesycon.

USB Converter Modules

If you don't want to design your own USB interface converter, these are some sources of modules.

AVIT Research's USB to TTL Serial Cable uses a Cygnal chip.

B&B Electronics has USB-RS-232/RS-485 converters

Dontronics has modules that use FTDI's chips, the Micro-USB module based on the Silicon Laboratories CP2101-CP2102, and more.

High Tech Horizon's USB EasyTap is a USB/RS-232 solution using FTDI's USB UART.

MEV has a USB-to-RS-232 converter and a USB-to-RS-485 converter with an isolated RS-485 interface.

Micro Digital's smxUSBD USB Device Stack includes a serial-port class emulator.

Sealevel Systems has USB-RS-232/RS-485 converters.

Smiley Micros. The BBUSB contains an FT232R. Virtual Serial Port Cookbook by Joe Pardue is about developing with the BBUSB.

Wireless

Replace the wires with a wireless interface.

Reynolds Electronics. Components for IR and RF serial links.

Infrared (IR)

Infrared Data Association (IrDA). Hardware interface and protocols for IR communications over distances of up to 1 meter.

A primer on Standard Consumer IR, used in remote controls and other consumer devices. From Standard Microsystems Corp.

IrCOMM2k is a free, open-source Virtual Infrared COM Port for Windows 2000/XP

Ziplabel has schematics and code for a free, basic computerized infrared remote project.

Microchip MCP2120 low cost, high performance, fully static infrared encoder/decoder.

Radio (RF)

Sources for RF modules include Linx Technologies, Inc. and MaxStream, Inc. The Parallax 433 MHz RF modules use components from Linx Technologies.

Bluetooth. For small form-factor, low-cost, short-range radio links. A7 Engineering has Bluetooth modules with asynchronous serial interfaces. Brainboxes, connectBlue, and Sphinx (German) also have Bluetooth products.

Zigbee Alliance.

Hands-On Zigbee (book) by Fred Eady.

Chips

Chips (ICs) for serial-port projects.

RS-232 and RS-485

Many of these sources also have excellent application notes.

Intersil

Linear Technology

Maxim Integrated Products

National Semiconductor

Sipex Corporation

Texas Instruments

Zywyn

UARTs

A UART converts between an asynchronous serial interface and a parallel or other interface.

Intersil. The HD-6402 is an old, basic UART that's useful for basic monitoring and control applications.

Maxim Integrated Products 16-pin MAX3100 UART with SPI interface and MAX3110E/MAX3111E UARTs with SPI/Microwire and RS-232 interfaces.

National Semiconductor PC16550D. The UART used in PCs for many years.

Texas Instruments

Basic Stamp

Using the Basic Stamp's Serial Port by Jan Axelson (PDF)

A Stamp UART. How to use Maxim's MAX3110E UART to add a buffered asynchronous serial port to a Basic Stamp. From Al Williams.

Applications

Motor-control and relay projects. From Bruce Reynolds.

Connecting Two PCs

To connect two PCs via their serial ports, see Connecting Two PCs on my Parallel Port page.

The pinout for the null-modem cable you'll need to connect the serial ports on two PCs. From loop-back.com.

Hardware Products (and some software)

Sources for circuit boards that convert between RS-232 or TTL and RS-485 or similar interfaces, serial-port expansion cards for PCs, cables, software drivers, and other serial-port products. Many of these companies are also good sources for applications information.

Companies that specialize in serial communications

B & B Electronics. Many products and an extensive RS-422/485 application note.

Byte Runner Technologies. Serial-port expansion cards.

CER International. COM-Watch 2000, a serial data communication analyzer for RS-232, RS-485, and more.

Cimetrics Technology. RS-485 and BACnet hardware and software for PCs and embedded systems.

Comtrol. RS-232 and RS-485 cards and serial/USB converters.

Connect Tech Inc. RS-232 and RS-485 converters and cards.

Crystalfontz. LCD modules with RS-232 interfaces.

Fifo Electronics. Serial protocol analyzers and other tools.

Frontline Test Equipment. Serial protocol analyzers.

Greenleaf Software. Protocol analyzers and communications software.

Integrity Instruments. Converters and free RS-485 drivers for DOS and Windows.

Paladin Software. Data-logging software for serial ports.

R.E. Smith. RS-485 converters and interfaces for every use and a Quick Reference to RS-485, RS-232 and related standards.

Robust DataComm. RS-232 and RS-485 products and application notes, many dealing with grounding and isolation.

Serialio.com. Hardware and software products for serial communications.

WCSC. Serial communications drivers, other tools, and multiport cards.

Windmill Software. Data-acquisition hardware and software, including free serial-instrument software.

Other companies with serial-port products (mostly hardware)

Acces I/O Products. RS-232 and RS-485 cards and converters.

Altek Instruments. The Mule KeyWedge Interface converts RS-232 input to keyboard input.

Antona Corporation. RS-232/RS-422 converters, including one with a video vertical sync interrupt.

ARC Electronics. Converters and an introduction to RS-485.

Black Box. Communications and networking products.

Commtech, Inc. Industrial and commercial adapters.

DataBoy. RS-232 traffic monitor that plugs into a standard Game Boy Color or Game Boy Advance console. From Micro Contraptions, Inc.

East Coast Datacom, Inc. Data communication products.

I2CChip.com. BL232 IC that converts between asynchronous serial and I2C.

High Tech Horizon. PLM-24 Power Line Modem enables sending and receiving serial data over AC power lines and supports multiple nodes for networking.

HVW Technologies. RS-232/RS-485 converter with hardware-only control of the transmit-enable line. RS-232/TTL converters that plug into the edge of a solderless breadboard.

Netburner. Development kit for serial-to-Ethernet applications.

SAN People. Ethernet-to-RS/232 and -RS-485 converters.

Sealevel Systems. Boards and drivers for I/O.

Scott Edwards Electronics. Serial LCD modules and other products for Basic Stamps. Scott's PIC Source Book with serial-communications code is free from Dontronics.

TAL Technologies. Software wedge for serial data acquisition and many other utilities.

Traversix. Connectivity System for remote access to your serial-port devices.

Precidia Technologies. Converters for RS-232/422/485 to Ethernet or PPP connections.

Winford Engineering. Breadboard adapters with 9-pin D-sub connectors.

Other sources for RS-232 and RS-485 boards include Digi, IOTech, and National Instruments.

Software

Tools to simplify serial-port programming on PCs.

Embedded Systems

PIC Baud rate Calculator. From micromagic systems.

.NET

My example applications

Microsoft's .NET Framework 2.0 includes a SerialPort class for accessing COM ports, including USB virtual COM ports (FTDI Chip FT232BM, FT245BM, etc.).

SerialPort (RS-232 Serial COM Port) in C# .NET. Using the SerialPort class. From Noah Coad.

GotDotNet User Sample: C#-based SerialPort component and CSTerm terminal application.

Serial Communication using VB.NET. Example code from Corrado Cavalli.

Shared source serial and GPS library for Microsoft's .NET Compact Framework. From OpenNETCF.org.

If for some reason you don't want to use the SerialPort class:

HOW TO: Access Serial Ports and Parallel Ports by Using Microsoft Visual Basic .NET. How to use MSComm to access serial ports. Knowledge Base article #823179 from Microsoft.

Visual Basic .NET Code Sample: Using the Comm Port. Uses API calls. From Microsoft.

Visual Basic 6

In Visual Basic 6, use the MSComm control included with the Professional and Enterprise editions. Visual Basic's Learning Edition doesn't include MSComm. But you can use the freeware XMComm ActiveX control, which wraps the MSComm32.ocx. Many other useful utilities, including a Virtual Null Modem & Virtual Data Monitor and a Remote Serial tool. From Richard Grier's Hard & Software.

Win32

Serial Communications in Win32. Using Windows API calls for serial communications, with code in C. From Microsoft.

Other Tools

Advanced Serial Port Monitor and Advanced Serial Data Logger. From AGG Software.

COMM-DRV/Vxd from Willies Computer Software Co. (WCSC).

CommSniffer data viewer and analyzer. Free. From Knightsoft.

CommTools/DLL from HALLoGRAM Publishing.

PowerVT terminal-emulator software from Dart Communications.

EasyIO. Active X control for very basic serial I/O under Windows 95/NT. From Stephen Payne.

Eltima Software. Virtual serial port driver, serial port monitor, and serial port splitter.

Frontline Test Equipment. Serialtest Spy captures and decodes serial data, and other diagnostic software.

Greenleaf Software. Communication tools and protocol analzyers.

Labtam. ReMapPro makes serial-port data from a PC available on a TCP/IP-based network and makes TCP/IP data available on a serial port on a PC.

Listen. Serial data monitor. From WinTECH software.

MarshallSoft Computing. Communications libraries for DOS and Windows.

Microlynx DOS-based RS-232 monitor and other communications utilities and products.

Nilsen Consulting. Serial driver with support for 9-bit communications.

PowerBasic. Basic language compiler that enables accessing four COM ports under DOS (compared to QuickBasic's two).

RenTerminalControl enables logging RS-232 data. From Reynolds Electronics.

RS-422 OCX for Sony VCRs. From Sysworks.com.

Rxtx free serial java library for unix, and related links. From Trent Jarvi.

Sax CommStudio for for COM/ActiveX and .NET serial communications. From Sax Software.

SerialTools supports accessing physical and virtual serial ports in .NET Desktop Framework and Compact Framework applications and via ActiveX. From Franson Technologies AB.

Serial Basic programming language designed for RS-232 communications. From Data Outfitters.

Serial Monitor. From HHD Software.

Serial Player enables recording and playback of data from serial ports. Free.

Software Innovations. RS-232 line analyzer and an ActiveX comm plug in.

SimpleTerm Serial Port Data Viewer / Terminal Emulator. From PTronix.

TurboPower Async Professional communications toolkit for Borland Delphi, C++Builder, & ActiveX environments. A former commercial product that is now open source. Documentation and support (from TurboControl).

Serial Related Downloads. From topshareware.com.

Virtual Serial Port Drivers

com0com. Open source.

Constellation Data Systems, Inc.

Fabula Tech

MKS Software

Tactical Software

See Software for more sources.

Terminal Emulators

For basic modem or direct RS-232 communications. Use one of these in place of Windows' Hyperterminal (in Accessories).

Com, from TGL Microsystems. Shareware.

MTTTY from Netburner. Freeware.

RealTerm is a terminal emulator with a focus on debugging capabilities. Freeware.

Tera Term. Freeware.

YAT. Freeware. From Dieter Fauth.

Standards and Protocols

Interface Standards

The TIA (Telecommunications Industry Association) publishes the RS-232, RS-485, and similar standards. The standards documents are available from IHS. These are some of the document numbers:

RS-232 is document TIA-232, revision F.
RS-422 is document TIA-422, revision B.
RS-423 is document TIA/EIA-423, revision F.
RS-485 is document TIA-485, revision A.

Protocols

DDCMP (Digital Data Communications Message Protocol) ensures reliable communications over full and half-duplex links, using synchronous or asynchronous transmissions, in links of two or more devices. From Digital Equipment Corp.

The S.N.A.P. protocol defines a simple, general-purpose message format that is useful for monitoring and control networks of all types. Freeware from High Tech Horizons.

Articles

These articles cover many of the basics of RS-232, RS-485, and similar communications. Other good sources are the product vendors and chip manufacturers listed below.

Tomi Engdahl's PC hardware pages. Links to RS-232 and other serial-port information.

Beyond Logic has a tutorial and projects. From Craig Peacock.

Webopedia. Definitions and links to RS-232 and other serial-port information.

Index to HOWTO documents for Linux, including some Serial Port HOWTOs.

The Art and Science of RS-485. By Bob Perrin. From Circuit Cellar.

My article Designing RS-485 Circuits.

RS232 Data Interface is a tutorial from ARC Electronics.

Selecting and Using Serial-Data Standards from Maxim.

Nullmodem.com has many links to info. From Jim Price.

Serial Communication via RS-232 Serial Port. An article from Harsha Perla & Veena Pai

 

Partner Links

Embedded Software
Design, Development and Manufacture of USB, Flash and Media products
practicalcontrol.co.uk

firewire usb cable
Connecting printers, Digital Cameras, or peripherals needs great cables.

USB Protocol Analyzers
ELLISYS protocol analyzers, generators, automated compliance solutions.
www.ellisys.com