531 likes | 1.48k Vues
RS-232 Interface. Local Asynchronous Communication. What is Asynchronous communication?. A communication is said to be asynchronous if a sender and receiver do not need to coordinate before data can be transmitted. The sender can wait random amounts of time between transmissions
E N D
RS-232 Interface Local Asynchronous Communication
What is Asynchronous communication? • A communication is said to be asynchronous if a sender and receiver do not need to coordinate before data can be transmitted. • The sender can wait random amounts of time between transmissions • The receiver must be ready to receive data whenever it arrives • In asynchronous communication, the electrical signal itself does not contain any information as to when individual bits begin and end
Simplest Encoding Scheme • The binary values zero and one are each represented by a different voltage level • For example, a zero might be represented by +15 volts and a one by –15 volts • The sending unit places one of these voltage levels on the wire and holds it for a short time and then returns the voltage level to zero
Other Encoding Schemes • Manchester • Differential Manchester
Need for standards • To ensure that communication hardware built by different vendors can work together, there needs to be standardized specifications • Several organizations are involved in standards • IEEE – Institute for Electrical and Electronic Engineers • EIA – Electronic Industries Association • ITU – International Telecommunications Union • A standard specifies items such as: • How long the sender should hold a voltage on the wire for a single bit • What voltage levels should be used
RS-232 Standard • Common standard used for asynchronous serial communication such as between a computer and an external modem or between a computer and a keyboard • Most widely accepted way to transfer characters over copper wire between a computer and a keyboard or modem • Developed by EIA
Properties of RS-232 Standard • Connection must be less than 50 feet • Plus and minus 15 volts used to transmit bits – zero is +15 and one is -15 • Transmission is one character at a time • Asynchronous transmission because sender and receiver do not coordinate before transmission of a character • Zero voltage is never left on the line – when nothing is being sent, a negative voltage is kept on the line (1) • Sender and receiver agree on exact length of time the voltage is to be held for each bit • See Figure 5-2, p. 60 of your text
RS-232 Properties Continued • The first bit sent is called the start bit and is used to inform the receiver that a new character is being sent • The start bit is a zero (+15 volts) • Thus there is always a transition to alert the receiver that a new character is being sent • When the first bit is received, the receiver starts a timer and used it to determine when to measure the voltage of each following bit • Seven bits are used to represent the character (ASCII) • A stop bit is added to the end (-15 volts)
RS-232 Properties Continued • Must specify the baud rate – the number of changes in the signal possible per second • This number (in the most simple case) is the same as the number of bits per second, but the number of bits per second may be more than the baud rate • Baud rate may be 300, 9600, 19200, or 33600 bits per second • Baud rate can be specified for the device • The sender and receiver must be operating at the same baud rate
RS-232 Properties Continued • To detect errors, the receiver measures the voltage for each bit multiple times and compares the measurements • If these measurements don’t all agree,or if the stop bit doesn’t occur exactly as expected, then the receiver reports a framing error
RS-232 Properties Continued • RS-232 defines a 25-pin connector and the purpose of each pin • A computer transmits on pin 2 and receives on pin 3 • A modem is just the opposite – transmits on pin 3 and receives on pin 2 • If two computers are connected, then pins 2 and 3 have to be swapped • A ground pin is required