MicroController Pros Home Page My Account  Cart Contents  Checkout  
  Store » 9781931448062 My Account  |  Cart Contents  |  Checkout   
Quick Find
Enter keywords to find the product you are looking for in the Quick Find field above

or use
Advanced Search
Accessory Boards->
ADI Blackfin
Atmel AVR->
Cypress PSoC
Microchip PIC->
Silicon Labs
ST Microelectronics->
Texas Instruments->
Embedded Ethernet->
Embedded Software->
I/O Modules->
Parts & Components->
Pick & Place Tools
Programmable Logic (PLD)
Prototype PCBs->
ROM/Flash Emulators
Test & Measurement->
Tutorial Software
Universal Programmers->
Intro to Embedded Tools
Embedded News Digest
Useful Resources
Shipping & Returns
Warranty & Liability
Privacy Notice
Conditions of Use
Contact Us
Serial Port Complete: COM Ports, USB Virtual COM Ports... US$39.95

Serial Port Complete: COM Ports, USB Virtual COM Ports...

Serial Port Complete: COM Ports, USB Virtual COM Ports, and Ports for Embedded Systems

When the Universal Serial Bus (USB) took hold in the late 1990s, many predicted that serial ports would soon be obsolete. Plenty of peripherals that formerly used the serial port have switched to USB. But some devices can't use USB, or have requirements that USB alone can't provide. Many embedded systems use serial ports because they're inexpensive and less complex to program compared to USB. Serial ports can use longer cables than USB allows. And the RS-485 serial interface supports networks suitable for many monitoring and control applications.

While most PCs no longer have built-in serial (COM) ports, the ports are easy to add via USB converters. With converters, the number of expansion slots no longer limits the number of serial ports a system can have. The SerialPort class included in Microsoft's .NET Framework shows that PC applications continue to find COM-port communications useful.

What's Inside

This book explores wide and varied territory, including hardware and software; ports in PCs and in embedded systems; and RS-232, RS-485, and wireless interfaces. You don't need to read the book straight through. If you're interested in a particular topic, you can skip right to it.

The first chapters focus on hardware and interfacing. Chapters 1 and 2 are an introduction to asynchronous serial communications. Chapter 3 discusses serial ports in PCs, and chapters 48 are a guide to interfacing using RS-232, RS-485, and wireless technologies.

The next chapters are a guide to programming. Chapters 9 and 10 show how to program serial ports on PCs using Visual Basic .NET and Visual C# .NET. Chapter 11 shows how to program serial ports for embedded systems with examples for microEngineering Labs' PICBASIC PRO compiler and Microchip Technology's MPLAB C18 C compiler.

Chapters 12 and 13 focus on hardware and programming for RS-485 serial networks.

Chapters 1416 explain how to implement USB virtual COM ports using special-purpose and generic USB controllers.

What's New in the Second Edition

Much has happened in the world of computing since the first edition of this book was released. For this second edition, author Jan Axelson has revised and updated the contents from start to finish.

One addition is example code in C/C# as well as Basic. This book includes code examples for PCs and for embedded systems (microcontrollers).

Also new in the Second Edition are these topics:

  • Designing and programming USB virtual COM ports.
  • Using wireless technologies to transmit serial data.
  • Accessing serial ports over Ethernet or Wi-Fi networks.
  • Transferring any kind of text data using Unicode encoding.

Who Should Read this Book?

Whether your interest is hardware or software, and whether you work with PCs, embedded systems, or both, you'll find useful guidance in this book.
  • Programmers will learn how to communicate via serial ports, including USB virtual COM ports, in PCs and embedded systems. The example code for PCs and microcontrollers in Basic and C/C# provides a quick start for a variety of applications.
  • Circuit designers will find designs for a variety of applications including converters that translate between RS-232, RS-485, and 3V/5V logic. Designs with fail-safe features, high noise immunity, and low power consumption are included.
  • Hobbyists and experimenters will find inspiration for projects.
  • Teachers and students can learn about serial ports and use the examples in this book to demonstrate concepts.
This book assumes you have a basic knowledge of electronics and either Basic/Visual Basic or C/C# programming. No previous knowledge or experience with serial-port hardware or programming is required.

Table of Contents



1. Options and Choices

When to use a Serial Port

  • Advantages
  • Limits

