Steve this how to allow more than one PIA, VIA, PIAT or any other
chip that you want to map into the D3XX address space.


You need the following lines form the mother board of the computer.

Address 4
Address 5
Address 6
Chip Select 2 from pin 23 of the orginal PIA CHIP.


You will need 1 74LS138 .


                         !------\/------!
              Address 4 -! 1          16!- +5 Volts
              Address 5 -! 2     7    15!- To CS2 of orginal PIA
              Address 6 -! 3     4    14!-
          Chip Select 2 -! 4     L    13!-
Connect to Pin 8 of 138 -! 5     S    12!-
Connect to Pin 16 of 138-! 6     1    11!-
                        -! 7     3    10!-
                 Ground -! 8     8     9!-
                         !--------------!


With the above inputs you will get the following output lines.


                         !------\/------!-
                        -! 1          16!-
                        -! 2     7    15!- Address D30X
                        -! 3     4    14!- Address D31X
                        -! 4     L    13!- Address D32X
                        -! 5     S    12!- Address D33X
                        -! 6     1    11!- Address D34X
           Address D37X -! 7     3    10!- Address D35X
                        -! 8     8     9!- Address D36X
                         !--------------!


The combined diagram looks like this:

                         !------\/------!
              Address 4 -! 1          16!- +5 Volts
              Address 5 -! 2     7    15!- Address D30X
              Address 6 -! 3     4    14!- Address D31X
          Chip Select 2 -! 4     L    13!- Address D32X
Connect to Pin 8 of 138 -! 5     S    12!- Address D33X
Connect to Pin 16 of 138-! 6     1    11!- Address D34X
           Address D37X -! 7     3    10!- Address D35X
                Ground  -! 8     8     9!- Address D36X
                         !--------------!


to Get the second PIA to run piggy back all pins of the new PIA onto
the old PIA except for pins 2 thru 17 and pin 23 connect it pin 14 of
the 74LS138 chip and that way you will have 1 PIA at location D300
thru D30F and the other at location D310 thru D31F


Pins 2 thru 17 are the 2 I/O ports out of the computer.  Connect
these to any other I/O device you would like maybe even a couple of
DB9 connectors.


This same thing could also be used to wire a 6522 VIA chip with
virualy the same pinouts except you would have to do something with
the register select lines.

You could also hook the 6524 PIAT chip into or any other chip that
needed a 1 line chip select in a low state. and didn'T cross the
addressing rang without some other changes in the circuit.



added notes:

     TO implement a network using this all that is required is
another computer with this mode and a cable running from pins 2 thru
9 of both systems.

     This will give you a 8 bit bus between both systems, then on the
programming side of the house you muse write a routine to patch into
the IRQ routine and check to see if the second PIA is giving the
interupt and if so handle the interupt, else jump into the stand
atari IRQ handler.

so what you will have is this.


-----------                             ------------
|         |                             |          |
|computer |>_pins 2 thru 9 of pia #2  _<| computer |
|         |                             |          |
|   A     |                             |    B     |
|         |                             |          |
|         |                             |          |
-----------                             ------------
    \/                                        \/
     |                                         |
     |                                         |
     |                                         |
     |                                         |
     |                 -----------             |
     |                 |         |             |
pins 10 thru 17 of     |computer |>____ Pins 10 thru 17 of pia #2
     pia #2 __________<|         |
                       |   C     |
                       |         |
                       |         |
                       -----------


Programming notes;

 All locations are in decimal

  Location 16 will have to be updated with new irq mask
  Locations 534 and 535 will point to your new irq code,
   your irq code upon init should use the orginal data in this
   location to point to the atari IRQ handler.

your machine code should do something like this.

entered from indirect jump into 534

        Disable all interuppts.
        check to see it pia #2 caused irq
        if not reenable interupts and jump to ATARI's IRQ handler.
        If so then do what ever processing is necessary such as.
        receive byte and store in a buffer till eol received.
        after eol received move buffer to sparta dos cli and execute.
       this is just example of this.
