Technical Reference

Input\Output Port Specification


3.1 Device Connection

Because of the 'soft' nature of the Sirius (that is, the configuration of the I/O ports is loaded from disc at boot time) you must always check that the operating system loaded is appropriate for the printer connected. If this is not the case then you may have to reconfigure the operating system permanently (using the System Configuration package) or temporarily using PORTSET and/or SETIO with MS-DOS or PORTCONF and/or STAT with CP/M-86. (See Section 3.6 for more details).

There are 5 ports (3 external, 2 internal) available on the Sirius 1 - they are as follows:

2 x Serial (RS232C) - Ports A and B
1 x Parallel (Centronics)
2 x Parallel (control - located on CPU board)

The ports are located on the rear of the Sirius 1 as shown in the following diagram:

      _____________________________________________________ 
     /                                                     \ 
    /                                                       \ 
   /                                                 ____    \ 
  /                                  on/off switch  |    |    \ 
 /                                                  |____|     \ 
/                                                               \
| Keyboard                                                      |
| socket           LPT                  TTY        UL1          |
|  ___    ___     _______    ___      ______     ______         |
| |___|  |___|   |_______|  |___|    |______|   |______|        |
|        Reset              Video                               |
\        button                                                 /
 \_____________________________________________________________/


                            Figure 1

Sirius 1 Parallel and Serial Ports (as viewed from the rear of the CPU)


3.2 Parallel Port Signals

Parallel printer interfacing is done on the parallel port. Parallel port interfacing is accessed through the 36 pin centronics compatible parallel port. Most parallel printer cable interfaces are simply 36-way flat ribbon cables with 36 pin male ribbon connectors at each end. The signals are directly routed from the Sirius 1 to the printer.

In parallel data transmission all data bits are transmitted asynchronously in an 8 bit parallel form.In parallel there is no parity checking or baud speeds.


             Pin Number                       Signal

                  1 ----------------------------- Data Strobe
                  2 ----------------------------- Data 1
                  3 ----------------------------- Data 2
                  4 ----------------------------- Data 3
                  5 ----------------------------- Data 4
                  6 ----------------------------- Data 5
                  7 ----------------------------- Data 6
                  8 ----------------------------- Data 7
                  9 ----------------------------- Data 8
                                                  .___.
                 10 ----------------------------- ACK
                 11 ----------------------------- Busy
                 17 ----------------------------- Pshield
                 12,18,30,31 --------------- Not connected
                 Remaining ----------------- GND

NOTE: For Epson printers pin 14 must not be connected (to eliminate double linefeeds.)



3.3 Parallel Printer Connection

To connect a parallel printer to the Sirius 1, a suitable cable is required then it will be a matter of plugging the cable into both machines; cables should be attached as follows:

  1. Disconnect power from both the computer and printer
  2. Disconnect the Sirius video connector (see 3.1)
  3. Attach interface cable to Sirius and printer
  4. Re-attach the video connector
  5. Set the printer dip-switches as required
  6. Make sure the operating system is configured for printing to the Centronics port by using SETIO (MS-DOS) or STAT (CP/M-86) as described in Section 3.6

3.3.1 Parallel Cable Requirements

If a suitable parallel cable is not available, you will need to make one - use the guidelines that follow to create your own cable:

You will need a male centronics-compatible Amphenol 57-30360 type connector for the Sirius 1 end of the cable; use the type of connector suggested by the printer manufacturer for the printer end, in general, another male centronics - compatible Amphenol 57-30360 type connector will be required. You will also require a length of 12-core cable (3m maximum length).

Refer to the port layout in your printer handbook - compare this with the Sirius 1 parallel port layout (see Section 3.2). If the pin numbers and signal requirements are the same, then construct the cable as follows:


                     1 ----------------------------- 1
                     2 ----------------------------- 2
                     3 ----------------------------- 3
                     4 ----------------------------- 4
                     5 ----------------------------- 5
                     6 ----------------------------- 6
                     7 ----------------------------- 7
                     8 ----------------------------- 8
                     9 ----------------------------- 9
                    10 ----------------------------- 10
                    11 ----------------------------- 11
                    16 ----------------------------- 16                   

It does not matter which end of the cable is connected to the printer or the computer.

If your printer has the same signals as the Sirius 1, but on differing pins, then use the following guidelines:

  1. Label one connector "Computer" and the other "Printer"
  2. Connect pin 1 at the computer connector to the Data strobe pin at the printer connector
  3. Connect pins 2 through 9 at the computer connector to the Data1 (may be labelled Data 0) through Data 8 (may be labelled Data 7) at the printer connector
  4. Connect pin 10 at the computer connector to the ACK pin at the printer connector
  5. Connect pin 11 at the computer connector to the BUSY pin at the printer connector
  6. Connect pin 16 at the computer connector to the GROUND (may be labelled GND) pin at the printer connector