System Components

  • The Computers
  • The Physical Link
  • Programming


  • Example Systems
  • Managing Communications
  • Special-purpose Modules

2. Formats and Protocols

Sending Serial Data

  • Asynchronous and Synchronous Communications
  • Word Formats
  • Bit Rate and Baud Rate
  • System Support for Low-level Protocols

Sending Bits

  • The Format
  • The Need for Accurate Timing
  • Autodetecting the Bit Rate
  • Autodetecting a COM Port

Data Formats

  • Binary Data
  • Text Data
  • ASCII Hex
  • Application-specific Protocols

Preventing Missed Data

  • Flow Control
  • Buffers
  • Event-driven Programming and Polling
  • Acknowledgments
  • Error Checking

3. COM Ports on PCs

Port Architecture

  • Device Manager
  • Port Resources
  • Serial Servers

Accessing Ports

  • Drivers
  • Identifying Ports
  • GUIDs for COM Ports
  • COM Port Numbering
  • INF Files
  • Options for Application Programming

4. Inside RS-232

The Hardware Interface

  • Signals
  • Voltages
  • Timing Limits

Converting Voltages

  • Interface Chips
  • Short-range Circuits

Port-powered Circuits

  • Using Outputs as a Power Source
  • Regulating the Voltage

Alternate Interfaces

  • Direct Connection
  • Other Unbalanced Interfaces

5. Designing RS-232 Links

Connectors and Adapters

  • Connector Options
  • Adapters
  • Using Microcontroller Development Boards


  • Length Limits
  • Surge Protection

Isolated Lines

  • Ways to Achieve Isolation
  • About Grounds
  • Power Supply Grounds
  • Optoisolating

Debugging Tools

  • Using a Breakout Box
  • Monitoring with a Voltmeter
  • Oscilloscopes and Logic Analyzers

6. Inside RS-485

About RS-485

  • Balanced and Unbalanced Lines
  • Voltage Requirements
  • Current and Power
  • Speed
  • Internal Protection Circuits

Interfacing Options

  • Chips
  • Adding a Port on a PC
  • Converting 3.3/5V Logic
  • Converting RS-232

Controlling the Driver Enable

  • Re-enabling the Driver
  • Software-assisted Control
  • Hardware Control

7. Designing RS-485 Links and Networks

Long and Short Lines

  • When Is a Line Long?
  • Calculating Line Length
  • Choosing a Driver Chip

Line Terminations

  • Characteristic Impedance
  • Adding a Termination
  • Effects of Terminations
  • Reflections
  • Series Terminations
  • Terminations for Short Lines
  • AC Terminations
  • Network Topologies

Biasing the Line

  • Open-circuit Protection
  • Short-circuit Protection

Cable Types

  • How a Wire Picks Up Noise
  • Twisted-pair Cable
  • Selecting Cable

Grounds and Differential Lines

  • Ensuring a Common Ground
  • Isolated Lines

Using Multiple Buses

  • Adding a Repeater
  • Implementing a Star Topology

8. Going Wireless

Media and Modulation

  • Using a Carrier Frequency
  • Spread Spectrum Technology
  • Ensuring Reliable Transfers


  • Transmitters and Receivers
  • IrDA

Radio Frequency

  • Complying with Regulations
  • Choosing an RF Band
  • Implementing a Link
  • Using Other RF Standards

9. Using .NET's SerialPort Class

Gaining Access to a Port

  • Finding Ports
  • Opening a Port
  • Timeouts
  • Receive Threshold
  • Closing a Port

Transferring Data

  • Transferring Bytes
  • Transferring Text

Using Stream Objects

  • BinaryReader and BinaryWriter
  • StreamReader and StreamWriter

Saving a Port and Parameters

  • The Application Settings Architecture
  • Combo Box Example

10. Managing Ports and Transfers in .NET

Receiving Data

  • Setting Timeouts
  • Detecting Received Data
  • Collecting Received Data
  • Ensuring Efficient Transfers

Sending Data

  • Avoiding Timeouts
  • Sending without Blocking the Application
  • Preventing Buffer Overflows
  • Ensuring Efficient Transfers

Flow Control

  • Selecting a Method
  • Monitoring and Controlling the Signals

Handling Errors

  • Exceptions
  • The ErrorReceived Event
  • Verifying Received Data

