Max 232
Max 232
Max 232
MAX 232
RS-232 WAVEFORM
The diagram above shows the expected waveform from the UART when using the common
8N1 format. 8N1 signifies 8 Data bits, No Parity and 1 Stop Bit. The RS-232 line, when idle
is in the Mark State (Logic 1). A transmission starts with a start bit which is (Logic 0). Then
each bit is sent down the line, one at a time. The LSB (Least Significant Bit) is sent first. A
Stop Bit (Logic 1) is then appended to the signal to make up the transmission. The data sent
using this method, is said to be framed. That is the data is framed between a Start and Stop
Bit.
Serial communication
When a processor communicates with the outside world, it provides data in byte sized
chunks. Computers transfer data in two ways: parallel and serial. In parallel data transfers,
often more lines are used to transfer data to a device and 8 bit data path is expensive. The
serial communication transfer uses only a single data line instead of the 8 bit data line of
parallel communication which makes the data transfer not only cheaper but also makes it
possible for two computers located in two different cities to communicate over telephone.
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous method transfers data at a time while the asynchronous transfers a single byte at
a time. There are some special IC chips made by many manufacturers for data
communications. These chips are commonly referred to as UART (universal asynchronous
receiver-transmitter) and USART (universal synchronous asynchronous receiver transmitter).
The AT89C51 chip has a built in UART. In asynchronous method, each character is placed
between start and stop bits. This is called framing. In data framing of asynchronous
communications, the data, such as ASCII characters, are packed in between a start and stop
bit. We have a total of 10 bits for a character: 8 bits for the ASCII code and 1 bit each for the
start and stop bits. The rate of serial data transfer
communication is stated in bps or it can be called as baud rate. To allow the compatibility
among data communication equipment made by various manufacturers, and interfacing
standard called RS232 was set by the Electronics industries Association in 1960. Today
RS232 is the most widely used I/O interfacing standard. This standard is used in PCs and
numerous types of equipment. However, since the standard was set long before the advent of
the TTL logic family, its input and output voltage levels are not TTL compatible. In RS232,
a 1 bit is represented by -3 to -25V, while a 0 bit is represented +3 to +25 V, making -3 to +3
undefined. For this reason, to connect any RS232 to a microcontroller system we must use
voltage converters such as MAX232 to connect the TTL logic levels to RS232 voltage levels
and vice versa. MAX232 ICs are commonly referred to as line drivers.
The RS232 cables are generally referred to as DB-9 connector. In labeling, DB-9P
refers to the plug connector (male) and DB-9S is for the socket connector (female). The
simplest connection between a PC and microcontroller requires a minimum of three pin,
TXD, RXD, and ground. Many of the pins of the RS232 connector are used for handshaking
signals. They are bypassed since they are not supported by the UART chip.
IBM PC/ compatible computers based on x86(8086, 80286, 386, 486 and
Pentium)microprocessors normally have two COM ports. Both COM ports have RS232 type
connectors.Many PCs use one each of the DB-25 and DB-9 RS232 connectors. The COM
ports are designated as COM1 and COM2. We can connect the serial port to the COM 2 port
of a PC for serial communication experiments. We use a DB9 connector in our arrangement.