The printer cable is now complete - it must always be attached to the devices as marked on the connectors - if it is not, then the printer will not work.


3.4 Serial Port Signals

The two serial ports may be used to connect serial printers to the Sirius 1. In serial transmission data bits are transmitted over a data line one bit at a time. The industry standard for serial peripheral communication is the RS-232C serial binary data interchange.

The RS-232C standard is usable for data interchange rates up to 20,000 bits per second.

Line Driver Output Voltages
State Approx. Voltage
OFF -12 VDC
GND +/- 0 VDC
ON + 12 VDC

The RS-232C maximum recommended cable length is approximately 15metres. On the Sirius 1, serial printers may be hooked up to the following serial port pins.


Parallel cables
PIN NAME FUNCTION DIRECTION
1 FG Frame Ground  
2 TD Transmitted Data From SIRIUS
3 RD Received Data To SIRIUS
4 RTS Request to Send From SIRIUS
5 CTS Clear to Send To SIRIUS
6 DSR Data Set Ready To SIRIUS
7 SG Signal Ground  
8 DCD Data Carrier Detect To SIRIUS
15 TC Transmitter Clock  
17 RC Receiver Clock To SIRIUS
20 DTR Data Terminal Ready From SIRIUS
22 RI Ring Indicator To SIRIUS
24 TTC Transmitter Clock From SIRIUS

There are basically two classifications of data transceiving equipment, 1. Data Terminal Equipment (DTE) and 2. Data Communications Equipment (DCE). Most printers are set up as DTE's. The interface requirements for the two classifications are very different, so the classification of printer and computer must be determined before a cable interface can be designed. The Sirius 1 is configured as a (DTE).

(DCE) --------------------------------- (DTE)
(DTE) --------------------------------- (DTE) *

* Note: Typical Sirius 1 computer to printer interface.


Signal Descriptions
 
PIN 1 CHASSIS GROUND This signal is electrically connected to the machine frame
PIN 2 TRANSMIT DATA Data is transferred across this line. This line will be held in a marking (OFF) state during intervals between characters or words and when no data is being transmitted
PIN 3 RECEIVE DATA The printer receives data on this line. This line is held in a marking (OFF) state whenever data carrier detect (DCD PIN 8) is in the (OFF) state
PIN 4 REQUEST TO SEND This signal is used to prepare the printer to receive data. The (ON) state indicates to the printer that the DTE has data to be transmitted. The (OFF) condition indicates the computer is in a non-transmit mode. When the (RTS) line is transitioned from OFF to ON the printer knows to prepare to receive data. The printer responds to the RTS transition by transitioning the clear to send (CTS) line from off to on
PIN 5 CLEAR TO SEND Signals on this circuit indicate whether or not the data set is ready to transmit data. The ON condition is a response to the occurrence of a simultaneous ON condition on data set ready (DSR) and request to send (RTS). In DTE's where RTS is not implemented RTS shall be assumed to be ON at all times, and CTS will respond accordingly
PIN 6 DATA SET READY This circuit is used to indicate the status of the local data set
PIN 7 SIGNAL GROUND  
PIN 8 DATA CARRIER DETECT This signal issued by the DTE tells whether the data being received is of suitable quality. The (ON) state indicates suitable data is being received. The (OFF) state indicates that no data is being received or that the data being received is unsuitable
PIN 20 DATA TERMINAL READY This signal is used to switch the DTE to the communications channel. The ON condition prepares the DTE to be connected to the channel and maintains the connection established

In serial printers the data is transmitted as single bits. The number of bits per second (for this application) is the baud rate. The computer and printer baud rates MUST match in order to maintain proper operation.

NOTE: Mismatched baud rates between printer and computer will cause the printer to print improper characters (garbage).

The data bitstream can be checked for accuracy by the use of parity bits. The parity bit is added to the transmitted data frame and decoded when received. The computer and printer baud rate must be equal for correct system operation.

The printer serial port may not conform to RS-232C pin configurations, thus the pinouts for the PRINTER serial port must be obtained before a serial interface can be developed.

3.5 Serial Printer Connection

To connect a serial printer to the Sirius 1, a suitable cable is required - cables should be attached as follows:

  1. Attach the cable between the Sirius 1 serial port B (see 3.1) and the printer connector.
  2. Set the printer switches for 8-data bits, 1 stop bit, 4800 baud and no parity. Set DTR protocol (refer to printer manual).

