Table of Contents Schematic Diagram DRAM Circuits Ports & Connectors SCSI and Parallel Interface Circuits Serial Interface Circuits ROM Circuits Component Placement Diagram Parts List Integrated Circuit and Logic Data U1 U2, U12, U24 U3. U4 U5 U6 U7, U10 U8 U9, U25 U11 U13, U21, U67, U69 U14, U26, U29, U49, U68 U15 U16, U20 U17 U18 U19 U22 U23 U27, U48 U28 U47, U50 DRAM Timing Theory: Signals Theory: Read Cycle Theory: Write Cycle Theory: Refresh Programming Information Hardware Description Register Selection Table ACIA Command Register ACIA Control Register RAM/ROM Access, IRQ Status Software Description, Configuration Parameters Operating Variables RS-232 Handler Functions and Tables Interface Standards Standard Printer & MODEM Cables Directly Compatible SCSI/SASI Devices 74LS20 74LS175 74LS138 7407 6551 ACIA 74LS04 74LS02 74LS93 74LS10 74LS00 74LS244 27C128 EPROM 74LS73A MC1489P LM3086 74HC4046 74LS139 74LS158 74LS374 74LS240 RESISTOR NETWORKS 2 2 3 4 5 6 7 8 9 9 10 12 14 15 22 23 24 27 28 29 30 31 34 35 36 43 45 47 49 50 53 54 55 56 57 58 58 59 60 61 62 63 64 65 70 70 72 MIO Service Manual Page 2 MIO Service Manual Page 3 MIO Service Manual Page 4 MIO Service Manual Page 5 MIO Service Manual Page 6 MIO Service Manual Page 7 Description Transistor Array Quad Line Reciever dual 4-input NAND gate Hex Inverter 12v Phase locked loop (obsolete- very early MIOs only) 5v Phase locked loop Quad D-Type Flip Flop 3 to 8 Line decoder/demultiplexer; Inverting Quad 2-input NOR gate Dual J-K Flip Flop 4-bit binary counter quadruple 2-input positive NAND gate dual 1-of-4 Decoder/Demultiplexer quad 2-input multiplexer triple 3-input NAND gate Octal 3-state buffer/line-driver Octal D-type Flip Flop, positive edge trigger, 3-state Hex Buffer/Driver with open-collector high voltage Outputs Octal 3-state buffer/line-driver 8 resistor network (isolated) 16pin resistor network, dual-line terminated, pulse squaring 27128 EPROM 6551 UART Value LM3086N MC1489P 74HC20N 74LS04N MC14046 MM74HC4046N 74LS175 74HC138N 74LS02N HD74LS73P 74LS93 HD74LS00P SN74LS139N 74LS158 74HC10 SN74LS244N 74HCT374N SN7407N SN74LS240N MDP1603-330G MDP1605 221/331G Qty per MIO 1 1 1 2 1 1 3 2 1 2 2 4 1 1 1 5 2 1 1 1 1 1 1 Layout number U18 U17 U1 U7,U10 U19 U19 U2,U12,U24 U3,U4 U8 U16,U20 U9,U25 U13,U21,U67,U69 U22 U23 U11 U14,U26,U29,U49,U68 U27,U48 U5 U28 U47 U50 U15 U6 DIP SOCKET, 14PIN DIP SOCKET, 16 PIN DIP SOCKET, 20 PIN DIP SOCKET, 28 PIN 25x2 Pin Header, Right angle 25x2 Pin header Female DB9 connector Male DB9 Connector Female DB25 connector Power connector Power switch Red LED Green LED Oscillator 1.8432mhz 25 10 9 2 1 4 1 1 1 1 1 1 1 1 capacitor, ceramic,multilayer , .1uF 104/15z 35 c1-c5,c7-c16,c19-c29,c39-c41,c47,c68,c69 capacitor, ceramic ,multilayer, 68pF 680/R5K capacitor, ceramic,multilayer , .01uF capacitor, mica, 22pF capacitor,ceramic,multilayer , 470pF Mouser number 526-NTE912 511-MC1489P 511-M74HC20 Digikey number 296-1629-5-ND MC14046BCPOS-ND 512-MM74HC4046N 595-SN74LS175N 296-1575-5-ND 296-1627-5-ND 526-NTE74LS73 296-3750-5-ND 296-1626-5-ND 595-SN74LS139AN 526-NTE74LS158 511-M74HC10 296-1653-5-ND 568-1543-5-ND 296-1436-5-ND 296-1651-5-ND 71-MDP1603-33 71-MDP1605131AGD04 4116R-3-221/331-ND 517-ICO-143-S8A-T 517-ICO-163-S8A-T 517-ICO-203-S8A-T 517-ICO-286-S8A-T A32706-25-ND A32707-25-ND J8 J3 J2 J6 S1 DS2 DS1 Y1 152-3409 152-3309 152-3425 CP-102AH-ND 611-7101-061 606-4305H1 606-4305H5 815-AB-1.8432-B2 cost $5.18 $0.28 $0.19 $0.29 $0.52 $0.45 $0.45 $0.27 $0.39 $1.38 $0.94 $0.29 $0.38 $1.22 $0.20 $0.45 $0.30 $0.80 $0.60 $0.52 $1.03 $0.08 $0.11 $0.11 $0.15 $1.74 $2.12 $0.73 $0.77 $1.19 $0.36 $3.90 $0.21 $0.21 $1.00 399-4209-ND $0.05 6 c18,c30,c45,CV1 399-4247-ND $0.16 103/R5M 1 c6 399-4208-ND $0.12 220/J5 1 c17 399-4220-ND $0.21 471k/5a 2 c44,c48 399-4242-ND $0.13 capacitor, electrolytic capacitor, electrolytic resistor resistor resistor resistor resistor resistor resistor resistor signal diode rectifier diode 3300uf,16v 220uf,25v 1k,1/4w 100k,1/4w 2.2k,1/4w 220,1/4w 22k,1/4w 470,1/4w 100,1/4w 4.7k,1/4w 1N4/148/H DT/1N4003 1 2 8 1 1 2 5 1 1 5 5 4 4043PHBK-ND 493-1319-ND 1.0KQBK-ND 100KQBK-ND 2.2KQBK-ND 220QBK-ND 22KQBK 470QBK-ND 100QBK-ND 3.7KQBK-ND 78-1N4148 $2.08 $0.27 $0.01 $0.02 $0.02 $0.02 $0.02 $0.02 $0.02 $0.02 $0.02 voltage regulator voltage regulator 7805A 428/340LA/15 1 VR1 1 VR2 511-L7805ABP 512-MC78L15ACP $0.47 $0.26 Variable Capacitor (obsolete- replaced with two 68pF caps) Inductor, Ceramic 50 conductor Card-edge crimp connector 1 CV1 2 L1,L2 used to make MIO-ATARI cable 659-GKG30015 27uH, 10% MIO Service Manual c46 c42,c43 r4-r8,r10,r11 r15 r13 r16,r17 r1-r3,r9,r14 r18 r19 r12,r20-r23 d1,d6,d7,d8,d9 d2-d5 M8030-ND CCE50G-ND $0.21 $0.52 $4.79 Page 8 U1 74LS20 DUAL 4-INPUT NAND GATE MIO Service Manual Page 9 U2, U12, U24 74LS175 QUAD D FLIP-FLOP MIO Service Manual Page 10 MIO Service Manual Page 11 U3, U4 74LS138 3-TO-8 LINE DECODER MIO Service Manual Page 12 MIO Service Manual Page 13 U5 7407 HEX BUFFER/DRIVER MIO Service Manual Page 14 U6 6551 ASYNCHRONOUS COMMUNICATION INTERFACE ADAPTER (ACIA) MIO Service Manual Page 15 MIO Service Manual Page 16 MIO Service Manual Page 17 MIO Service Manual Page 18 MIO Service Manual Page 19 MIO Service Manual Page 20 MIO Service Manual Page 21 U7, U10 74LS04 HEX INVERTER MIO Service Manual Page 22 U8 74LS02 QUAD 2-INPUT NOR GATE MIO Service Manual Page 23 U9, U25 74LS93 4-BIT BINARY COUNTER MIO Service Manual Page 24 MIO Service Manual Page 25 MIO Service Manual Page 26 U11 74LS10 TRIPLE 3-INPUT NAND GATE MIO Service Manual Page 27 U13, U21, U67, U69 74LS00 QUAD 2-INPUT NAND GATE MIO Service Manual Page 28 U14, U26, U29, U49, U68 74LS244 OCTAL BUFFER/LINE DRIVER WITH TRI-STATE OUTPUTS MIO Service Manual Page 29 U15 27C128 16K x 8 EPROM MIO Service Manual Page 30 U16, U20 74LS73A DUAL J-K FLIP-FLOP WITH CLEAR MIO Service Manual Page 31 MIO Service Manual Page 32 MIO Service Manual Page 33 U17 MC1489P QUAD LINE RECIEVER MIO Service Manual Page 34 U18 LM3086 TRANSISTOR ARRAY MIO Service Manual Page 35 U19 74HC4046 PHASE LOCKED LOOP MIO Service Manual Page 36 MIO Service Manual Page 37 MIO Service Manual Page 38 MIO Service Manual Page 39 MIO Service Manual Page 40 MIO Service Manual Page 41 MIO Service Manual Page 42 U22 74LS139 DUAL 1-OF-4 DECODER/DEMULTIPLEXER MIO Service Manual Page 43 MIO Service Manual Page 44 U23 74LS158 QUAD 2-INPUT MULTIPLEXER MIO Service Manual Page 45 MIO Service Manual Page 46 U27, U48 74LS374 OCTAL D-TYPE FLIP-FLOP; POSITIVE EDGE TRIGGER; TRI-STATE MIO Service Manual Page 47 MIO Service Manual Page 48 U28 74LS240 OCTAL BUFFER/LINE DRIVER WITH 3-STATE OUTPUTS MIO Service Manual Page 49 U47 MDP1603-330G AND U50 MDP1605 221/331G DIP PACKAGE RESISTOR NETWORKS MIO Service Manual Page 50 MIO Service Manual Page 51 MIO Service Manual Page 52 MIO Service Manual Page 53 MIO Service Manual Page 54 MIO Service Manual Page 55 MIO Service Manual Page 56 MIO Service Manual Page 57 Hardware Description The MIO has 3 basic addressing areas: 1) ACIA at $D1C0-$D1DF, 2) MIO Latches at $D1E0$D1FF, and 3) 256 bytes of RAM at $D600-$D6FF. Note that the ACIA and MIO latches are not fully decoded; both contain 4 read/write registers, but each register has 7 shadows. Tables 5-1 through 53 briefly describes the MIO registers. ACIA Operation For more information on the ACIA operation, refer to a 6551A or 65C51 data manual (this part is manufactured by Rockwell, GTE, NCR, and RCA). The only irregularity of usage is that the lines DSR, CTS, and DCD are tied to ground. This is due to the fact that the ACIA will not receive data if either of these lines are false. To read the actual state of these lines, you must read location $D1E3 (bits 2,1,0). This will return the true lines sense (DCD true is indicated by a high on bit 1 of $D1E3). SASI/SCSI Interface The data input/output ($D1E1) and input control lines ($D1E2) reflect the true voltage levels on the ports. Thus, the input control lines are normally all ones (port voltages are +5) which represents a logic false on the bus. For more information on SASI/SCSI bus protocol, refer to the Adaptec ACB4000 Series User's Manual, the XEBEC S1410A disk controller document, the Seagate ST225N manual, or any other device manual employing these protocols. The ACK-/REQ- handshake cycle is performed by the MIO hardware. Whenever the data ($D1E1) is read or written, ACK- is set true. It is cleared by a high level on the REQ- input signal. The RST- is set true when $D1E0 is read or when the RESET key pressed on the computer (or during powerup). It is cleared by reading location $D1E2. The I/O- controls whether the 8-bit printer/SASI registers are input or output. When I/O- is high (input to SASI controller), the data is output on the printer and SASI port. If I/O- is low, then the output latches are disabled (it will latch new data, but the output is tri-stated). Printer Interface The printer data ($D1E1) and BUSY signals are high true logic. The a high (1) on BUSY (bit 6 of $D1E2) indicates the printer is busy. A low (0) on FAULT- (bit 4 of $D1E2) reflects an error condition in the printer (printer off?). MIO Service Manual Page 58 Table 5-1. MIO Register Selection Register Operation Address (HEX) Write Read Set address A15-A8 for $D600 RAM window. (LSB of sector number.) Set RST- signal true (low). Resets the SCSI/SASI bus. (RST- also true during RESET) Set printer data and SCSI/SASI data. True logic for printer — Inverted for SCSI/SASI bus. Read data from SCSI/SASI bus. Data is inverted. General purpose outputs. B[3..0] High RAM address, sets address A19-A16. B[4] 1 = Set SEL- true B[5] 1 = Enable RAM access B[6] 1 = Set STROBE- true B[7] 1 = Enable Parallel IRQ General purpose inputs. B[0] = SASI C/DB[1] = SASI MSGB[2] = SASI I/OB[4] = Printer FAULTB[5] = SASI BUSYB[6] = Printer BUSY B[7] = SASI REQAlso clears RST- signal $D1E3 or $D1FF Set ROM enable and bank. Only 1 bit allowed set at a time. B[2] 1 = Disk Interface ROM B[3] 1 = Seg 2 of setup MENU B[4] 1 = R:/P: Handler ROM B[5] 1 = Seg 1 of setup MENU All bits 0 disable the ROM. IRQ sense bits + Misc inputs. B[0] = RS-232 DCD line B[1] = RS-232 DSR line B[2] = RS-232 CTS line B[3] = Printer BUSY- IRQ B[4] = MIO IRQ (from 6551 or Printer BUSY- IRQ) $D1C0 Write ACIA transmit register. Read ACIA receive register. Perform a programmed RESET on ACIA (data is "don't care"). Read Status register (resets IRQ). B[0] 1 = Parity error B[1] 1 = Framing error B[2] 1 = Overrun has occurred B[3] 1 = Receiver reg. full B[4] 1 = Transmitter empty B[7] 1 = IRQ occurred $D1C2 Write ACIA command register. (see table 5-2) Read ACIA command register. (see table 5-2) $D1C3 Write ACIA control register. (see table 5-3) Read ACIA control register. (see table 5-3) $D6xx Write RAM. High address A19-A8 selected by $D1E0/$D1E2. Read RAM. High address A19-A8 selected by $D1E0/D1E2. $D1E0 $D1E1 $D1E2 $D1C1 MIO Service Manual Page 59 Table 5-2. ACIA Command Register 7 6 PMC PNC1 PNC0 Bits 7-6 7 6 0 0 0 1 1 0 1 1 5 4 3 2 1 0 PME REM TIC1 TIC0 IRD DTR Parity Mode Control (PMC) Odd parity transmitted/received. Even parity transmitted/received. Mark parity bit transmitted, parity check disabled. Space parity bit transmitted, parity check disabled. Bit 5 0 1 Parity Mode Enable (PME) Parity mode disabled — no parity bit transmitted. Parity mode enabled. Bit 4 0 1 Receiver Echo Mode (REM) Receiver normal mode. Receiver echo mode — bits 2 and 3 must be zero for receiver echo mode, RTS will be true. Bit 3-2 3 2 0 0 0 1 1 0 1 1 Transmitter Interrupt Control (TIC) RTS = false, transmitter disabled. RTS = true, transmit interrupt enabled. RTS = true, transmit interrupt disabled. RTS = true, transmit interrupt disabled, and transmit break on TxD. Bit 1 0 1 Receiver Interrupt Request Disabled (IRD) IRQ- enabled (receiver) IRQ- disabled (receiver) Bit 0 0 1 Data Terminal Ready (DTR) Data terminal not ready (DTR false)*. Data terminal ready (DTR true). Note * The transmitter is disabled immediately. The receiver is disabled but will first complete receiving the byte in process. MIO Service Manual Page 60 Table 5-3. ACIA Control Register 7 6 5 4 WL SBN WL1 WL0 RCS Bit 7 0 1 Bit 4 0 1 MIO Service Manual SBR3 2 1 SBR SBR2 SBR1 0 SBR0 Stop Bit Number (SBN) 1 Stop bit. 2 Stop bits. 1 1/2 stop bits for WL=5 and no parity. 1 stop bit for WL=8 and parity. Bits 6-5 6 5 0 0 0 1 1 0 1 0 Bits 3-0 3 2 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 3 Word Length (WL) Number of bits 8 7 6 5 Receiver Clock Source (RCS) External receiver clock (non-functional on MIO). Baud Rate (SBR). 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Selected Baud Rate (SBR) Baud Rate 16 x RxC (Not usable by MIO). 50 75 110 135 150 300 600 1200 1800 2400 3600 4800 7200 9600 19200 Page 61 Addressing the RAM The MIO can access up to 1 Megabyte of RAM which takes 20 bits to address. Address bits A19A16 are set from writing to the latch at $D1E2, bits A15-A8 are set from writing to the latch at $D1E0, and bits A7-A0 are CPU address lines A7-A0 when reading/writing $D6xx. Thus there are up to 4096 "pages" of memory that may appear at the $D6xx window. In order to access the memory, it must first be enabled by setting $D1E2 bit 5 to "1" (this also turns on the MIO's red LED). It is generally a good idea to leave the RAM disabled while not using it in case of a system crash (which could inadvertently write in the $D6xx window). When power is removed from the computer (for whatever reason), the MIO will continue refreshing its dynamic RAM. This is accomplished by its ability to maintain a 02 clock after the computers clock has stopped. VC1 adjusts the MIO's 02 clock frequency. Adjustment requires special equipment and should not be attempted. Checking IRQ Status The MIO has two sources of interrupts; one is the ACIA and the other is the parallel printer port. The printer port may interrupt the computer only if bit 7 of $D1E2 is set ('1') and the printer BUSY is false ('0'). Bit 4 of $D1E3 is the general IRQ flag from the MIO (a 1 indicates that IRQ- is true). If bit 3 is also set, then the IRQ- is caused by the printer. If not, then it must be the ACIA (in which case $D1C1 bit 7 should be set). Note that the parallel device IRQ mask (PDIMSK at $249) is set to $10 by the MIO RAM. This is because, there is only one interrupt handler (which supports all possible MIO interrupts) in the ROM. In fact, the system would crash if the OS tried to enter any of the other ROM banks to service the IRQ. Accessing the ROM The ROM on the MIO contains all the software necessary to access the hard disk, the RAM, the ACIA (as an R: or P:), and the parallel printer port. It also contains the configuration which is downloaded into the computer RAM when SELECT+RESET are pressed. The ROM is accessed as 4-2K banks. (An additional 8K is reserved for the 80 column adapter.) Bits 5-2 (of $D1E3) select which bank will be active (if any) at the $D800-$DFFF region. Only 1 bit may be set and its position selects which bank of ROM is active. If all bits are zero, then no banks are active and the Floating Point Math package in the OS ROM is enabled. According to Atari spec, 1 device is to occupy one bank of ROM and that device has a specific address range legal to it at $D1xx. Since the MIO is an all inclusive device, however, it deviates from this spec. Instead, it tries to cram as much code as possible into a small space. This meant juggling the banks around to get along with the computer and to allow for expansion of an 80 column adapter. This is why there is only one interrupt handler, yet several input bits are returned in what is considered to be strictly an interrupt sense register (at $D1FF). MIO Service Manual Page 62 Software Description In order for the MIO to perform its multitude of tasks, one full page of memory has been allocated for general operating variables and configuration parameters. Two other pages have been reserved for "R:" handler input and output buffers, and the rest of memory (up to 4093 pages) can be used as RAM drives and a printer buffer through the MIO ROM. Table 5-4 describes the configuration parameters (those which are read from the hard disk (ID=0, LUN=0) when memory is invalid). This table occupies the first 192 bytes of memory page 0. The remaining 64 bytes are operating variables and are listed in table 5-5. Memory pages 1 and 2 are reserved for the "R:" handler input/output buffers. Table 5-4. MIO Configuration Parameters Address (HEX) Symbol Name Length Function of parameter or variable. (Dec) $D600 MEMKEY 16 This contains a string of characters. If the string in memory is not equal to that in ROM, it is assumed that power to the MIO has been lost and it should reconfigure. $D610 DRDATA 64 This contains an array of 8 drive config records (each 8 bytes long). Records are: +0: First physical block address (sector number) of logical device. MSB first. +3: Last+1 physical block address (sector number) of logical device. MSB first. +6: B[2,0] = SCSI/SASI ID if hard disk = drive number if floppy B[5] = 1 if floppy drive (reassign) B[6] = 1 if RAM drive B[7] = 1 if Hard drive if B[7,5] = 0, then ignore +7: B[3] = 1 if disk is write locked B[4] = 1 if SASI type interface B[7,5] = logical unit number of drive $D652 PREND 2 Last+1 RAM page number allocated to print spooler. $D654 PRUNIT 1 Printer device number (0 if P: disabled) $D655 PRFLAGS 1 Printer configuration flags B[5] = 1 if using a serial printer B[6] = 1 if spooler is enabled B[7] = 1 if CR/LF option enabled $D656 SERUNIT 1 RS-232 "R:" enable flag; 1=enable/0=disable $D657 SERFLAGS 1 Default configuration for serial port. B[7] = 1 if to append LF after CR B[6] = 1 if 2 stop bits (else 1 stop bit) B[5] = 1 if no ATASCII/ASCII translation B[4,3] = parity mode: 00=none, 01=odd, 10=even, 11=mark B[2,0] = baud rate index $D658 RAMUSAGL 8 Number pages allocated for each drive (low) $D660 RAMUSAGH 8 Number pages allocated for each drive (hi) MIO Service Manual Page 63 $D668 RAMSIZE 1 Total number of RAM pages (high byte) $D680 DRITYPE 64 Configuration data for SASI hard drives +0: Number cylinders on drive (MSB,LSB) +2: Numer heads on hard drive +3: Cylinder to start reduced write current +5: Precompensation value (usually 0) +7: ECC burst length (usually $0B) Table 5-5. MIO Operating Variables Address (HEX) Symbol Name Length (Dec) $D6C1 CPRINPG 2 Printer queue character entry pointer. (memory page number) (LSB,MSB) $D6C3 PRINPG 2 Printer queue character exit pointer. (memory page number) (LSB,MSB) $D6C5 CPROFFS 1 Printer queue entry page offset. $D6C6 PROFFS 1 Printer queue exit page offset. $D6C7 BADBUFF 1 If 255, this indicates that the queue has wrapped, thus repeat copies are invalid. $D6C8 PRIRQ 1 If 128, then parallel IRQ is enabled. This byte gets copied to $D6E2 when ROM exited. $D6CA PRPAUSE 1 If 0, then the printer spooler is paused. $D6CB PCOPYT 1 Number repeat copies to be printed (normally zero unless they get stacked) $D6CC SPOOLGO 1 Master spooler start/stop flag (255=go) $D6CD XON 1 XON/XOFF flag for serial printer handshake. 255=on 0=off. $D6FC CURPAGE 1 Shadow for $D6E0. Needed for IRQ operation. $D6FD SMISC 1 Shadow for $D6E2. Needed for IRQ operation. MIO Service Manual Function of operating variable Page 64 RS-232 Handler Functions and Tables This section contains a list of all input/output and XIO calls to the RS-232 "R:" handler of the MIO. Note that IOCB is an input/output channel number that indicates what OPEN device shall receive or provide data. For most XIO calls, you may use any legal IOCB number as long as it is NOT open to any other device. From Atari BASIC, you may use IOCB numbers 1 through 7 (0 is reserved for editing "E:" I/O). Note that IOCB #7 is used for the BASIC LPRINT statement and IOCB #6 is used for graphics mode functions from BASIC. Also, if using SpartaDOS, IOCB #4 and IOCB #5 are used while doing output and input redirection respectively (via the DOS PRINT command and batch files). All the syntaxes use just "R:" for the device name since there is only one RS-232 port on the MIO. In fact, if you do use a port number (ex. "R2:"), it is simply ignored and treated the same as "R:". All the function formats are given in their Atari BASIC form. If using assembly language or some other high level language, refer to the language manual for its equivalent form. Opening the RS-232 Port Syntax OPEN #IOCB,Aux1,0,"R:" Remarks This function opens a channel to the RS-232 port in pseudo "non-concurrent" mode. To remain compatible with the 850 and P:R: Connection, the MIO has a flag indicating whether an XIO 40 (set concurrent mode) has been performed since the last OPEN command. If it has not, then the STATUS command returns the state of the handshake lines, whereas if in concurrent mode, the STATUS command returns the number of characters in the input and output buffers. Aux1 contains the I/O direction bits — 4 for input only, 8 for output only, and 12 for both input and output (which is equivalent to 13 of the 850 interface). Many XIO calls do not require that you open an RS-232 channel first, however, it is generally a good practice to open the channel first. Care should be taken when setting the state of the handshake lines; if you set DTR false, the transmitter and receiver are disabled. Therefore, you must re-enable them by setting DTR true before continuing with normal operation. When the channel is opened, both the input and output buffers are cleared. Also, the RTS and DTR handshake lines are set true (to the ready state). Closing the RS-232 Port Syntax CLOSE #IOCB Remarks This statement closes the IOCB connected to the RS-232 port. This simply shuts down the IOCB; the RS-232 port remains untouched except that the system waits until all data in the output buffer has been transmitted. MIO Service Manual Page 65 Input Character or Line From the RS-232 Port Syntax GET #IOCB,varb INPUT #IOCB,varb$ Remarks These functions input data from the RS-232 port; the GET statement inputs the numeric value of one character into a numeric variable and the INPUT statement inputs a string of characters into a string variable. On the INPUT statement, if the data is a numerical ASCII string, you may read the data into a numeric variable. Input strings are terminated by an end-of-line (EOL) character. Note that the IOCB must be opened for read or read/write (modes 4 or 12), but whether in concurrent mode or not has no effect on GET/INPUT statement operation. Refer to your BASIC reference manual for more information on these statements. Output Character or Line To the RS-232 Port Syntax PUT #IOCB,exp PRINT #IOCB;exp$ Remarks These functions output data to the RS-232 port; the PUT statement outputs the numeric value of one character to the port, and the PRINT statement outputs a string of characters to the port. The syntax of the PRINT statement is the same as a normal PRINT statement except that the "#IOCB;" precedes the expression. Note that the IOCB must be opened for write or read/write (mode 8 or 12), but whether in concurrent mode or not has no effect on GET/INPUT statement operation. Refer to your BASIC reference manual for more information on these statements. Reading the Port Status Syntax STATUS #IOCB,DUMMY FLAGS = PEEK(746) : REM Error bits relating to status history LINESTAT = PEEK(747) : REM Status of handshake lines or STATUS #IOCB,DUMMY FLAGS = PEEK(746) : REM Error bits relating to status history INCHARS = PEEK(747) : REM Number of chars in input buffer OUTCHARS = PEEK(749) : REM Number of chars in output buffer Remarks These statement sequences are useful for determining many facts about the state of the RS-232 port. The first syntax is used when in pseudo "block mode I/O" (same as "non-concurrent"), whereas the second is used in concurrent mode I/O. Notice that the variable DUMMY is simply a CIO status of the success of the STATUS command. If there were an error (DUMMY<>1), then BASIC would halt and give an error message (unless a TRAP was performed prior to the STATUS). The block mode STATUS (first syntax) returns a status history of the port (in FLAGS) and the state MIO Service Manual Page 66 of the control lines (in LINESTAT). The meaning of each bit is given in tables 6-1 and 6-2. The concurrent mode STATUS (second syntax) returns a status history of the port (in FLAGS) and the number of characters in the input buffer (in INCHARS) and in the output buffer (in OUTCHARS). The meaning of each bit of FLAGS is given in table 6-1. Table 6-1. Meaning of Error Bits From Location 746 Bit 7 Dec Equiv 128 Meaning of Error Received a data framing error 6 64 Received a data byte overrun error 5 32 Received a data parity error 4 16 Received a buffer overflow error (>255 chars) Table 6-2. Meaning of Status Bits From Location 747 Bit* 7 Dec Equiv 128 Meaning When Bit is Set (1) DSR is true (ready) 5 32 3 8 CRX is true (ready) 0 1 RCV is at MARK (Always Set on MIO) CTS is true (ready — Always true on MIO) * Bits 6, 4, and 2 are simply copies of the next highest bit. In the 850 Interface, these bits would indicate a history (i.e. not always ready since last STATUS). Forcing Early Transmission of Output Blocks Syntax XIO 32,#IOCB,0,0,"R:" Remarks This function causes all the buffered data in the computer to be transmitted through the RS-232 port. This is used when the user wants to make sure that all data is transmitted before performing his next function. (This could also be performed by doing status request until the output data length is zero.) Controlling Outgoing Lines DTR, RTS, and XMT Syntax XIO 34,#IOCB,Aux1,0,"R:" Remarks This function allows you to set the state of the output handshaking lines. This function may be perform in both concurrent and "non-current" mode (there is really no difference except for the way STATUS commands are interpreted). Care should be taken when disabling DTR (setting to false) since transmission and receiving are halted until DTR is set TRUE. Aux1 is coded as indicated by table 4-3. MIO Service Manual Page 67 Table 6-3. Control Values Added to Aux1 (XIO 34) Function DTR RTS XMT Bit 7 Dec Equiv 128 Meaning When Bit is SET Set state of DTR (from bit 6) 6 64 Set DTR Ready (Not ready if bit is CLEAR) 5 32 Set state of RTS (from bit 4) 4 16 Set RTS Ready (Not ready if bit is CLEAR) 1 2 Set state of XMT (FROM BIT 0) 0 1 Set XMT to MARK (SPACE if bit is CLEAR) Setting Baud Rate, Stop Bits, and Ready Checking Syntax XIO 36,#IOCB,Aux1,0,"R:" Remarks This function configures the RS-232 port for desired speed and stop bits. Aux1 is the sum of two codes; baud rate and the number of stop bits. The coding is given by Table 6-4. You must add the value representing the desired baud rate to the code (0 or 128) for the desired number of stop bits per word. Note that the word size is always 8 bits plus 1 or 2 stop bits; the MIO "R:" handler does not support smaller word sizes as did the Atari 850 interface. The "missing" baud rates are available through the ACIA on the MIO but are not supported by the "R:" handler since they are never used. Table 6-4. Codes to Add to Aux1 (XIO 36)* Add Baud Rate Add Baud Rate 0 300 5 110 8 300 9 600 10 1200 12 2400 13 4800 14 9600 15 19200 * Default is 1 stop bit. Add 128 for 2 stop bits. Setting Translation Modes and Parity Syntax XIO 38,#IOCB,Aux1,0,"R:" Remarks This function configures the parity and level of ASCII/ATASCII translation. The value of Aux1 is derived from Table 6-5. MIO Service Manual Page 68 Table 6-5. Control Values Added to Aux1 (XIO 38) Function Add PARITY 0 No parity (8-bit data is untouched) (default) 4 Check/Set odd parity, clear parity bit 8 Check/Set even parity, clear parity bit 12 TRANS- 0 LATION 32 LINE FEEDS 0 64 Resulting Function Performed Send mark parity, clear parity bit Light ATASCII/ASCII translation (default) No translation Do not append LF after CR (default) Append LF after CR (translation from EOL) Setting Concurrent Mode Syntax XIO 40,#IOCB,0,0,"R:" Remarks This function simulates the "Start concurrent mode I/O" of the P:R: Connection and Atari 850. This is needed because of the dual nature of the STATUS command. When in concurrent mode, the statement returns the size of the data buffers, whereas, when in "block mode", the statement returns the state of the handshake lines. This has no effect on the rest of the "R:" handler functioning or on the ACIA. It simply set a flag for the STATUS function. MIO Service Manual Page 69 Standard Printer & MODEM Cables The following two tables are the standard connection specifications used for printer and MODEM cables. These should work for the most common printers and MODEMs or they may need to be modified according to the special needs of your particular installation. Printer Cable Connections 36 pin centronics (male) DB25P 1 2 1 - Data Strobe 2 - D0 3 4 3 - D1 4 - D2 5 6 5 - D3 6 - D4 7 8 7 - D5 8 - D6 16 32 18 – 25 - Gnd 15 - Fault 11 9 11 - Busy 9 - D7 Frame — to the shield wire ¶ ¶ No connection to shield MODEM Cable Connections DB25P 20 8 4 - DTR 1 - CRX 2 3 3 - XMT 2 - RCV 7 6 5 - GND 6 - DSR 4 5 7 - RTS 8 - CTS Frame — to the shield wire MIO Service Manual DB9P ¶ ¶ No connection to shield Page 70 The following table is used with a Toshiba P321 printer with serial interface and is only shown as a guide. All handshaking lines are connected even though most applications would work with only XMT, RCV, and GND. The Toshiba printer is a DTE device and the MIO is also a DTE device. This requires the crossing of XMT and RCV. Be sure to check your printer manual for pin out as most printer connectors will vary. If your serial printer is a DCE device (not DTE) then XMT would connect to XMT and RCV to RCV. DTE Serial Printer Cable Connections DB25P DB9P 6 - DSR 4 - RTS 4 - DTR 1 - CRX 3 - RCV 2 - XMT 3 - XMT 2 - RCV 7 - GND 20 - DTR 5 - GND 6 - DSR 5,8 - CTS,CD 14 - FAULT 7 - RTS 8 - CTS Frame — to the shield wire ¶ ¶ No connection to shield Null MODEM Cable Connections This will allow transfer of files between an MIO serial port and an IBM PC or Atari ST without using MODEMs. Tie pins 6 and 8 together at the DB25 end (PC or ST). DB25S DB9P 8 - CRX 20 - DTR 4 - DTR 1 - CRX 3 - RCV 2 - XMT 3 - XMT 2 - RCV 7 - GND NC 5 - GND 6 - DSR NC NC Frame — to the ¶ shield wire ¶ MIO Service Manual 7 - RTS 8 - CTS No connection to shield Page 71 Directly Compatable SCSI / SASI Devices (as of firmware ver. 1.1) Manufacturer Adaptec Seagate Model # ACB-4000A ACB-4070 Alpha 10H Beta xxx RO650 RO652 ST225N Western Digital WD1002-SHD SASI ST506/412 XEBEC 1410 1410A SASI SASI ST506/412 ST506/412 Iomega Rodime MIO Service Manual Interface SCSI SCSI SCSI SCSI SCSI SCSI SCSI Drive type ST506/412 ST506/412 (RLL certified) (cartridge drive 10Mb) (cartridge drive xxMb) (includes drive 10Mb) (includes drive 20Mb) (includes drive 20Mb) Page 72