You are here

RS-232 - Programming

IRQ's and COM devices, 8250 and Compatible UARTs...

RS-232 Content
Technical Background Pages
Related Atricles
IRQ's and COM devices
PC I/O and IRQ
On PC's the register set of a UART is mapped in the I/O map of the processor. The twelve registers of the UART are accessible with 8 I/O bytes. To achieve this, read-only and write only registers are accessible using to the same PC I/O port when possible. In two situations, a bit (the divisor latch access bit) in one register is used to swap different registers on a specific port.

COM1 - COM4
Four serial communication devices have been predefined on a PC. The UART's for these devices have default addresses assigned on which its registers are accessible. The devices are named COM1 through COM4. A default interrupt line number is also assigned to each device. Because only a few IRQ lines are available on PC systems, only two interrupt lines are used for four devices. The software must have the intelligence to detect which UART needs attention when an interrupt occurs if more than one UART share the same interrupt

Default I/O addresses and IRQ's
Device I/O address range IRQ
COM10x3F8 - 0x3FF4
COM20x2F8 - 0x2FF3
COM30x3E8 - 0x3EF4
COM40x2E8 - 0x2EF3
 
Note!
Please note, that the table lists only the default I/O addresses on IBM XT and AT compatible systems. On a PS2 system, other addresses are used. These values are only recommandations. If other hardware present in the computer makes it necessary, it is possible to move an UART to another I/O address or IRQ.
8250 and Compatible UARTs
UART
UART usually stands for Universal Asynchronous Receiver / Transmitter and is a chip located on a serial card, it allows connection with modems and other devices. Most card manufacturers integrate UART into other chips which can also control parallel port, games port, floppy or hard disk drives and are typically surface mount devices. One of such chips is presented in 8250 line, which includes 16450, 16550, 16650, & 16750 UARTS, this line is usually used in PCs.

The compatibility chips
16550 chip is compatible with 8250 & 16450 chips. The only two differences are pins 24 & 29. 8250 Chip Pin 24 has chip selection which works as chip activity indicator. Pin 29 is not used in 8250/16450 UARTs. These pinouts have different purpose in 16550 chip. Their purpose is: Transmit Ready and Receive Ready. This pinouts allow DMA (Direct Memory Access) usage. These Pins have two different modes of operation. Mode 0 supports single transfer DMA where as Mode 1 supports Multi-transfer DMA.

The UART requires a Clock to run
For this purpose there's a crystal on the serial card usually designed for 1.8432 MHZ or 18.432 MHZ frequency. The crystal is connected to XIN-XOUT pinouts of the UART chip, this pinouts help set CPU clock speed. These Clock are needed to use the Programmable Baud Rate Generator which directly interfaces into the transmit timing circuits but not directly into the receiver timing circuits. For this an external connection must be made from pin 15 (BaudOut) to pin 9 (Receiver clock in.) Note that the clock signal will be at Baudrate * 16
Convert the TTL signal into RS-232

All the UARTs pins are TTL compatible, including TD, RD, RI, DCD, DSR, CTS, DTR and RTS, so direct usage of pinouts for connecting to serial port is not possible. To provide compliance one should use special converters, such as DS1489 Receiver and the DS1488 as the PC has +12 and -12 volt rails which can be used by these devices. Or the converters the MAX232 form the MAXIM. The RS-232 Converters will convert the TTL signal into RS-232 Logic Levels.


Pinouts

Hodnocení článku: