Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support

Apple II Miscellaneous
#16:    Apple II Parallel Interface Card Firmware

Written by:    Jim Luther                                           July 1990

This Technical Note documents the commands the Apple II Parallel Interface 
Card's firmware supports and how to find the slot occupied by an Apple II 
Parallel Interface Card.
_____________________________________________________________________________

Parallel Printer Interface Card Commands

The manual that shipped with the Apple II Parallel Interface Card states 
correctly that its firmware can be "identical to the firmware in the earlier 
Apple II Centronics(R) Printer Card" or that it can be "identical to the 
firmware in the earlier Apple II Parallel Printer Card."  However, the manual 
did not correctly document the commands the Parallel Interface Cards can 
handle or explain the commands clearly.

Apple II Parallel Interface Card commands, embedded in the output flow to the 
card's firmware, are invoked by the BASIC output routines.  The following 
three options affect the output data flow and can be controlled by sending 
control codes as commands to the firmware:

    Flow option          Description
    _________________________________________________________________________
    Video echo           When this option is on, characters sent to the 
                         printer are echoed to the video screen (via COUT1) 
                         after they are sent out the parallel port.
                         Note:  When an Apple II Parallel Interface Card in 
                                Parallel Printer mode is echoing characters 
                                to the video screen, the line length is 
                                forced by the card's firmware to 40.
    Line length          When the video echo option is off, the line length 
                         (the number of character sent before a forced 
                         carriage-return) can be set in the range of 
                         40 to 255 characters.  When video echo is on, the 
                         line length is forced to 40.
    Automatic line-feed  When this option is on, the firmware generates 
                         and sends a line-feed character after each 
                         carriage-return character sent.
                         Note:  The automatic line-feed option can only be 
                                used when the Apple II Parallel Interface 
                                Card is in Parallel Printer mode.
    _________________________________________________________________________

All commands are preceded by a command character.  The normal command 
character is Control-I (ASCII $09).  If you want to change the command 
character from Control-I to another command character (for example, Control-
W), send Control-I, Control-W.  To change back, send Control-W, Control-I.  
The format of the commands is as follows:

    {command-character} {command-string}

There are two types of commands:

  o  Commands that only change the video echo mode or the automatic 
     line-feed mode.  The command format for these commands consist of 
     an uppercase letter by itself (for example, I to restore the 
     default settings).
  o  Commands that set the line length and change the video echo mode 
     or automatic line-feed mode.  The command format for these 
     commands consists of a number, represented by n, followed by an 
     uppercase letter with no space between the characters.  The 
     number, in the range of 40 to 255 characters is the new line 
     length setting  (for example, 80N to set the line length to 80).


Commands in Centronics Printer Mode (switch 6 on)

In Centronics Printer mode, the default settings are:

  o  Video echo option on
  o  40-column line length
  o  Command character = Control-I

The Centronics mode firmware does not support the option to automatically 
generate line-feed characters after carriage return characters.  When the 
interface card is initialized in Centronics mode, it also sends the Centronics 
MicroPrinter 40-column mode control character to the printer (ASCII $9E).

The following are the commands supported by the Apple II Parallel Interface 
Card when it is in Centronics Printer mode:

nN

    The N command always does these two things:

      o  Turn the video echo option off.
      o  Send the Centronics MicroPrinter 80-column mode control character 
         to the printer (ASCIIÊ$1D).

    In addition, if the number n is included, the line length is set to n.  
    The number n must be in the range of 40 to 255 characters.

nO

    The O command always does the following:

      o  Turn the video echo option on.

    In addition, if the number n is included, the line length is set to n.  
    The number n must be in the range of 40 to 255 characters.


Commands in Parallel Printer Mode (switch 6 off)

In Parallel Printer mode, the default settings are:

  o  Video echo option on
  o  40-column line length
  o  Automatic line-feed option on
  o  Command character = Control-I

The following are the commands supported by the Apple II Parallel Interface 
Card when it is in Parallel Printer mode:

I or M

    The I and the M commands always do these three things:

      o  Turn the video echo option on
      o  Force the line length to 40
      o  Turn the automatic line-feed option on

K or O

    The K and the O commands always do these three things:

      o  Turn the video echo option on
      o  Force the line length to 40
      o  Toggle the automatic line-feed option

nH or nL

    The H and the L commands always do these two things:

      o  Turn the video echo option off
      o  Turn the automatic line-feed option off

    In addition, if the number n is included, the line length is set to n.  
    The number n must be in the range of 40 to 255 characters.

nJ or nN

    The J and the N commands always do the following:

      o  Turn the video echo option off

    In addition, if the number n is included, the line length is set to n.  
    The number n must be in the range of 40 to 255 characters.  These 
    commands do not affect the automatic line-feed option setting.


Finding the Parallel Printer Interface Card

The Apple II Parallel Interface Card manual does a good job of describing the 
Apple Pascal 1.1 interface standard.  However, publishing that information in 
that manual is very misleading since the Apple II Parallel Interface Card does 
not support any part of the PascalÊ1.1 interface standard.

However, since most programs use the Pascal 1.1 device signature bytes to 
identify peripheral cards, here are the values you find in the Pascal 1.1 
device signature byte addresses:

    Address    Value
    ________________
    $Cs05      $48
    $Cs07      $48
    ________________

Remember, these values do not correspond to any signature bytes defined by the 
Pascal 1.1 interface standard.  The address $Cs0B contains the value $58 and 
the address $Cs0C contains the value $FF, (the last two bytes of a JSR $FF58 
to identify the slot) but these two locations should not be used to identify 
parallel cards in general.

Further Reference
_____________________________________________________________________________
  o  Apple II Parallel Interface Card Manual

Centronics is a registered trademark of Centronics Data Computer Corporation.