Structuring an Application

  • Defining a ComPorts Class
  • Setting Parameters with Combo Boxes
  • Defining Application-specific Events

11. Ports for Embedded Systems

A Microcontroller Serial Port

  • About the PIC18F4520
  • The Enhanced UART


  • Configuring and Accessing the Port
  • Setting the Bit Rate
  • Interrupts
  • Basic Operations

Accessing a Port

  • Configuring the Port
  • Sending Data
  • Receiving Data
  • Using Interrupts
  • Using Flow Control

Adding Ports

  • Multiple On-chip UARTs
  • Firmware UARTs
  • External UARTs

12. Network Programming

Managing Traffic

  • Steps in Exchanging a Message
  • Protocols
  • Using Existing Protocols
  • Debugging Tips


  • Assigning Addresses
  • Detecting Addresses
  • Reserving Address Values
  • Defining a Message Format
  • 9-bit Format

13. An RS-485 Network

Connecting the Nodes

  • Transceivers
  • Terminating and Biasing
  • Cabling

Example Protocol

  • Addresses
  • Message Format


  • Reading a Byte
  • Writing a Byte

Polling the Nodes

  • Configuring the Driver-enable Line
  • Sending Commands

Responding to Polls

  • Auxiliary Routines
  • Decoding Received Data

14. Inside USB

Hosts and Devices

  • Assigning a Driver on the Host
  • Requirements
  • Host Responsibilities
  • Device Responsibilities
  • Speed
  • Endpoints

USB Transfers

  • Transfer Types
  • Transactions
  • The Data Toggle

15. Using Special-function USB Controllers

Inside the Chips

  • Serial Interface (FT232R)
  • Parallel Interface (FT245R)
  • Prototyping Modules

Using the Controllers

  • Drivers
  • Adding Vendor-specific Data
  • Implementing a Virtual COM Port
  • Converting from RS-232 to USB

16. Using Generic USB Controllers

The Communication Devices Class

  • Documentation
  • Overview
  • Device Controllers
  • Host Drivers

Using the Abstract Control Model

  • POTS Models
  • Virtual COM Ports
  • Requests
  • Notifications
  • Maximizing Performance

Descriptors and INF Files

  • Device Descriptor
  • Configuration Descriptor
  • Communication Class Interface Descriptors
  • Data Class Interface Descriptors
  • String Descriptors
  • The INF File
  • Composite Devices


Paperback; 380 pages.

This product was added to our catalog on Monday 10 October, 2005.


Customers who bought this product also purchased
Force/Pressure Sensitive Resistor, 0.5" DiameterForce/Pressure Sensitive Resistor, 0.5" DiameterUS$6.95

FTDI FT232RL Mini-USB to Serial UART (TTL) Breakout Board, 3.3VFTDI FT232RL Mini-USB to Serial UART (TTL) Breakout Board, 3.3VUS$14.95

Atmel ATmega32A-PU AVR Microcontroller, 40 DIP, 16MHzAtmel ATmega32A-PU AVR Microcontroller, 40 DIP, 16MHzUS$6.27

Rectangular Pin Header, Male, 1x40 Single Row, 2.54mm SpacingRectangular Pin Header, Male, 1x40 Single Row, 2.54mm SpacingUS$0.75

XBee ZB S2 ZigBee Module, 2 mW, Wire AntennaXBee ZB S2 ZigBee Module, 2 mW, Wire AntennaUS$25.95

Applied Control Theory for Embedded SystemsApplied Control Theory for Embedded SystemsUS$69.95

Shopping Cart more
0 items
What's New? more
Flowcode 7 for PIC, AVR, Arduino, ARM - Pro 2 User
Flowcode 7 for PIC, AVR, Arduino, ARM - Pro 2 User
Specials more
XBee ZB S2 ZigBee Module, 2 mW, U.FL Connector
XBee ZB S2 ZigBee Module, 2 mW, U.FL Connector
Tell A Friend

Tell someone you know about this product.
Notifications more
NotificationsNotify me of updates to Serial Port Complete: COM Ports, USB Virtual COM Ports...
Reviews more
Write ReviewWrite a review on this product!
  Tuesday 14 July, 2020   List of all our Products

Copyright © 2003-2017 MicroController Pros LLC
Powered by osCommerce