Captain's Universe Home
Captain's Universe Home
Cosmic Ray Muon DetectorTeleGarden Pages
Time on MarsBryophyllum Plants
Jupiter Radio AstronomyAncient Pages
Salzburg Tourist GuideEarth Magnetometer
  H O M E     AJAX & MORE     LINUX & MORE     RTAI     XENOMAI     ADEOS IPIPE      
    JAVA & BROWSERS     *NIX     ELECTRONICS     REVIEWS     ARTEMIA     FAIRY SHRIMP      



Serial (RS232) Port Pins and Registers

This is an overview of all serial port (RS232) registers, including the pin-out of a SUB-D 25 and SUB-D 9 connection.



SERIAL PORT PINS

SUB-D 25 pin# SUB-D 9 pin#   
23TXTransmit Data
32RXReceive Data
47RTSRequest To Send
58CTSClear To Send
66DSRData Set Ready
75GNDSignal Ground
81CDCarrier Detect
204DTRData Terminal Ready
229RIRing Indicator


SERIAL PORT ADDRESSES

PORT common address IRQ 
COM 13F8h4
COM 22F8h3


SERIAL PORT REGISTER OVERVIEW

BASE ADDRESS DLAB RD/WR  Abr.  NAME 
+ 00WR-Transmitter Holding Buffer
0RD-Receiver Buffer
1RD/WR-Divisor Latch Low Byte
+ 10RD/WRIERInterrupt Enable Register
1RD/WR-Divisor Latch High Byte
+ 2-RDIIRInterrupt Identification Register
-WRFCRFIFO Control Register
+ 3-RD/WRLCRLine Control Register
+ 4-RD/WRMCRModem Control Register
+ 5-RDLSRLine Status Register
+ 6-RDMSRModem Status Register
+ 7-RD/WR-Scratch Register (general purpose)

DLAB - Divisor Latch Access Bit:
This is a bit which must be use to either set the BAUD speed (f0 = 1.8432 MHz / 16 (prescaler) = 115200; e.g. 115200 / 9600 = 12 => latch high byte: 00h; low byte: 0Ch) or to access the Interrupt Enable Register.
DLAB is found in the Line Control Register (LCR).

ADDRESS: BASE + 1 - RD/WR - DLAB=0 - NAME: Interrupt Enable Register (IER)

bit # name 
0Enable Received Data Available Interrupt
1Enable Transmitter Holding Register Empty Interrupt
2Enable Receiver Line Status Interrupt (INT in LSR - Line Status Register)
3Enable Modem Status Interrupt (INT in MSR - Modem Status Register)
4Enables Sleep Mode (16750)
5Enables Low Power Mode (16750)
6Reserved
7Reserved



ADDRESS: BASE + 2 - READ ONLY - NAME: Interrupt Identification Register (IIR)

bit #   
00 Interrupt Pending
1 No Interrupt Pending
1 & 2B2B1INT type (priority)
00Modem Status Interrupt (4)
01Transmitter Holding Register Empty Interrupt (3)
10Received Data Available Interrupt (2)
11Receiver Line Status Interrupt (1)
30 Reserved on 8250, 16450
1 16550 Time-out Interrupt Pending
4  Reserved
5  64 Byte Fifo Enabled (16750 only)
6 & 7B6B7 
00No FIFO
01FIFO Enabled but Unusable
11FIFO Enabled


ADDRESS: BASE + 2 - WRITE ONLY - NAME: FIFO Control Register (FCR)

bit #   
0  Enable FIFOs
1  Clear Receive FIFO
2  Clear Transmit FIFO
3  DMA Mode Select. Change status of RXRDY & TXRDY pins from mode 1 to mode 2.
4  Reserved
5  Enable 64 Byte FIFO (16750 only)
6 & 7B7B6Interrupt Trigger Level
00INT on 1 byte received
01INT on 4 bytes received
10INT on 8 bytes received
11INT on 14 bytes received


ADDRESS: BASE + 3 - RD/WR - NAME: Line Control Register (LCR)

bit #  
0 & 1B1B0 Word Length
00 5 Bits
01 6 Bits
10 7 Bits
11 8 Bits
20  One Stop Bit
1  2 Stop bits for words of length 6,7 or 8 bits or 1.5 Stop Bits for Word lengths of 5 bits.
3, 4 & 5B5B4B3 
XX0No Parity
001Odd Parity
011Even Parity
101High Parity (parity bit constantly 1)
111Low Parity (parity bit constantly 0)
6   Set Break Enable
71  Divisor Latch Access
0  Access to Receiver buffer, Transmitter buffer & Interrupt Enable Register



ADDRESS: BASE + 4 - RD/WR - NAME: Modem Control Register (MCR)

bit # name 
0Force Data Terminal Ready
1Force Request to Send
2Aux Output 1
3Aux Output 2
4LoopBack Mode
5Autoflow Control Enabled (16750 only)
6Reserved
7Reserved


ADDRESS: BASE + 5 - READ ONLY - NAME: Line Status Register (LSR)

bit # name 
0Data Ready
1Overrun Error
2Parity Error
3Framing Error
4Break Interrupt
5Empty Transmitter Holding Register (TX register empty)
6Empty Data Holding Registers (TX & shift register empty)
7Error in Received FIFO (1 if break, parity or framing error)

NOTES:
If bit 6 is set, the USART is busy (both data registers for sending are occupied) - if only bit 5 is set, another byte can be sent to the USART.
Break INT: When the receiver line is held low (0) for more than the time it would take to receive a full word (incl. start, data, parity and stop bits).
Framing error: Last bit is not a stop bit - occurs often when there is a speed mismatch.
Overrun error: Data in the buffer has not been read fast enough and is overwritten.

ADDRESS: BASE + 6 - READ ONLY - NAME: Modem Status Register (MSR)

bit # name 
0delta Clear To Send
1delta Data Set Ready
2Trailing Edge Ring Indicator
3delta Data Carrier Detect
4Clear To Send
5Data Set Ready
6Ring Indicator
7Carrier Detect

NOTES:
"delta" means that there was a change of the state in the line since the register was last read.

DIVISOR BYTE VALUES

bps (bit/sec)  divisor latch high byte latch low byte 
50230409h00h
30038401h80h
60019200hC0h
24004800h30h
48002400h18h
96001200h0Ch
19200600h06h
38400300h03h
57600200h02h
115200100h01h


Last-Modified: Sat, 04 Feb 2006 16:03:01 GMT

Google
 
Web www.captain.at
go to top
© 1996-2010 . All rights reserved.
No reproduction, distribution, publishing or transmission of the copyrighted materials at this site is permitted. Policy
go to top