Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword or section
Like this
P. 1
Interfacing the PC Serial Port RS232

Interfacing the PC Serial Port RS232



|Views: 5,292|Likes:
Published by Sneetsher Crispy
General View on Serial Port RS-232.
General View on Serial Port RS-232.

More info:

Published by: Sneetsher Crispy on Jun 18, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Interfacing the Serial / RS232 Port V5.0 http://www.senet.com.au/~cpeacock Interfacing the Serial / RS232 Port V5.0Page 1
Interfacing the Serial / RS232 Port
Disclaimer: While every effort has been made to make sure the information in this document is correct, the author can not be liable forany damages whatsoever for loss relating to this document. Use this information at your own risk.
Table of Contents
Part 1 : Hardware (PC’s)
Page 4Hardware PropertiesPage 4Serial Pinouts (DB25 & DB9)Page 4Pin FunctionsPage 5Null ModemsPage 5Loopback PlugsPage 6DTE/DCE SpeedsPage 7Flow ControlPage 7The UART (8250s and Compatables)Page 8Type of UARTS (For PCs)Page 10
Part 2 : Serial Port Registers (PC’s)
Page 12Port Addresses and IRQsPage 12Table of RegistersPage 13DLAB?Page 14Interrupt Enable Register (IER)Page 15Interrupt Identification Register (IIR)Page 15First In/First Out Control Register (FCR)Page 16Line Control Register (LCR)Page 17Modem Control Register (MCR)Page 19Line Status Register (LSR)Page 20Modem Status Register (MSR)Page 21Scratch RegisterPage 21
Interfacing the Serial / RS232 Port V5.0 http://www.senet.com.au/~cpeacock Interfacing the Serial / RS232 Port V5.0Page 2
Part 3 : Programming (PC’s)
Page 22Polling or Interrupt Driven?Page 22Termpoll.c - A Simple Comms Program using PollingPage 22Buff1024.c - An Interrupt Driven Comms ProgramPage 24Interrupt VectorsPage 27Interrupt Service RoutinePage 28UART ConfiguartionPage 30Main Routine (Loop)Page 31Determining the type of UART via SoftwarePage 31
Part 4 : External Hardware - Interfacing Methods
Page 33RS-232 WaveformsPage 33RS-232 Level ConvertersPage 34Making use of the serial formatPage 348250 and compatable UARTSPage 35CDP6402, AY-5-1015 / D36402R-9 etc UARTSPage 36MicrocontrollersPage 39
Interfacing the Serial / RS232 Port V5.0 http://www.senet.com.au/~cpeacock Interfacing the Serial / RS232 Port V5.0Page 3
The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connectto the serial port will need the serial transmission converted back to parallel so that it can be used. Thiscan be done using a UART. On the software side of things, there are many more registers that you haveto 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 porttransmits a '0' as 0v and a '1' as 5v. Therefore the serial port can have amaximum swing of 50V compared to the parallel port which has a maximumswing of 5 Volts. Therefore cable loss is not going to be as much of aproblem for serial cables than they are for parallel.2.You don't need as many wires than parallel transmission. If your deviceneeds 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 or25 core cable. However you must take into account the cost of the interfacingat each end.3.Infra Red devices have proven quite popular recently. You may of seen manyelectronic diaries and palmtop computers which have infra red capabilitiesbuild in. However could you imagine transmitting 8 bits of data at the onetime across the room and being able to (from the devices point of view)decipher which bits are which? Therefore serial transmission is used whereone bit is sent at a time. IrDA-1 (The first infra red specifications) wascapable of 115.2k baud and was interfaced into a UART. The pulse lengthhowever was cut down to 3/16th of a RS232 bit length to conserve powerconsidering these devices are mainly used on diaries, laptops and palmtops.4.Microcontroller's have also proven to be quite popular recently. Many of these have in built SCI (Serial Communications Interfaces) which can beused to talk to the outside world. Serial Communication reduces the pincount of these MPU's. Only two pins are commonly used, Transmit Data(TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8bit Parallel method (You may also require a Strobe).

Activity (27)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Lu Gao liked this
Lina Balerina liked this
Aini Inia liked this
badari_rvce liked this
Arun Kumar liked this
nhannhai2002 liked this
zgulkhan liked this
Saima Kanwal liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->