16-03-2012, 04:40 PM
Interfacing the Serial
serial.pdf (Size: 139.68 KB / Downloads: 21)
Introduction
The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect
to the serial port will need the serial transmission converted back to parallel so that it can be used. This
can be done using a UART. On the software side of things, there are many more registers that you have
to attend to than on a Standard Parallel Port. (SPP)
So what are the advantages of using serial data transfer rather than parallel?
1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1'
as -3 to -25 volts and a '0' as +3 to +25 volts where as a parallel port
transmits a '0' as 0v and a '1' as 5v. Therefore the serial port can have a
maximum swing of 50V compared to the parallel port which has a maximum
swing of 5 Volts. Therefore cable loss is not going to be as much of a
problem for serial cables than they are for parallel.
2. You don't need as many wires than parallel transmission. If your device
needs to be mounted a far distance away from the computer then 3 core cable
(Null Modem Configuration) is going to be a lot cheaper that running 19 or
25 core cable. However you must take into account the cost of the interfacing
at each end.
3. Infra Red devices have proven quite popular recently. You may of seen many
electronic diaries and palmtop computers which have infra red capabilities
build in. However could you imagine transmitting 8 bits of data at the one
time across the room and being able to (from the devices point of view)
decipher which bits are which? Therefore serial transmission is used where
one bit is sent at a time. IrDA-1 (The first infra red specifications) was
capable of 115.2k baud and was interfaced into a UART. The pulse length
however was cut down to 3/16th of a RS232 bit length to conserve power
considering these devices are mainly used on diaries, laptops and palmtops.
Hardware Properties
Devices which use serial cables for their communication are split into two categories. These are
DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications
Equipment are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is
your Computer or Terminal.
The electrical specifications of the serial port is contained in the EIA (Electronics Industry
Association) RS232C standard. It states many parameters such as -
1. A "Space" (logic 0) will be between +3 and +25 Volts.
2. A "Mark" (Logic 1) will be between -3 and -25 Volts.
3. The region between +3 and -3 volts is undefined.
4. An open circuit voltage should never exceed 25 volts. (In Reference to
GND)
5. A short circuit current should not exceed 500mA. The driver should be
able to handle this without damage. (Take note of this one!)
DTE / DCE Speeds
We have already talked briefly about DTE & DCE. A typical Data Terminal Device is a
computer and a typical Data Communications Device is a Modem. Often people will talk about DTE to
DCE or DCE to DCE speeds. DTE to DCE is the speed between your modem and computer, sometimes
referred to as your terminal speed. This should run at faster speeds than the DCE to DCE speed. DCE to
DCE is the link between modems, sometimes called the line speed.
Most people today will have 28.8K or 33.6K modems. Therefore we should expect the DCE to
DCE speed to be either 28.8K or 33.6K. Considering the high speed of the modem we should expect the
DTE to DCE speed to be about 115,200 BPS.(Maximum Speed of the 16550a UART) This is where
some people often fall into a trap. The communications program which they use have settings for DCE
to DTE speeds. However they see 9.6 KBPS, 14.4 KBPS etc and think it is your modem speed.