You may set the baud rate at a rate different from that mentioned in (2) - but you will then be required to set the baud rate using the baud rate selection utility, PORTSET or PORTCONF (see 3.6), or alternatively you will need to build a new operating system. (See Programmer's Toolkit).

Make certain that the operating system is configured for printing to the serial port by using SETIO (MS-DOS) or STAT (CP/M-86) as described in Section 3.6.


3.5.1 Serial Cable Requirements

If a suitable serial cable is not available, you will need to make one - use the guidelines that follow to create your own cable:

You will require 1 x D25 male, 1 x D25 female connectors, and a length of 6-12 core cable, with a maximum length of about 15m. Refer to the port layout in your printer manual, if pin 3 is received data (labelled RXD or RD), and pin 20 is data terminal ready (labelled DTR), then construct your cable as follows:


                   Computer                 Printer

                      1 ---------------------------- 1
                      2 ---------------------------- 3
                      3 -----------------------------2
                      7 -----------------------------7
                      5 -----------------------------20

This cable, often called a Modem Eliminator Cable, must be attached as shown - mark the Computer/Printer connectors as a reference.
With some printers you can add an extra connection:


                    20 ----------------------------- 5

This allows the cable to be used with either end connected to the computer.

If pin 3 is receive data (RXD or RD) and pin 20 is not data terminal ready (DTR) then construct your cable as follows:


                   Computer                 Printer

                      1 --------------------------- 1
                      3 --------------------------- 2
                      2 --------------------------- 3
                      7 --------------------------- 7
                      5 --------------------------- x

where x is the pin number of the BUSY signal (possibly pin 11 or 19). If this method is used, make sure that the polarity of the BUSY signal is correct; this is usually switch selectable (it should be LOW when printer is BUSY).

This cable must be attached as shown - mark the Computer/Printer connectors as a reference.

If the printer requires pins 6 and 8 to be held high then add the following connection:


                    20 ----------------------------  6
                                        |----------  8

See Section 3.4 for details of Sirius serial port pinouts and Appendix C for further sample cables.


3.6 Operating System Port Utilities

The operating system was supplied with programs under both CP/M-86 and MS-DOS to allow the temporary selection of both baud rate and list device port.If you attach a printer to your system you may be required to perform some of the following steps in order to use the printer. Before you use any of the utilities discussed you need to be aware of the port the printer is attached to; Port A, B or Parallel. You will also need to know, except in the case of a parallel printer, what baud rate, stop-bits and parity your printer is set up at. Note that many printers will start to lose data at baud rates above 4800, you must, therefore, select a baud rate that your printer can handle. Ideally your operating system should be configured permanently using the system generation packages. You must tell the operating system which port you intend using and what baud rate the printer requires (if using a serial port).

The CP/M-86 System Configuration package was available separately and the MS-DOS System Generation package is found in the Programmer's Toolkit.

If you wish to temporarily change printer port you can use STAT (CP/M-86) or SETIO (MS-DOS) and the baud rate can be changed using PORTSET, PORTCONF or simple Basic programs.


3.6.1 SETIO - MS-DOS List Device Selection Utility

SETIO is a utility program to display or change the I/O byte. The I/O byte associates a logical device with a physical device.SETIO has three modes. If invoked without parameters, the assignment table is displayed. If invoked with an invalid device assignment, the command format is displayed with the assignment table. If invoked with a valid device assignment, an updated table is displayed with the new assignment.

To select the correct port for the list device you have attached, the SETIO program has been provided. This program is used as follows:

SETIO LST = TTY  - printer is attached to port A
SETIO LST = UL1  - printer is attached to port B
SETIO LST = LPT printer is attached to parallel port

It is recommended that your printer be attached to either port B or the parallel port.

Once SETIO has executed, it displays a map of the ports, with the ones you selected highlighted on the screen - if this is not correct, repeat the process.

Examples:(highlighted fields are enclosed in square brackets [ ]  ).

A>setio (without parameters)

Logical Device Physical Devices
CON TTY[CRT]BAT UL1
AUXIN [TTY]PTR UR1 UR2
AUXOUT [TTY]PTP UP1 UP2
LST TTY CRT LPT[UL1]

A>setio ?<cr> (note: ? is an invalid parameter)

SET I/O VERSION n.n

usage:
         SETIO[<logical device> = <physical device>]

CON TTY[CRT]BAT UL1
AUXIN [TTY]PTR UR1 UR2
AUXOUT [TTY]PTP UP1 UP2
LST TTY CRT LPT[UL1]

A>setio lst = tty<cr> (valid parameters)

SET I/O VERSION n.n

CON TTY[CRT]BAT UL1
AUXIN [TTY]PTR UR1 UR2
AUXOUT [TTY]PTP UP1 UP2
LST [TTY]CRT LPT UL1

In this last example, we have set the printer port to port A (which usually comes set at 1200 baud).


Logical and Physical Devices:

Device
Type/Name
Description
Logical Devices  
CON Console device - the principal interactive console which communicates with the operator. Typically, CON: is a device such as a CRT or teletype
LST List device - the principal listing device; usually a hard-copy device, such as a printer or teletype
AUXIN Auxiliary input device
AUXOUT Auxiliary output device
   
Physical Devices  
TTY Serial output-port A (teletype-style printer - RS232C)
CRT Keyboard and cathode ray tube display
LPT Parallel port printer (Centronics)
UL1 Serial printer - port B (RS232C)
BAT Batch mode-reader as input; (AUXIN) a printer (LST) as output
UC1 External console (to be developed)
PTR High speed read (to be developed)
UR1 (to be developed)
UR2 (to be developed)
PTP High speed punch (to be developed)
UP1 (to be developed)
UP2 (to be developed)

Examples:

SETIO LST=LPT Direct printer output to the centronics port
SETIO LST=CON Direct printer output to the console (good for debugging software without wasting paper)
SETIO CON=TTY Redirect console I/O to port A. (this enables an external terminal to be connected to the Sirius, but note that the Sirius' own screen and keyboard will be inoperable)

3.6.2 STAT - CP/M-86 List Device Selection Utility

To select the correct port for the list device you have attached, the STAT program has been provided. This program is used as follows:

STAT LST:=TTY: - printer is attached to port A
STAT LST:=UL1: - printer is attached to port B
STAT LST:=LPT: - printer is attached to parallel port

It is recommended that your printer be attached to either port B or the parallel port.

SIRIUS 1 Device Name Assignment for CP/M-86

CP/M Physical Device Name

TTY: Serial Output Port A
CRT: Keyboard and Display CRT
UC1: External Console (reserved)
PTR: High Speed Read (reserved)
UR1: (Reserved)
UR2: (Reserved)
PTP: High Speed Punch (reserved)
UP1: (Reserved)
UP2: (Reserved)
LPT: Parallel Port (Centronics)
UL1: Serial Printer - Port B

CP/M Logical Device Name

CON: Logical Console device
Typical Assignment:
Assignment options:
 
CRT:
TTY:, UC1:, BAT:(see below)
LST: Logical List device
Assignment options:
 
LPT:, UL1:, TTY:, CRT:
RDR: Logical Reader Device
Assignment options:
 
TTY:, PTP:, UP1:, UP2:
PUN: Logical Punch device
Assignment options:
 TTY:, PTP:, UP1:, UP2:
BAT: Batch mode reader (RDR:) as input, a printer (LST:) as output.

Logical Device Characters

CONSOLE The principal interactive console which communicates with the operator, accessed through CONST, CONIN, and CONOUT. Typically, the CONSOLE is a device such as a CRT or teletype
LIST The principal listing device, if it exists on your system, is usually a hard-copy device such as a printer or teletype.
PUNCH The principal tape punching device, if it exists, which is normally a high-speed paper tape punch or teletype.
READER The principal tape reading device, such as a simple optical reader or teletype.
IOBYTE Field Definitions

CONSOLE field (bits 0,1) (CON:)

0 - console is assigned to the console printer (TTY:)
1 - console is assigned to the CRT device (CRT:)
2 - batchmode: use the READER as the CONSOLE INPUT, and the LIST device as the CONSOLE output (BAT:)
3 - user defined console device (UC1:)

READER field (bits 2,3) (RDR:)

0 - READER is the Teletype device (TTY:)
1 - READER is the high-speed reader device (PTR:)
2 - user defined reader #1 (UR1:)
3 - user defined reader #2 (UR2:)

PUNCH field (bits 4,5) (PUN:)

0 - PUNCH is the teletype device (TTY:)
1 - PUNCH is the high-speed punch device (PTP:)
2 - user defined punch #1 (UP1:)
3 - user defined punch #2 (UP2:)

LIST field (bits 6,7) (LST:)

0 - LIST is the teletype device (TTY:)
1 - LIST is the CRT device (CRT:)
2 - LIST is the line printer device (LPT:)
3 - user defined list device (UL1:)

3.6.3 PORTSET - MS-DOS Baud Rate Selection Utility

To select the correct baud rate for ports A or B (but this is not applicable to the parallel port), the PORTSET program is provided. This program is menu driven, and is used as follows:

To the prompt type PORTSET, the screen will display a choice of three ports:

  1. Port A (RS232C)
  2. Centronics/Parallel Port
  3. Port B (RS232C)

Type either 1,2 or 3. If you type 1 or 3, the next menu screen is displayed - this screen has baud-rate choices labelled A through N - select one of the baud-rates.

3.6.4 PORTCONF - CP/M-86 Baud Rate Selection Utility

This program is used in exactly the same manner as PORTSET (see 3.6.3)

3.7 Serial Input/Ouput Port Addresses

The two serial input/output ports are memory mapped ports located in the memory segment E000hex; and they are mapped as follows:

E000:40 -   port A data (input/output)
E000:41 -   port B data (input/output)
E000:42 -   port A control (read/write)
E000:43 -   port B control (read/write)

The following information is available in each port's control register:

bit 0 -   rx character available
bit 1 -   not used
bit 2 -   tx buffer empty
bit 3 -   DCD
bit 4 -   not used
bit 5 -   CTS
bit 6 -   not used
bit 7 -   not used

See Section 3.4 for information on each port's pinouts.

Note that writing a 10hex to the relevant control register allows the resensing of the modem leads (i.e. DCD and CTS) with their current values being updated in the port's control register. Since the Sirius 1 configures the NEC 7201 chip to operate in auto-enable mode, DCD (pin 8 on the port connector) must be ON, and CTS (pin 5 on the port connector) must be ON to enable the 7201's receiver and transmitter respectively. RTS and DTR are always ON as a convenient source for an RS-232C control ON (+12 volts).

3.8 Baud Rate and Data Input/Output - Sample Programs

The means of establishing the baud rates, receiving and transmitting data are discussed in the following programs. The serial port's control register are discussed in 3.7 - the means of accessing them is better described with the programming examples that follow.

The following programs provide information on how to set up the baud rates on the serial ports (A and B) - they also demonstrate how to send and receive data from these ports.

3.8.1 Microsoft MS-BASIC -- Baud Rate and Data Input/Output

The following program may be used in place of PORTSET or PORTCONF if you omit the lines 500 through 740 inclusive.


10 DIM RATE(14)
20 REM Select the data port
30 PRINT CHR$(27)+"E"; : REM Clear the screen
40 PRINT : PRINT : PRINT : PRINT
50 PRINT "The serial ports are:" : PRINT
60 PRINT ,"          A - Serial Port TTY - left hand on back">
70 PRINT ,"          B - Serial Port UL1 - right hand on back"
80 PRINT : PRINT
90 PRINT ,"Select the port you want to use, A or B ";
100 PORT$ = INPUT$(1)
110 PRINT PORT$
120 IF PORT$ = "a" THEN STATIO=2 : DATIO=0 : GOTO 210
130 IF PORT$ = "A" THEN STATIO=2 : DATIO=0 : GOTO 210
140 IF PORT$ = "b" THEN STATIO=3 : DATIO=1 : GOTO 210
150 IF PORT$ = "B" THEN STATIO=3 : DATIO=1 : GOTO 210
160 GOTO 30
200 REM Set the baud rate
210 PRINT CHR$(27)+"E"; : REM Clear the screen
220 PRINT : PRINT : PRINT : PRINT
230 PRINT "The available baud rates are as follows:" : PRINT
240 PRINT ," 1 =     300 baud"
250 PRINT ," 2 =     600 baud"
260 PRINT ," 3 =    1200 baud"
270 PRINT ," 4 =    2400 baud"
280 PRINT ," 5 =    4800 baud"
290 PRINT ," 6 =    9600 baud"
300 PRINT ," 7 =   19200 baud"
310 PRINT : PRINT : PRINT
320 PRINT "Select one of the above baud rates: ";
330 RATE$ = INPUT$(1)
340 IF RATE$ > "7" THEN 210
350 IF RATE$ < "1" THEN 210
360 PRINT RATE$
400 REM Now set the baud rate in the port selected
410 DEF SEG = &HE002
420 IF DATIO = 0 THEN POKE 3,54 : IF DATIO = 1 THEN POKE 3,118
430 FOR I = 1 TO 14
440 READ RATE(I) : REM Set the baud rate matrix
450 NEXT I
460 NODE = (VAL(RATE$)-1)*2+1
470 POKE DATIO,RATE(NODE)
480 POKE DATIO,RATE(NODE+1)
500 REM Now data may be entered and sent down line
510 PRINT CHR$(27)+"E"; : REM Clear the screen
520 PRINT : PRINT ,"Baud rate established"
530 PRINT : PRINT : PRINT
540 DEF SEG = &HE004
550 PRINT ,"Enter data to be sent down line with return to end"
560 PRINT ,"or just press return to receive data -"
570 PRINT
580 TEXT$=INKEY$
590 IF TEXT$="" THEN 630
600 IF TEXT$=CHR$(13) THEN PRINT TEXT$ :TEXT$=CHR$(126) :GOTO 620
610 PRINT TEXT$;
620 GOSUB 650
630 GOSUB 690
640 GOTO 580
650 STATUS=PEEK (STATIO) : STATUS=STATUS AND 4
660 IF STATUS = 0 THEN 650 :REM Waiting to send char
670 POKE DATIO, ASC(TEXT$)
680 RETURN
690 STATUS = PEEK(STATIO) :STATUS = STATUS AND 1
700 IF STATUS = 0 THEN RETURN : REM No char available
710 DATUM = PEEK (DATIO) : DATUM = DATUM AND 127
720 IF DATUM = 126 THEN PRINT CHR$(13) : RETURN
730 PRINT CHR$(DATUM); :REM Show char from line
740 RETURN
1000 DATA 04,1,&H82,0,&H41,0,&H20,0,&H10,0,8,0,4,0

The above program may be used to send characters between two Sirius'. Use the following cable connection.

                     
            CABLE SIRIUS TO SIRIUS

                    1 -------------------- 1
                    2 -------------------- 3
                    3 -------------------- 2
                    7 -------------------- 7
                    5 ----- |       |----- 5 
                    8 ----- |       |----- 8
                  20 ----- |       |----- 20 

3.8.2 MACRO-86 Assembler -- Baud Rate and Data Input/Output

The following assembler modules may be included in a program and called with the stated parameters. The character input and output modules will need re-coding if your program requires status return rather than looping for good status.


rates   db      04h,1h,82h,0h    ;baud rate conversion table
          db      41h,0h,20h,0h
          db      10h,0h,8h,0h
          db      4h,0h

;**********************************************************
;
; Routine:      BAUD_SET
;
; Function:     To set Port A or B baud rate
;
; Entries:      AL = 0=PortA, 1=PortB
;                  DX = 0=300 baud,  1=600 baud,  2=1200 baud
;                    3=2400 baud, 4=4800 baud, 5=9600 baud
;                    6=19200 baud
;
; Returns:      None
;
; Corruptions: ES, AX, BX, CX, DX
;
;**********************************************************

baud_set:
        mov     cx,0e002h               ;get the segment
        mov     ES,cx                   ;init the segment register
        mov     bx,3                    ;point to counter control
        or        al,al                   ;see if Port A or B to be set
        jnz      set_B                   ;AL > 0, so set Port B counter
;
        mov     byte ptr ES:[bx],36h    ;set it for port A
        jmp     short set_rate          ;  and input the Baud rate
;
set_B:
        mov     byte ptr ES:[bx],76h    ;set port B counter
;
set_rate:
        mov     bx,offset rates         ;get the baud rate table
        shl      dx,1                    ;DX = DX * 2 for words
        add     bx,dx                   ;point to baud rate entry
        mov    dx,[bx]                 ;get the baud rate
        xor      bh,bh                   ;BH=0
        mov     bl,al                   ;get the required port
        mov     byte ptr ES:[bx],dl     ;send first byte
        mov     byte ptr ES:[bx],dh     ; and last byte of rate
        ret                             ;baud rate established


;**********************************************************
;
; Routine:      SEND_CHAR
;
; Function:     To output a character to a serial port
;
; Entries:      AL = 0=PortA, 1=PortB
;                  AH = Character to send
;
; Returns:      None
;
; Corruptions: ES, AX, BX
;
;**********************************************************

send_char:
        mov     bx,0e004h               ;get the port segment
        mov     ES,bx                   ;set the segment
        xor      bh,bh                   ;BH=0
        mov     bl,al                   ;get the required port
        add     bl,2                    ;required port status
;
in_status_loop:
        mov     al,ES:[bx]              ;get the status
        and     al,4h                   ;mask for TX empty
        jz        in_status_loop        ;not ready - loop
;
        sub     bl,2                    ;point to data
        mov    ES:[bx],ah              ;character gone
        ret


;**********************************************************
;
; Routine:      GET_CHAR
;
; Function:     To input a character from a serial port
;
; Entries:      AL = 0=PortA, 1=PortB
;
; Returns:      AL = character
;
; Corruptions: ES, AX, BX
;
;**********************************************************

get_char:
        mov     bx,0e004h               ;get the port segment
        mov     ES,bx                   ;set the segment
        xor     bh,bh                   ;BH=0
        mov     bl,al                   ;get the required port
        add     bl,2                    ;required port status
;
out_status_loop:
        mov     al,ES:[bx]              ;get the status
        and     al,1h                   ;mask for RX character avail
        jz      out_status_loop         ;not ready - loop
;
        sub     bl,2                    ;point to data
        mov     al,ES:[bx]              ;character received
        ret

3.9 Transferring Files to and from another computer

ASCII files may be transferred to and from another computer using the serial communications port (DB25 connector nearest the video connector).

Using the CP/M or MS-DOS system generation package, configure a system with the serial ports set to the required baud rates, stop and parity bits. (Avoid baud rates above 2400).

Make up a cable to connect the serial port to the other computer. Consult the specifications of the other computer carefully. The connection diagram for the MT-180 printer cable has been used successfully to communicate with other computers. Also strapping pins 4, 5 and 8 has been used with success.

Using PIP treat the communications port as the logical paper tape reader (RDR:) and punch (PUN:). (to run PIP under MS-DOS, use the CP/M-86 emulator).

To transfer a file into Sirius start with the following command to see if Sirius is receiving:

        PIP CON:=RDR:

If not receiving, check your connection cable, try swapping connections to pins 2 and 3. Make sure all signals going to the Sirius are correct.

If the above command produces weird characters (when transmitting ASCII) then it is possible that the top bit is set on some bytes (WordStar files do this, Sirius displays a 256 character set), try the following command which zeros the top bit:

        PIP CON:=RDR:[Z]

Otherwise, if you get normal characters bearing little relationship to the original file, check the baud rates.

When communication is established, transfer data to a named file: PIP FILENAME=RDR:

Remember to send an EOF (^Z) from the other computer so that PIP knows it has finished. Limit the size of the files transferred to under 32K (the size of PIP's buffer) otherwise characters will be lost.

If you wish to transfer binary files you will have to encode the binary data into ASCII. The problem with binary is that ^Z may be valid data. Certainly the [O] option can be used for transferring binary files internally but externally there is no way for PIP to know that the transfer is complete.

An alternative method of transferring files is to use the VT52 emulation package and use the Sirius as a terminal onto another computer. This package allows the transfer of files to and from the host.

3.10 Sirius 1 IEEE-488 Port

The Sirius 1 IEEE-488 cable attaches to the parallel port - the pin number refers to the actual computer port connector; the IEEE-488 pin number refers to the standard IEEE-488 pin-out as they must attach to the parallel port.

The IEEE pin numbers referred to with the (**z) are wires that are to be bound together as twisted pairs.

An IEEE 488 operating system must first be created using the IEEE 488 Toolkit and the Programmer's Toolkit. The necessary IEEE 488 system files are copied to the system generation disc found in the Programmer's Toolkit and used to generate the operating system.


Sirius Pin Number     IEEE Signal   IEEE Pin Number

                  1  ----------- DAV  ------------- 6   (**a)
                  19 ----------- GND  ------------- 18  (**a)
                  2  ----------- DIO1 ------------- 1
                  3  ----------- DIO2 ------------- 2
                  4  ----------- DIO3 ------------- 3
                  5  ----------- DIO4 ------------- 4
                  6  ----------- DIO5 ------------- 13
                  7  ----------- DIO6 ------------- 14
                  8  ----------- DIO7 ------------- 15
                  9  ----------- DIO8 ------------- 16
                 10 ----------- NRFD  ------------- 7   (**b)
                 28 ----------- GND   ------------- 19  (**b)
                 11 ----------- SRQ   ------------- 10  (**c)
                 29 ----------- GND   ------------- 22  (**c)
                 13 ----------- NDAC  ------------- 8   (**d)
                 33 ----------- GND   ------------- 20  (**d)
                 15 ----------- EOI   ------------- 5
                 17 ----------- shield ----------- 12
                 34 ----------- REN   ------------- 17
                 35 ----------- ATN   ------------- 11  (**e)
                 16 ----------- GND   ------------- 23  (**e)
                 36 ----------- IFC   ------------- 9   (**f)
                 27 ----------- GND   ------------- 21  (**f)
                 20 ----------- GND   ------------- 24

3.11 Sirius 1 Control Port (internal port)

             Pin Number           Signal        

                  1 --------------- -12V
                  2 --------------- -12V
                  3 --------------- Not connected
                  4 --------------- Not connected
                  5 --------------- +12V
                  6 --------------- +12V
                  7 --------------- +5V
                  8 --------------- +5V
                  9 --------------- Not connected
                 10 --------------- Light Pen
                 11 --------------- GND
                 12 --------------- CA1
                 13 --------------- GND
                 14 --------------- CA2
                 15 --------------- GND
                 16 --------------- PA0
                 17 --------------- GND
                 18 --------------- PA1
                 19 --------------- GND
                 20 --------------- PA2
                 21 --------------- GND
                 22 --------------- PA3
                 23 --------------- GND
                 24 --------------- PA4
                 25 --------------- GND
                 26 --------------- PA5
                 27 --------------- GND
                 28 --------------- PA6
                 29 --------------- GND
                 30 --------------- PA7
                 31 --------------- GND
                 32 --------------- PB0
                 33 --------------- GND
                 34 --------------- PB1
                 35 --------------- GND
                 36 --------------- PB2
                 37 --------------- GND
                 38 --------------- PB3
                 39 --------------- GND
                 40 --------------- PB4
                 41 --------------- GND
                 42 --------------- PB5
                 43 --------------- GND
                 44 --------------- PB6
                 45 --------------- GND
                 46 --------------- PB7 / CODEC Clock Output
                 47 --------------- GND
                 48 --------------- CB1
                 49 --------------- GND
                 50 --------------- CB2

3.12 MS-DOS Logical Devices

As explained in the MS-DOS operating system manual, certain 3 - letter file names are reserved for I/O devices:

  • AUX refers to input from or output to an auxiliary device connected to serial port A (TTY).
  • CON refers to keyboard input or output to the screen (CRT).
  • LST refers to the printer which may be redirected to any of the I/O ports using SETIO.
  • NUL does not refer to a particular file or device. NUL is used when the syntax of a command requires an input or output file name. NUL is sometimes referred to as a 'bit-bucket'. Any output to NUL will be lost, but will not cause the system to 'hang'. It is useful for debugging programs.

Examples of use:

  1. At the Command level.


  2. COPY FILENAME AUX

    This command will transmit the file 'FILENAME' to the device connected to port A (the TTY device).

  3. At the Command level.


  4. COPY CON LST

    This command will cause any keyboard input to be sent to the printer rather than the screen.

  5. In Basic.


  6. 10 OPEN "O",#1,"AUX"
    20 PRINT #1,"XYZ"
    30 CLOSE #1

    This program will cause the string 'XYZ' to be sent to the device connected to serial port A. Note that the string is only sent after the file is closed or the internal buffer is full.

    Using this technique, it is possible to toggle output between the printer (LST) and a device, such as another printer or a plotter, connected to port A (AUX).

  7. 4. In Basic.


  8. 10 INPUT "Do you have a printer attached (Y/N)",A$
    20 IF A$="Y" OR A$="y" THEN F$="LST" ELSE F$="CON"
    30 OPEN "O",#1,F$
    40 PRINT #1,.......

    This example demonstates the ability to send output to the screen if no printer is present. Useful for debugging.

  9. 5. In Basic.

  10. An MS-BASIC demonstration program (only to be run under MS-DOS V1.25 BIOS 2.5 or later) allows the operator to choose the destiny of the output. The output can be to a file, or to a logical device. The logical devices are "CON" (=console), "LST" (=primary list device), or "AUX" (=auxiliary port).

    In this example the "AUX" logical device is being used as a secondary printer.

    10 PRINT CHR$(27)+"E"
    20 PRINT CHR$(27)+"Y"+CHR$(41)+CHR$(35);
    30 PRINT"WHERE IS THE DESTINATION OF THE LISTING TO BE?"
    40 PRINT CHR$(27)+"Y"+CHR$(44)+CHR$(45);
    50 PRINT"CONSOLE, PRIMARY LIST DEVICE, AUXILIARY PORT"
    60 PRINT CHR$(27)+"Y"+CHR$(46)+CHR$(35);
    70 PRINT"PLEASE TYPE IN F,C,P,or A"
    80 PRINT CHR$(27)+"Y"+CHR$(52)+CHR$(60);
    90 INPUT A$
    100 IF A$<>"F" THEN IF A$<>"C" THEN IF A$<>"P" THEN IF A$<>"A" THEN 80
    110 IF A$="C" THEN A$="CON"
    120 IF A$="P" THEN A$="LST"
    130 IF A$="A" THEN A$="AUX"
    140 IF A$="F" THEN INPUT "FILE SPECIFIER";A$
    150 CLOSE
    160 PRINT CHR$(27)+"E"
    170 OPEN "O",#1,A$ 'OPEN A SEQUENTIAL FILE
    180 FOR I=1 TO 20 'CREATE TEST DATA
    190 B$="TEST DATA 1234567890 abcdefghijklmnopqrstuvwxyz"
    200 PRINT #1,B$
    210 NEXT I
    220 CLOSE
    230 SYSTEM
3.13 Sample Program for Initialising Printers

;
; PROGRAM NAME -- INIT
; 
; Program to print a string to the printer. You will need the
; Programmers Toolkit and a suitable editor to proceed. Use the
; editor to generate or alter this program and store it in the
; file INIT.ASM. 
;
; Change the string 'AAAAAA' at 'BUFFER' to the string you want. 
; (This string can be any length you want)
;
; Use MACRO86 to assemble the program then use LINK to link it
; as follows:
;
;	MACRO86 INIT;
;	LINK INIT;
;
; LINK will produce an error 'Warning: No STACK segment', ignore it.
; The file INIT.EXE produced by LINK will not run. You must use
; DEBUG to generate INIT.COM as follows:
;
;	DEBUG INIT.EXE
;	N INIT.COM
;	W
;	Q
;
; The resulting program INIT.COM will run
;

code	segment
assume	cs:code, ds:code

boot	equ	0
listout	equ	5		; list output function
bdos	equ	21h		; DOS function call
;
cr	equ	0dh		; carriage return
lf	equ	0ah		; line feed
;
	org	100h
start:
	mov	bx,offset buffer	; point to output string
again:
	mov	ah,listout	; set parameters for list output
	mov	dl,[bx]		; get next character
	cmp	dl,0		; test for end
	jz	cont
	push	bx
	int	bdos		; print it
	pop	bx
	inc	bx		; next
	jmp	again

cont:
	mov	ah,boot		; reboot
	int	bdos
;
buffer	db	'AAAAAA'	; place initialisation string here
	db	cr,lf
	db	0		; end of print string

code	ends
	end

Last update: 02/03/2007