HD-6402 PDF datasheet -- http://www.intersil.com/data/fn/fn2956.pdf
This type of UART is unique because it has separate baud
generators for Tx and Rx
(transmit and receive can have different baud rates). For example, you
can send
data at 19200 Baud, but receive data at 9600 baud. Each line is
configurable for
independent baud. The Model 4/4P are the same, and the maximum baud
rate is 19200.
TRS-80 Model 4 RS-232 Port Definitions
Port E8h
E8h Output: UART Master Reset, enables UART control register load
- d1 when '1' enables control register load (see Port EAh
description below).
Input: Modem Status Register - d7 Clear-to-Send (CTS), Pin 5
- d6 Data-Set-Ready (DSR), pin 6
- d5 Carrier Detect (CD), pin 8
- d4 Ring Indicator (RI), pin 22
- d3..d1 Not used
- d0 ?? UART Receiver Input, pin 20 (pin 20 is also DTR)
Port E9h - E9h Output: Baud-rate Generator Register load enable bit
data |
Baud |
00h |
50 |
11h |
75 |
22h |
100 |
33h |
134.5 |
44h |
150 |
55h |
300 |
66h |
600 |
77h |
1200 |
88h |
1800 |
99h |
2000 |
AAh |
2400 |
BBh |
3600 |
CCh |
4800 |
DDh |
7200 |
EEh |
9600 |
FFh |
19200 |
- E9h Input: Reserved (Not Used)
Port EAh: UART Control Register Load and Modem Control -
EAh Output (Write), when E8h bit d1 is '1' (Control Register enabled):
bits d7..d3 are UART control; d2..d0 are Modem line control - d7
Even Parity Enable ('1'=even, '0'=odd)
- d6 Word Length Select 1
- d5 Word Length Select 2
- d4 Stop Bit Select ('1'=two stop bits, '0'=one stop bit)
- d3 Parity Inhibit ('1'=disable; No parity, '0'=parity
enabled)
- d2 Break ('0'=disable transmit data; continuous RS232
'SPACE' condition)
- d1 Data-Terminal-Ready (DTR), pin 20
- d0 Request-to-Send (RTS), pin 4
-
EAh Output (Write), when E8h bit d1 is '0' (Control Register disabled):
bits d5..d3 are secondary line control, and could even be used for
steering or multiplexing logic; d2..d0 are Modem line control same as
above - d7,d6 Not used
- d5 Secondary Unassigned, pin 18
- d4 Secondary Transmit Data, pin 14
- d3 Secondary Request-to-Send, pin 19
- d2 Break ('0'=disable transmit data; continuous RS232
'SPACE' condition)
- d1 Data-Terminal-Ready (DTR), pin 20
- d0 Request-to-Send (RTS), pin 4
-
EAh Input (Read): UART Status Register - d7 Data Received
('1'=condition true)
- d6 Transmitter Holding Register empty ('1'=condition
true)
- d5 Overrun Error ('1'=condition true)
- d4 Framing Error ('1'=condition true)
- d3 Parity Error ('1'=condition true)
- d2..d0 Not used
Port EBh Output (Write): UART Transmit Holding Register - An output
to this port load the UART transmitter Holding
register with a word to be
transmitted, as soon as the last word loaded in the holding register is
transmitted.
This register should never be loaded until the Transmitter Holding
register empty bit
(Port EAh) is true.
Port EBh Input (Read): UART Receive Holding Register - An input from
this port reads the last word received from the
UART received
data holding register. This register should not be read until the data
received
bit (port EAh) is true.
Setting the Baud Rate:
The TR1602 UART is clocked by a Dual Baud-rate Generator chip, (Western
Digital BR1941L,
or equivalent) which creates two separate baud clocks. The baud is
written as one byte
which contains two sets of 4-bit codes, using 4 bits to select Tx baud,
and another 4 bits
to select Rx Baud. Usually you set both Tx and Rx baud to the same. Tx
baud is set by the
upper 4 bits (d7..d4), Rx Baud is set by the lower 4 bits (d3..d0)
Refer to Port E9h Output description above, and write the
desired datum
to port E9h.
Setting the protocol:
Usually you will use '8-N-1' (as 8 data bits, No parity, 1 stop bit)
- write 02h (bit d1='1') to port E8h to enable Control Register
write
- write the desired configuration byte to port EAh
- Note that d6:d5 are Word length Select d5=WLS2, d6=WLS1
- d6='1',d5='1' for 8 bits
- d6='0',d5='1' for 7 bits
- d6='1',d5='0' for 6 bits
- d6='0',d5='0' for 5 bits
Parallel Port:
The printer port can also be used for I/O control...
- F8h Write (output) send data to the printer data lines with
strobe pulsed low.
- F8h Read (input) reads printer status as follows:
- d7 BUSY ('1'=true)
- d6 Out-of-Paper ('1'=true)
- d5 Device Select ('1'=true)
- d4 ERROR, printer fault ('1'=true)
- d3..d0 Reserved
Model 4/4P I/O Bus:
The I/O Bus is a very flexible way to interface a Z80 system to the
outside world, but
requires a thorough understanding of the Model 4 I/O bus circuitry and
the required
external interface circuitry. For example, it requires proper buffering
and a strong
driver on input signal EXTIOSEL for reading data from the expansion
bus. The entire
I/O Bus also must be 'activated' before use. ... More about this
later.
EOF