home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / hard_ref / io / io.txt
Text File  |  1988-04-06  |  11KB  |  262 lines

  1.      An Input/OUTPUT Port for the Cartridge Slot of the 520ST
  2.  
  3.      By Douglas P. B. Renaux - Feb 27, 1986.
  4.  
  5.  
  6.      This document describes the hardware and software of a 8 lines input/
  7. 16 lines output port. The circuitry is connected to the Cartridge Slot of 
  8. the ATARI 520 ST. 
  9.  
  10.      IMPORTANT!!! - INFORMATION IN THIS DOCUMENT CAN BE FREELY USED AND
  11. COPIED. HOWEVER, NO CHANGES CAN BE MADE TO IT WITHOUT CONSULTING THE AUTHOR
  12. FIRST, NOR THE AUTHOR'S NAME CAN BE OMISSED IN THE COPIES.
  13.  
  14.      
  15.      Foreword
  16.  
  17.      Although the Cartridge Slot is intended for data input, specifically
  18. from a ROM, it can be used as an output port. To substitute the READ/WRITE
  19. line, that is not available on the slot, I used a WRITE ENABLE LATCH. This
  20. latch is set by READING a memory location. The consequence of seting this
  21. latch is that the output latches will read the data bus during the next 
  22. instruction, which will be a memory WRITE that outputs the desired data.
  23.  
  24.      
  25.      1 - The signals available on the Cartridge Slot
  26.  
  27.           D0..D15 - DATA BUS
  28.           A1..A15 - The 15 least significant addresses from the ADDRESS BUS 
  29.      ROM 3 SELECT - Active when a READ instruction accesses $FB0000 to 
  30.                     $FBFFFF
  31.         UDS',LDS' - Upper and Lower Data Strobe
  32.  
  33.  
  34.      2 - The I/O PORT
  35.  
  36.      The block diagram of the I/O PORT is in the file BLOCKDIA.PI3. Cir-
  37. cuit diagrams are in ADDRESS.PI3 and IN'OUT.PI3. If you don't have these
  38. drawings then in appendix A you can read a description of the circuit.
  39.  
  40.      The circuit of the I/O PORT is standard. A address decoder enables the
  41. output latches or the input buffers when the correct address is accessed.
  42. However, the output latches are only enabled if previously the WRITE ENABLE
  43. LATCH was set.
  44.  
  45.  
  46.  
  47.      Address Decoder:
  48.      The lines A3..A15 are connected to NAND gates that detect when all
  49. these lines are at high level. The lines A2 and A1, select one of the 
  50. four outputs of a decoder.
  51.  
  52.      The output of the NOR gate "a" is active when we read from $FBFFFE.
  53. To decode a read to this address we use the outputs of the two NAND gates,
  54. the output three of the decoder (active when A1 and A2 are high) and the
  55. line ROM 3 SELECT.
  56.      The output of NOR gate "a" sets the WRITE ENABLE LATCH.
  57.  
  58.      The output of NOR gate "b" decodes the address $XXFFFC. To decode an
  59. access to these addresses (read or write), we use the outputs of the NAND
  60. gates, output two of the decoder and the line LDS'. 
  61.      ROM 3 SELECT cannot be used here because it is only active on read.
  62.      When a write instruction accesses the address $10FFFC (non-existent
  63. in 1MByte ST's) then the output of NOR gate "b" becomes active.
  64.  
  65.      An AND gate enables the output latches to read the data bus if the
  66. WRITE ENABLE LATCH is set AND the output of NOR gate "b" is active.
  67.      
  68.      The output of NOR gate "b" is delayed (by four inverters) and then
  69. resets the WRITE ENABLE LATCH, just after the latches have read the data
  70. bus.
  71.  
  72.      NOR gate "c" decodes a read to address $FBFFFA, as gate "a" does, but 
  73. using output one of the decoder. The output of gate "c" enables the buffers
  74. to copy their inputs to the data bus.
  75.  
  76.  
  77.  
  78.      3 - Components
  79.  
  80.      2- 4068    NAND               gates for address decoding
  81.      2- 4002    NOR                gates for address decoding
  82.      1- 4556    1 OF 4 DECODER     for address decoding
  83.  
  84.      1- 4043    SR FLIP-FLOP       write enable latch
  85.      1- 4049    INVERTER 
  86.      1- 4081    AND                
  87.  
  88.      2- 40373   LATCHES            output latches
  89.      1- 74LS244 BUFFERS            input buffers
  90.  
  91.  
  92.  
  93.      4 - Expansion
  94.  
  95.      This I/O PORT is easily expandable to as many I/O lines you want. Only
  96. one WRITE ENABLE LATCH is necessary if the expansion is made in a way that
  97. any write to port instruction resets the latch. Another solution is to have
  98. a reset latch address (as we have a set latch address). In this case the
  99. write to port instructions don't need to reset the latch, and you can output
  100. a block of data to several addresses without needing to set the latch in 
  101. between. Only at the end of the block transfer this would be necessary.
  102.      You can have another 8 inputs by just connecting another 74LS244 to 
  103. D8..D15 of the data bus.
  104.  
  105.  
  106.  
  107.      5 - Software
  108.  
  109.      To write to the output lines the contents of D0:
  110.  
  111.           MOVE.W    $FBFFFE,D1     ;D1 is destroyed, latch is set
  112.           MOVE.W    D0,$10FFFC     ;D0 is latched
  113.  
  114.      To read the input lines to D0:
  115.  
  116.           MOVE.W    $FBFFFA,D0
  117.  
  118.  
  119.  
  120.      6 - Connection to the ST
  121.  
  122.      I could not find a experimentor PC Board with an edge connector that
  123. fits to the ST. So I made a convertor from the 40 pin edge connector (with
  124. spacing of 2mm) to a 64 pins euroconnector (DIN 41612). This convertor is
  125. simply a double sided PCB with 20 lines (on each side) of 1mm spaced by 2mm
  126. (center of one line to center of next line). These lines widen to 2.54 mm
  127. to fit the DIN connector. Line one of the ST goes to line 4 of the DIN 
  128. connector. The tabs of the DIN connector are on the lower side.
  129.                 ______
  130.                 ||   |
  131.                 |.  .|  1
  132.                 |.  .|  2
  133.                 |.  .|  3
  134.               + |.  .|  4 +
  135.         Data 15 |.  .|  5 Data 14 
  136.                 |.  .|     
  137.             :   |    |     : 
  138.             :   |    |     :  
  139.                 |    |
  140.          Ground |.  .| 23 Ground
  141.                 |    |
  142.                 |.  .| 31
  143.                 |.  .| 32
  144.                 ||   |     DIN connector seen from front (connection) side
  145.                 ------
  146.  
  147.      I intend to connect some of the free lines of this connector to inter-
  148. nal signals of the ST. Would be nice to have a standard connector between
  149. ST users.  Whoever has ideas about which signals to connect and to which 
  150. pin should let the others know about it.
  151.  
  152.  
  153.  
  154.      
  155.      7 - Conclusion
  156.  
  157.      It is possible to open the ST !! 
  158.      And this opens a lot of possibilities in hardware design. The 68000's
  159. power can be used outside the ST's box.
  160.      But a complex machine like the ST cannot be easily expanded without
  161. having information about it. The information that ATARI delivers only to 
  162. software houses. Please ATARI, let everybody know about the ST. Let the
  163. POWER be available to all users.
  164.  
  165.  
  166.  
  167.                                                   Douglas P. B. Renaux
  168.                                                   Outshoornstraat 55
  169.                                                   5622GX Eindhoven - NL
  170.                                                   Tel 31-40-436930
  171.                                          (Address valid until May 25,1986)
  172.  
  173.                                     People dealing with hardware design
  174.                                     are cordially invited to contact me.         
  175.  
  176.  
  177.      APPENDIX A
  178.  
  179.      Circuit Description.
  180.  
  181.      Block Diagram:
  182.  
  183.                                      write enable latch
  184.           ___________                      ______  
  185.           |         | Read $FBFFFE         |    |            _____
  186.           |         |----------------------|S  Q|------------| & |
  187.   A15..A1 | ADDRESS | $XXFFFC _________    |    |            |   |---|
  188.   LDS ----| DECODER |-----T---| Delay |----|R   |       |----|   |   |
  189.   ROM3 SEL|         |     |   ---------    ------       |    -----   |
  190.           |         |     |_____________________________|            | 
  191.           |         |                                                | 
  192.           |         |-----------|                                    | 
  193.           -----------  Read     |                                    | 
  194.                       $ FBFFFA  |                           |---------
  195.                             ---------                  ------------
  196.                             |       |                  |          |
  197.                             | INPUT |              D15 | OUTPUT   |
  198.                  D7..D0-----|BUFFERS|---INPUTS       --| LATCHES  |--OUT
  199.                             |       |              D0  |          |
  200.                             |       |                  |          |
  201.                             ---------                  ------------
  202.  
  203.  
  204.      Address Decoder Description:
  205.  
  206.      Address lines A15 to A3 are connected to the inputs of two 4068
  207. (8-input NAND). Inputs are pins 2,3,4,5,9,10,11,12. One of these NAND
  208. gates has three inputs tied high. Power supply is connected to pin 14 (+)
  209. and pin 7 (ground).
  210.      The address lines A2 and A1 are connected to the select lines of the
  211. 4556 (1 of 4 decoder), pins 3 (A2) and 2 (A1). The enable line (pin 1) is 
  212. tied low. Pins 16(+) and 8 (ground). The outputs of the decoder are: 
  213. output 0 at pin 4, output 1 (pin 5), output 2 (pin 6), output 3 (pin 7).
  214.      The second level of the address decoding is done by three NOR gates
  215. of four inputs (4002). Two chips are necessary. These gates are labelled
  216. "a", "b" and "c".
  217.      Pinning of the 4002: inputs 2,3,4,5;      output pin 1
  218.                           inputs 9,10,11,12;   output pin 13
  219.                           power: pin 14 (+); pin 7 (ground).
  220.      Two inputs of gate "a" are connected to the outputs of the 4068 (pin
  221. 13). The third input is connected to ROM3 SELECT and the fourth input goes
  222. to output 3 of the decoder. The output of gate "a" is connected to the SET
  223. input of the WRITE ENABLE LATCH.
  224.      Gate "b". Inputs: the two outputs of the 4068s, output 2 of the 
  225. decoder and LDS. The output of this gate is the line $XXFFFC of the block
  226. diagram, it goes to a chain of four inverters (4049) to produce a delay,
  227. and it goes to an AND gate.
  228.      Gate "c". Inputs: the two outputs of the 4068s, output 1 of the 
  229. decoder and ROM3 SELECT. The output of gate "c" is inverted by a 4049
  230. and then connected to the enable line of the input buffers (74LS244).
  231.      
  232.      Delay chain: The hex inverter 4049 (inputs pins 3,5,7,9,11,14; outputs
  233. pins 2,4,6,10,12,15 respectively) is used. Four inverters are chained to
  234. give the desired delay and one inverter is used for the enable of the input 
  235. buffer. Power is on pin 1 (+) and pin 8 (ground). Note that + is NOT on
  236. pin 16!
  237.  
  238.      Write enable latch: A 4043 (SR-latch) is used. SET is on pin 4, RESET
  239. on 3 and Q on 2. Pin 5 (output enable) is tied low. Power is on pins 16 (+)
  240. and 8 (ground). SET is connected to the output of gate "a". RESET goes to
  241. the output of the delay chain.
  242.  
  243.      AND gate (4081). Inputs: Q from the latch (connected to pin 1) and
  244. the output of gate "b" (connected to pin 2). The output of this gate (pin 3)
  245. enables the output latches. Power is on pins 14 (+) and 7 (ground).
  246.      
  247.      Output latches. Two 40373 (octal latches) are used. Inputs (pins 3,4,
  248. 7,8,13,14,17,18) are connected to the DATA BUS. Outputs (pins 2,5,6,9,12,
  249. 15,16,19 respectively) are the outputs of the circuit. Pin 1 (output enable)
  250. is tied low. Pin 11 (enable latches) goes to the output of the AND gate.
  251. Power to pins 20 (+) and 10 (ground).
  252.  
  253.      Input buffers. The 74LS244 (inputs 2,4,6,8,11,13,15,17 outputs 18,16,
  254. 14,12,9,7,5,3 respectively). The inputs of these buffers are the inputs of
  255. the circuit. The outputs are connected to the DATA BUS (D0..D7). Pins 1 and
  256. 19 (output enable) are connected to the inverted output of gate "c". Power
  257. to pins 20 (+) and 10 (ground).
  258.  
  259.      I used the +5V from the cartridge slot to drive the circuit and 16 leds
  260. that monitor the outputs. (The leds are not connected directly to the 40373,
  261. but via buffers 4049).