Puerto serie

Solo disponible en BuenasTareas
  • Páginas : 52 (12861 palabras )
  • Descarga(s) : 0
  • Publicado : 12 de diciembre de 2010
Leer documento completo
Vista previa del texto
Interfacing the Serial / RS232 Port V5.0

http://www.senet.com.au/~cpeacock

Interfacing the Serial / RS232 Port V5.0
Disclaimer : While every effort has been made to make sure the information in this document is correct, the author can not be liable for any damages whatsoever for loss relating to this document. Use this information at your own risk.

Table of Contents
Part 1 : Hardware(PC’s) Hardware Properties Serial Pinouts (DB25 & DB9) Pin Functions Null Modems Loopback Plugs DTE/DCE Speeds Flow Control The UART (8250’s and Compatables) Type of UARTS (For PC’s) Part 2 : Serial Port Registers (PC’s) Port Addresses and IRQ’s Table of Registers DLAB? Interrupt Enable Register (IER) Interrupt Identification Register (IIR) First In/First Out Control Register (FCR) Line ControlRegister (LCR) Modem Control Register (MCR) Line Status Register (LSR) Modem Status Register (MSR) Scratch Register Page 4 Page 4 Page 4 Page 5 Page 5 Page 6 Page 7 Page 7 Page 8 Page 10 Page 12 Page 12 Page 13 Page 14 Page 15 Page 15 Page 16 Page 17 Page 19 Page 20 Page 21 Page 21

Interfacing the Serial / RS232 Port V5.0

Page 1

Interfacing the Serial / RS232 Port V5.0http://www.senet.com.au/~cpeacock

Part 3 : Programming (PC’s) Polling or Interrupt Driven? Termpoll.c - A Simple Comms Program using Polling Buff1024.c - An Interrupt Driven Comms Program Interrupt Vectors Interrupt Service Routine UART Configuartion Main Routine (Loop) Determining the type of UART via Software Part 4 : External Hardware - Interfacing Methods RS-232 Waveforms RS-232 Level Converters Making useof the serial format 8250 and compatable UARTS CDP6402, AY-5-1015 / D36402R-9 etc UARTS Microcontrollers

Page 22 Page 22 Page 22 Page 24 Page 27 Page 28 Page 30 Page 31 Page 31 Page 33 Page 33 Page 34 Page 34 Page 35 Page 36 Page 39

Interfacing the Serial / RS232 Port V5.0

Page 2

Interfacing the Serial / RS232 Port V5.0

http://www.senet.com.au/~cpeacock

Introduction
The SerialPort 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 datatransfer 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 asmuch 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 Reddevices 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 (Thefirst 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. 4. Microcontroller's have also proven to be quite popular recently. Many of these have in built SCI (Serial Communications Interfaces) which can be...
tracking img