Ports and I/O Devices
Page Index
Ports (Model I)
Block 78-7F - ChromaTRS
Block B0-BC - NewClock-80
Block E8-EB - Serial Port
Port E8
This port is mainly used for UART reset and initialization. Writing any byte to 0E8H resets the RS-232 interface. It also acts as the RS-232 status register port. Bits in this port represent signals such as Clear to Send (CTS), Data Set Ready (DSR), Carrier Detect, and Ring Indicator.
| Bit | Input (= UART Status) | Output (= Set UART Parameter) |
|---|---|---|
| B0 | 1 = CTS (Clear to Send) active | Writing any value resets UART |
| B1 | 1 = DSR (Data Set Ready) active | Writing any value resets UART |
| B2 | 1 = RLSD (Carrier Detect) active | Unused / No control |
| B3 | 1 = Ring Indicator active | Writing any value resets UART |
| B4 | Unused | Writing any value resets UART |
| B5 | Unused | Writing any value resets UART |
| B6 | Unused | Writing any value resets UART |
| B7 | Bit 7 being read as input signals a reset action | Writing any value resets UART |
Port E9
This port is used for setting the RS-232 baud rate. Different values written here configure the baud rate of the UART.
| Bit | DIP Switch Settings (Input) | Output (= Set UART Parameter) |
|---|---|---|
| B7 | Parity 0=Odd | Set Baud Rate (all bits): Bits 0-3 = Receive Speed Bits 4-7 = Transmit Speed Speed Codes (Binary / Hex): 0000 0000b (00H) = 50 baud 0001 0001b (11H) = 75 baud 0010 0010b (22H) = 100 baud 0011 0011b (33H) = 134.5 baud 0100 0100b (44H) = 150 baud 0101 0101b (55H) = 300 baud 0110 0110b (66H) = 600 baud 0111 0111b (77H) = 1,200 baud 1000 1000b (88H) = 1,800 baud 1001 1001b (99H) = 2,000 baud 1010 1010b (AAH) = 2,400 baud 1011 1011b (BBH) = 3,600 baud 1100 1100b (CCH) = 4,800 baud 1101 1101b (DDH) = 7,200 baud 1110 1110b (EEH) = 9,600 baud 1111 1111b (FFH) = 19,200 baud |
| B6 | Wd Length 00=5 01=7 | |
| B5 | 10=6 11=8 | |
| B4 | Stop bits 0=1 1=2 | |
| B3 | Parity 0=Enable | |
| B2 | Unused | |
| B1 | Unused | |
| B0 | Unused |
Port EA
This port acts as the UART control and status register. Reading this port gives status bits like data available, parity, and transmission buffer status. Writing here configures parameters like parity enable/disable and can enable or disable the UART.
| Bit | Input (= UART Status) | Output (= Set UART Parameter) |
|---|---|---|
| B0 | unused | 0=RTS on |
| B1 | unused | 0=DTR on |
| B2 | unused | 1=Transmit Enable |
| B3 | 1=Parity Error | 1=No Parity |
| B4 | 1=Framing Error | 0=1-Stop bit |
| B5 | 1=Overrun Error | Word Length [Bits 5 and 6]: 00=5, 01=7, 10=6 11=8 |
| B6 | 0=Data sent (TBMT) | See Above |
| B7 | 1=Data Available | 1=Even Parity, 0=Odd Parity |
Port EB
The data register for RS-232. Reading from 0EBH reads the received data byte from the serial line, and writing to it sends a data byte out on the serial line.
Ports (Model III and Model 4)
Note: Tandy tended to allocate ports in groups of 4.
Orch-90:
| Port | Use |
|---|---|
| 75 | ORCH-90 |
| 79 | ORCH-90 |
Graphics Board (Model 4 ONLY):
| Port | Use |
|---|---|
| 80H | Input: Reserved. Output: Graphics board register |
| 81H | Input: Graphics board RAM read. Output: Graphics board RAM write. |
| 82H | Input: Reserved. Output: Graphics board Y register. |
| 83H | Input: Reserved. Output: Graphics board X register. |
| 84H | Mod 4 - various controls. 80 micro, March 84, p. 122. Input is reserved. Output:
|
| 85H-87H | Same as 84H. |
Block 88/89/8A/8B - CRT Control
| Port | Use |
|---|---|
| 88H | CRT controller control register. |
| 89H | CRT controller data register. |
| 8AH | CRT controller control register. |
| 8BH | CRT controller data register. |
Block 8C/8D/8E/8F - Graphics Board:
| Port | Use |
|---|---|
| 8CH-8FH | Graphics board select 2. |
Block 90/91/92/93 - Sound Port (Model 4 ONLY):
| Port | Use |
|---|---|
| 90H | Model 4 sound port. Any of the sound routines used on the Model I and Model III that uses port FFH can be changed to this and then the Model IV's built in speaker can be used!. Only BIT 0 was used for output, 0=Low, 1=High. |
| 91H-93H | Same as 90H. |
Reserved:
| Port | Use |
|---|---|
| 94H-BFH | Reserved. |
Model 4P Boot ROM (Model 4P Only):
| Port | Use |
|---|---|
| 9CH | Switch the Model 4P Boot ROM in or OUT. Output:
|
ARCNET (Model 4P Only):
| Port | Use |
|---|---|
| B6H | Arcnet Board (Input/Output). |
Hard Drive:
| Port | Use |
|---|---|
| C0H | Write Protection. Write/Output: Reserved. Read/Input: Hard disk write protect:
|
| C1H | Hard disk controller board control register (Read/Write).
|
| C2H-C3H | Model II with 8x300 Controller - Hard disk device ID register. Output: Reserved. Input: Hard disk device ID register. |
| C4H | Model II with 8x300 Controller - Hard disk CTC channel 0. |
| C5H | Model II with 8x300 Controller - Hard disk CTC channel 1. |
| C6H | Model II with 8x300 Controller - Hard disk CTC channel 2. |
| C7H | Model II with 8x300 Controller - Hard disk CTC channel 3. |
| C8H | Hard Disk Data Register (Read/Write). Register 0 for WD1010 Winchester Disk Controller Chip. |
| C9H | Hard Disk Write Pre-Comp Cyl. Register 1 for WD1010 Winchester Disk Controller Chip. Write/Output: The RWC start cylinder number = The value stored here divide by 4. Read/Input: Error Register:
|
| CAH | Hard Disk Sector Count (Read/Write). Register 2 for WD1010 Winchester Disk Controller Chip. This is used only for multiple sector access. Internally decrements when used. |
| CBH | Hard Disk Sector Number (Read/Write). Register 3 for WD1010 Winchester Disk Controller Chip. |
| CCH | Hard Disk Cylinder LSB (Read/Write). Register 4 for WD1010 Winchester Disk Controller Chip. |
| CDH | Hard Disk Cylinder MSB (Read/Write). Register 5 for WD1010 Winchester Disk Controller Chip. Since the maximum number of cylinders is 1024, only Bits 0 and 1 are used (1023 = 0000 0011 + 1111 1111). |
| CEH | Hard Disk Sector Size / Drive # / Head # (Read/Write). Register 6 for WD1010 Winchester Disk Controller Chip.
|
| CFH | Hard Disk Error Status Register (Read Only). Register 7 for WD1010 Winchester Disk Controller Chip. Read = Status Register:
|
+--------------------------------------------------------------------------+ |PORT CFH - WRITE - Command Register Instruction Set | | Bits: 7 6 5 4 3 2 1 0 | Bits: 7 6 5 4 3 2 1 0 | | Restore | 0 0 0 1 d c b a | Read Sector | 0 0 1 0 i m 0 0 | | Seek | 0 1 1 1 d c b a | Write Sector | 0 0 1 1 0 m 0 0 | | Scan ID | 0 1 0 0 0 0 0 0 | Write Format | 0 1 0 1 0 0 0 0 | | | | | "dcba" defines step rate field: | "i" defines interrupt enable status: | | 0000 = 35 us. | 0 = interrupt when data request | | 0001-1111 = 0.5-7.5 ms in | line (DRQ*) is enabled | | 0.5 ms steps | 1 = interrupt at end of command | | | | "m" defines multiple sector flag: 0 = one sector, 1 = multiple sectors | +--------------------------------------------------------------------------+ * The 4P ROM is known to send three commands to this port: 16H-restore, 20H-read one sector, 70H-seek
Block D0/D1/D2/D3 - Network 4:
| Port | Use |
|---|---|
| D0H | Input/Output with Automatic Increment |
| D1H | Omninet Pointer: LSB |
| D2H | Input without Automatic Increment. Also an Omninet Strobe Point. |
| D3H | Omninet Pointer: MSB |
Interrupts:
| Port | Use |
|---|---|
| E0H | Maskable Interrupt
|
| E4H | Select NMI options/read NMI status: Input:
|
Block E8/E9/EA/EB - RS-232:
Note: A Model I will set itself up based on the switches on the card. A Model III will default to 300 baud, 8 Bit Word, 1 Stop Bit, and No Parity.
| Port | Use |
|---|---|
| E8H | RS-232 Status Register and Master Reset: Output: Any byte will reset the RS-232 Input:
|
| E9H | RS-232 Baud Rate Select and Sense Switches: Output:
|
| EAH | RS-232 UART Control Register and Status Register: Input:
|
| EBH | RS-232 Register: Input: Received Data Output: Transmit Data |
Port Add.! D7 ! D6 ! D5 ! D4 ! D3 ! D2 ! D1 ! D0 !
=========!=====!=====!=====!=====!=====!=====!=====!=====!
E8 Write ! <---- UART RESET & INITIALIZATION ONLY ----->!
! NO DATA BITS REQUIRED ! T
---------!-----!-----!-----!-----!-----!-----!-----!-----!
E8 Read ! cts ! dsr ! cd ! ri ! - ! - ! rec ! - !
! ! ! ! ! ! ! i/p ! ! R
=========!=====!=====!=====!=====!=====!=====!=====!=====!
E9 Write ! Software Baud rate settings (see manual) !
! ! ! ! ! ! ! ! ! S
---------!-----!-----!-----!-----!-----!-----!-----!-----!
E9 Read !Parit! w/l ! w/l ! stop!Parit! Baud! Baud! Baud!
switches !ev/od!slct1!slct2! 1or2!en/di! 1 ! 2 ! 3 !
=========!=====!=====!=====!=====!=====!=====!=====!=====! I
EA Write !Parit! w/l ! w/l ! stop!Parit! TX ! DTR ! RTS !
control !ev/od!slct1!slct2! 1or2!en/di!en/di! ! !
---------!-----!-----!-----!-----!-----!-----!-----!-----!
EA Read ! DAV ! TBMT!o/run!frame!Parit! - ! - ! - ! 8
Uart ! ! !error!error!error! ! ! !
=========!=====!=====!=====!=====!=====!=====!=====!=====!
EB Write ! <---------- 8 BIT DATA to UART -----------> !
EB Read ! <---------- 8 BIT DATA from UART -----------> !
========='====='====='====='====='====='====='====='====='---
D7 D6 D5 D4 D3 D2 D1 D0
=========v=====v=====v=====v=====v=====v=====v=====v=====v---
F8 Write ! - ! - ! - ! - ! - !Uart ! DTR ! RTS ! S
! ! ! ! ! !Reset! ! !
---------!-----!-----!-----!-----!-----!-----!-----!-----! Y
F8 Read ! <---------- 8 BIT DATA from UART -----------> !
! ! ! ! ! ! ! ! ! S
=========!=====!=====!=====!=====!=====!=====!=====!=====!
F9 Write ! <---------- 8 BIT DATA to UART -----------> !
! ! ! ! ! ! ! ! ! 8
---------!-----!-----!-----!-----!-----!-----!-----!-----!
F9 Read !TMBT ! CTS ! DSR ! CD ! PE ! FE ! OR ! DAV ! 0
! ! ! ! ! ! ! ! !
========='====='====='====='====='====='====='====='====='
Misc:
| Port | Use |
|---|---|
| ECH | Write = various controls/ read = reset clock
|
A quick note on Bit 5 (thanks to George Phillips). Bit 5 of Port ECH is supported on both the Model III and Model 4 and is set to ENABLE at 345CH. There is a latch connected to this bit that always has the current value. This latch has a wire connecting to both the Z-80 bus and the video circuitry which which mediates acccess to video RAM, so the processing of this bit is actually handled by separate hardware and not the ROM.
An example of this bit can be shown via the short program 10 CLS:FORI=0TO1023:POKE15360+I,191:NEXT. If run once with POKE 16912,0 and run again with POKE 16912,32, hash lines as the screen refreshes can be seen in one but not the other.
The Seatronics Super Speed-Up Board uses bits 6 and 7 of ECH to select the Z-80 Clock Rate:
| Bit 6 | Bit 7 | Speed |
|---|---|---|
| 0 | 0 | 2 Mhz |
| 1 | 0 | 4 Mhz |
| 0 | 1 | 5.3 Mhz |
| 1 | 1 | 8 Mhz |
Floppy Drive:
| Port | Use |
|---|---|
| F0H | FDC Command/Status: Input (depends on what the inquiry is in relation to: I=Restore, Seek, and Step, II = Read/Write Sector, III = Read/Write Track and Read Address:
Output:Bits 765 | 4 | 3 | 2 | 1 0 00-0F: 000 | 0 | h | V | R R = Restore 10-1F: 000 | 1 | h | V | R R = Seek 20-3F: 001 | T | h | V | R R = Step 40-5F: 010 | T | h | V | R R = Step In 60-7F: 011 | T | h | V | R R = Step Out 80-9E: 100 | m | S | E | C 0 = Read Sector A0-BF: 101 | m | S | E | C A = Write Sector C0,C4: 110 | 0 | 0 | E | 0 0 = Read Address D0-DF: 110 | 1 | x | x | x x = Force Interrupt E0,E4: 111 | 0 | 0 | E | 0 0 = Read Track F0,F4: 111 | 1 | 0 | E | 0 0 = Write Track Legend:RR = Stepping Motor Rate (00=6ms, 01=12ms, 10=20ms, 11=30ms) h = Head Load Flag (1: load head at beginning, 0: unload head) V = Track Number Verify Flag (0: no verify, 1: verify on dest track) T = Track Update Flag (0: no update, 1: update Track Register) A = Data Address Mark (0: FB, 1: F8 (deleted DAM)) C = Side Compare Flag (0: disable side compare, 1: enable side comp) E = 15 ms delay (0: no 15ms delay, 1: 15 ms delay) S = Side Compare Flag (0: compare for side 0, 1: compare for side 1) m = Multiple Record Flag (0: single record, 1: multiple records) xxxx = Interrupt Condition Flags (1111 = Immediate interrupt, Index pulse, Ready to not ready transition, Not ready to ready transition) Output Examples:
|
| F1H | FDC Track Register (regardless if READ or WRITE) |
| F2H | FDC Sector Register (regardless if READ or WRITE) |
| F3H | FDC Data Register (the data byte to be read or WRITTEN to disk) |
| F4H | Select drive and options. Output:
|
Block F8/F9/FA/FB - Printer:
| Port | Use |
|---|---|
| F8/F9/FA/FB | Line printer address port: Input:
|
Block FC/FD/FE/FF - Cassette:
| Port | Use |
|---|---|
| FC/FD/FE/FF | Cassette port: Input: Bit 7: Data Bit (0 = Low, 1 = High) Output: Bits 0-1: 00=0.85 Volts, 10=0.0 Volts, 01 = 0.46 Volts |
Memory Mapped I/O Devices
| Address | Use |
|---|---|
| 3000-37DF | NO MEMORY here at all |
| 37E0 | Disk drive select latch |
| 37E1-37EF | TRSDOS v2.3 Disk Registers |
| 37E4 | Cassette drive latch (Select Cassette Drive) |
| 37E8 | Line printer data port when storing |
| 37E8 | Line printer status port when loading |
| 37EC | Disk command register when storing |
| 37EC | Disk status register when loading |
| 37ED | Disk track register |
| 37EE | Disk sector register |
| 37EF | Disk data register |
| 3801-3880 | Keyboard memory |
| 3C00-3FFF | Video display memory |