THE COMPUTER NETWORK OPTIMIZATION EXPERTS !

 

Character Encoding     

Compendium Index Up

REPRESENTATION OF INDIVIDUAL CHARACTERS

The RS-232 standard doesn't specify the "correct" number of bits that should be used to represent a character. 7 or 8 bits are the most common character lengths, although 5 or 6 may also be used. When no character is being sent, the signal line is held in the mark voltage state -- this is called the RS-232 idle state. The start of the data flow is indicated when the first transition from mark to space is received. Depending on the implementation, there may be synchronization bits, called start bits, prepended to the beginning of each character. Configuration of the transmitter and receiver must agree as to whether zero, one, or two start bits are being used. Following the user data bits (5, 6, 7, or 8 bits of character data) there may be an optional parity bit to help determine whether an error has occurred during the transmission. For example, a common mode voltage problem or noise may have changed the value of a bit from, say, '1' to '0' or vice versa. The parity bit may be configured to be one of the following:

NO PARITY: The parity bit is not transmitted.
EVEN PARITY: The parity bit is transmitted as either a '1' or a '0' so that the total number of '1' bits is an even number.
ODD PARITY: The parity bit is transmitted as either a '1' or a '0' so that the total number of '1' bits is an odd number.
MARK PARITY: The parity bit is always transmitted as a binary '1'.
SPACE PARITY: The parity bit is always transmitted as a binary '0'.

Following the parity bit (if used) comes the stop-bit sequence. There may be one or two stop bits that frame the end of the character. Some implementations stop the transmission of the second stop bit at the half-bit-time instant in time. We say that system transmits "one and one half stop bits". The stop bits are transmitted as binary '1's, the mark state.

A special signal can be sent between the transmitter and the receiver that will be interpreted according the specifics of the software implementation. This character is called a break character. A normal data character consists of the start bits, the data bits, the optional parity bit, and the stop bits. The idle time between characters is sent as the mark voltage level. To transmit a break character the transmitter holds the signal line in the space voltage level for longer than one character time. If a character is defined as having two start bits, seven data bits, even parity, and two stop bits then the character time is 12 bits. To transmit a break character, the signal line is held at the space signal level for any time longer than 12 bit times. The effect of receiving a break character is totally dependent on the whim of the programmer. Perhaps a break character would interrupt the flow of data that would otherwise be overflowing a receivers buffer. It's up to the programmer.

Previous Topic ] Next Topic ] 
Compendium Index ] Up ] Compendium Contents ] Search ]

OTHER TOPICS AT THIS OUTLINE LEVEL:
General Overview ] RS-232 Standard ] Bit Encoding ] [ Character Encoding ] Data Errors ] Physical Circuit ] DTE and DCE ] DB-25 Connection ] Control Signals ] Break-Out Box ] Directional Signals ] Connecting DTE's ] Async & Sync ] Other Signals ] Custom IC's ] RS-423 ] RS-422 ] Modems ]

{Revision F-1} All Content Created By Optimized Engineering Corporation is
Copyright © 1995 - 2000 by Optimized Engineering Corporation
All Rights Reserved

The contents of this web site may not be duplicated or distributed in any
manner without prior written consent of Optimized Engineering Corporation.