Serial Ports: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m Fix mistake in Interrupt State section and flip table for bits 2-1 and 7-6
m Consistency
Line 171: Line 171:


To set the port parity, set bits 3, 4 and 5 of the Line Control Register [PORT + 3].
To set the port parity, set bits 3, 4 and 5 of the Line Control Register [PORT + 3].

{| {{wikitable}}
{| {{wikitable}}
! Bit 5
! Bit 5
Line 192: Line 191:
To communicate with a serial port in interrupt mode, the interrupt-enable-register (see table above) must be set correctly. To determine which interrupts should be enabled, a value with the following bits (0 = disabled, 1 = enabled) must be written to the interrupt-enable-register:
To communicate with a serial port in interrupt mode, the interrupt-enable-register (see table above) must be set correctly. To determine which interrupts should be enabled, a value with the following bits (0 = disabled, 1 = enabled) must be written to the interrupt-enable-register:
{| {{wikitable}}
{| {{wikitable}}
! Bit
! Bit 7-4
! Bit 3
! Interrupt
! Bit 2
! Bit 1
! Bit 0
|-
|-
| Reserved
| 0 || Data available
| Status change
|-
| Break/error
| 1 || Transmitter empty
| Transmitter empty
|-
| Data available
| 2 || Break/error
|-
| 3 || Status change
|-
| 4-7 || Unused
|}
|}


===First In First Out Control Register===
===First In First Out Control Register===
The First In / First Out Control Register (FCR) is for controlling the FIFO buffers. Access this register by writing to port offset +3.
The First In / First Out Control Register (FCR) is for controlling the FIFO buffers. Access this register by writing to port offset +3.

{| class="wikitable"
{| class="wikitable"
|-
|-
Line 231: Line 228:
====Interrupt Trigger Level====
====Interrupt Trigger Level====
The Interrupt Trigger Level is used to configure how much data must be received in the FIFO Receive buffer before triggering a Received Data Available Interrupt.
The Interrupt Trigger Level is used to configure how much data must be received in the FIFO Receive buffer before triggering a Received Data Available Interrupt.

{| {{wikitable}}
{| {{wikitable}}
! Bit 7
! Bit 7
Line 248: Line 244:
===Interrupt Identification Register===
===Interrupt Identification Register===
The Interrupt Identification Register (IIR) is for identifying pending interrupts. Access this register by reading from port offset +3.
The Interrupt Identification Register (IIR) is for identifying pending interrupts. Access this register by reading from port offset +3.

{| class="wikitable"
{| class="wikitable"
|-
|-
Line 266: Line 261:
====Interrupt State====
====Interrupt State====
After Interrupt Pending is set, the Interrupt State shows the interrupt that has occurred. They have varying levels of priority, with high-value interrupts handled first, and low-value interrupts being handled last.
After Interrupt Pending is set, the Interrupt State shows the interrupt that has occurred. They have varying levels of priority, with high-value interrupts handled first, and low-value interrupts being handled last.

{| {{wikitable}}
{| {{wikitable}}
! Bit 2
! Bit 2