Serial Communications from TCJ, 8/9/1998

Async Introduction * General Info * Chips and Data sheets * Terminal Info * Modem Source Code * Software * Links * Products

This page is for people who have to write serial communication programs and routines for DOS and embedded systems. Although some of the info applies, there is nothing here for Windows. Try Jan Axelson's Serial Port Central for links to Windows serial programming. Email suggestions or requests to This email address is being protected from spambots. You need JavaScript enabled to view it.. I'm going to add links to info on microcontroller serial busses soon, so I'm looking for definitive links.

Asynchronous Serial Data Communications

Introduction to Asynchronous Serial Data Communications.

Commonly called RS-232 or Serial Communications, it's used by 'Com', 'Terminal', and 'Modem' programs to communicate with host computers and BBS's. Although these are the most widely known uses because of the commercial programs available, there are many other applications and other standards used. Many embedded systems use Asynchronous Serial Data Communications for command and control. RS-232 style connections are frequently used, often not exactly according to 'standard', but RS-485 connections are also fairly common. National Semiconductor's AN-216 application note (in the General Info section below) gives a good overview of these RS-xxx standards. National's AN-917 shows connector pin-outs used for a number of applications.

Asynchronous means that the bits in the serial data are not locked to a specific clock edge at the receiving end. Since the bits are timed by the transmit clock at the sending end, they are actually synchronous with the clock at the source. Chips that are used for Asynchronous Serial Data Communications are usually called UARTs for "Universal Asynchronous Receiver/Transmitters". Examples are the INS8250 and it's decendents used in PC's. Since everybody wants to make up their own names for things, National calls the INS8250 an 'ACE' for 'Asynchronous Communications Element'. Many microcontrollers like the 8051 have UARTs built-in although they usually do not have as many features and functions as the separate chips.

In "Synchronous Serial Data Communications" (which is not otherwise covered here), the data bits are aligned with the clock at the receiving and transmitting ends. Examples of "Synchronous Serial Data Communications" are Ethernet and the digital telephone network.

Chips that do both Asynchronous and Synchronous Serial Data Communications are often called USARTs for "Universal Synchronous/Asynchronous Receiver/Transmitters". Examples of USARTs are the Z80 SIO, the Intel 8251 (which is not at all related to the INS8250), and the Zilog 8530/82530.

Asynchronous Serial Data Communications is the bottom layer in a data communications system. It is the hardware/bit-twiddling layer that goes over the wires. Software determines what data gets sent and in what format. The software defines a 'protocol'. Even a simple 'Terminal' connection uses a 'protocol' in a way. There is a defined character set and a fixed way of interpreting the data. Modems require a certain 'protocol' to operate properly. File transfer protocols such as X-modem and Z-modem use the data in a different way. Packet and network protocols such as X.25 and TCP/IP for the Internet are also different and more complicated, but they are also used over an asynchronous serial connection.

This page and these links are about working from the 'bottom up' to get something useful done. After you get the chips talking to each other, you have to decide what you want them to say and how it's going to be interpreted. Usually this requires you to do research to find out what standard practice is for the equipment you have to talk to. The 'official standards' are only part of the information required. Modem and terminal manufacturers have many years of standard practice that you need to find out about and your Internet service provider isn't going to change for you. And if you're working with embedded systems, I don't think your boss will allow you to obselete his entire product line so you can 'do it your way'.

Back to Top

General Info

Application Notes from National Semiconductor, used by permission. PDF files require Adobe Acrobat Reader to view and/or print them. Get Acrobat Reader from the Adobe web site.

 

Copyright © 1995 National Semiconductor Corporation,
2900 Semiconductor Drive Santa Clara, CA 95051, U.S.A.
All rights reserved.
  • AN-216.PDF - Summary of Well Known Interface Standards. PDF file from National Semiconductor. 201010 bytes.
  • AN-917.PDF - Popular Connector Pin Assignments used in Data Communications. PDF file from National Semiconductor. 185614 bytes.
  • AN-979.PDF - The Practical Limits of RS-485. PDF file from National Semiconductor.
  • RS-232 on Wikipaedia

National's AN-979 is an important reference for people trying to implement RS-485 'networks'. One of the requirements not explicitly stated (but implicit in the specifications) is that the receivers and transmitters on an RS-485 network must have a common ground. It may be noisy, but it must be there because RS-485 devices are DC connected to each other and have a limited common mode range. This is different than Ethernet connections. All the different varieties of Ethernet (10-baseT, Thinnet, etc.) are transformer isolated at each connection and do not use a common ground.

TIA / Telecommunications Industry Association and EIA / Electronic Industries Association are the organizations that set the standards. They will tell you to go to Global Engineering Documents to get copies.

Global Engineering Documents sells copies of standards documents from many standards organizations. Note that the "RS-xxx" designation is obselete in spite of it's common usage. Look for "EIA" (Electronic Industries Association) and/or "TIA" (?) for US standards (as in 'EIA-232') and "ITU-T" (International Telecommunications Union) for European/International documents (as in 'ITU-T V.24') including the 'V.xx' standards for 'data interchange' and modems. You will have to narrow your search considerably since the EIA/TIA and the ITU put out standards on all sorts of things that have nothing to do with Asynchronous Serial Data Communications.

Christian Blum's Serial Port FAQ is a good place to start for DOS serial communications.

Back to Top

Chips and Data sheets

 

Old UARTs

General Instruments AY-1013 is the oldest one I know of. Made in PMOS in the early 1970's, it was a hardware UART, didn't require any software to operate it, but it did require three supply voltages. It had separate pins for the receive data register, the transmit data register, and for control inputs and outputs. It also only went to 25kBaud.

Editor's Note: The harris.com links are broken, If you know of updated links, please get in touch here : www.verinote.com/contact.php

IM6402, one of my favorites, is a CMOS version of the AY-1013 that required only a single supply voltage. Some versions would work up to +10 volts, other only to +6V. It was made by Intersil and RCA, but both were bought by GE and GE's semiconductors were bought by Harris Semiconductor. Harris still makes the 6402 as the CDP6402, CDP6402C and HD-6402. Versions of the 6402 are available that will do 500kBaud. I've used it to provide serial control to devices that didn't have microprocessors in them, just hardware logic.

 

PC Compatible UARTs

Data sheets in PDF format from National Semiconductor, Exar/Startech, and Texas Instruments. Go to their Web sites for more datasheets and application notes.

All three companies make versions of the 16450 and 16550 uarts. The 16450 has no fifo's. The 16550 has 16-byte fifos. Exar/Startech makes the 16650 with 32-byte fifos and auto-handshaking. TI makes the TL16C750 with 64 byte fifo's and auto-handshaking. TI also makes a TL16C550C part that has some extra features.

Both National and TI make a 16552 part. They are Not the same. The National PC16552D is a dual 16550. The Texas Instruments TL16C552 is a dual TL16C550 plus a Parallel printer port.

PDF files require Adobe Acrobat Reader to view and/or print them. Get Acrobat Reader from the Adobe web site.

 

USARTs

The second most common type of serial chip found in PC's (and many other places including the Apple Macintosh) is the Zilog 8530 and it derivatives. Although it's frequently used because of it's Synchronous capabilities, it's a good Asynch chip also. It's a little more difficult to program than the 8250 types.

 

  • Go to Zilog, INC. for Serial Communications Controllers Datasheets and manuals.
  • Also look at AMD for 8530/85C30 Serial Communications Controller (SCC).

Editor's Note : Sorry if you came here looking for more links to Serial Comms stuff. This page has become a nightmare to keep updated. The majority of the links forward from this point are broken as they relate to ftp.psycber.com which is defunct.