SIO/2 UART Registers
As you can see in the adjacent panels, there are several Write registers
as well as Read registers.
The thumbnail at the top of each column
lists all of the registers which are then detailed below these lists.
Below is a summary of the WRx and RRx registers:
PROGRAMMING THE SIO/2
According to
Zilog (page 233), the typical
program steps for Async mode are:
Initialize:
- WR0: channel
reset (resets SIO). Select WR2. WR2: set the interrupt vector
- WR0: reset
external/status interrupt, select WR4. WR4: Async mode, 8N1,
clock rate info
- WR0: select
WR3. WR3: receive
enable, autoenables (CTS, DCD), receive character length.
An Asynchronous Receive operation begins when the
Receive Enable bit is set
- WR0: select
WR5. WR5: RTS,
transmit enable, transmit character length, DTR.
Transmission cannot begin until the Transmit Enable bit is set: WR5
D3=1
-
WR0: reset external/status interrupt, select
WR1. WR1: transmit interrupt enable, status affects vector, interrupt on
all receive characters, disable wait/ready function, external
interrupt enable.
Transfer first data byte to SIO. Program is now waiting for an
interrupt from the SIO.
Data transfer and error monitoring:
Z80 Interrupt Acknowledge cycle transfers RR2 to CPU. When the
interrupt occurs, the interrupt vector is modified by 1) Receive
character available, 2) Transmit buffer empty, 3) External/status
change, and 4) Special receive condition.
If a character is received:
- transfer data character to CPU
- update pointers and parameters
- return from interrupt
If transmitter buffer is empty, program control is transferred to
one of eight ISRs:
- transfer data character to SIO
- update pointers and parameters
- return from interrupt
If External Status changes:
- transfer RR2 to CPU
- perform error routines (including Break detection)
- return from Interrupt
If Special Receive condition occurs:
- transfer RR1 to CPU
- do Special Error (such as framing error) routine
- return from Interrupt
Termination:
- redefine Receive/Transmit Interrupt modes
- disable transmit/receive modes
- update modem control outputs (such as RTS Off)
|