home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / atari / 8bit / 4612 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  3.4 KB

  1. Path: sparky!uunet!portal!cup.portal.com!Rick_Michael_Cortese
  2. From: Rick_Michael_Cortese@cup.portal.com
  3. Newsgroups: comp.sys.atari.8bit
  4. Subject: Adding a 2nd PIA
  5. Message-ID: <65693@cup.portal.com>
  6. Date: Fri, 11 Sep 92 15:30:01 PDT
  7. Organization: The Portal System (TM)
  8. References: <1992Sep10.012032.11157@mnemosyne.cs.du.edu>
  9.   <65609@cup.portal.com>
  10. Lines: 59
  11.  
  12. Well, I finished what had to be the quickest/easiest hardware
  13. project I've ever done. This isn't the best way to implement
  14. additional functions to an 8-bit, but I mainly did it to make sure
  15. the (M)emory (M)anagement (U)nit sends out the proper signals for
  16. the mod I have in mind.  Since it adds and additional 6520 with
  17. it's 16 I/O lines & interrupt capability it may be enough for
  18. someone who just wants to do [robotics, home control, memory
  19. expansion, ...].  A bit of background on the Atari Memory Map.
  20. The way Atari implemented the hardware was to decode the address &
  21. use that to select the chips to be loaded or read on the data bus.
  22. It's the MMU that takes care of things like switching basic on or
  23. off, reading the joystick ports etc.  For any memory access in the
  24. $D000 to $D7FF area, the MMU puts an enable pulse to a 74LS138.
  25. The 74LS138 is an decoder that selects one of 8 possible outputs
  26. depending on what is on it's address pins. In the Atari case, they
  27. tied address lines A8, A9, & A10 to the address pins so when the
  28. smallest unit of measure is 256 bytes with respect to the address
  29. bus. Eight possibilities from 3 address lines =>2K of hardware.
  30. This is the hole you always hear about when people ask why we
  31. can't access the entire 16K of ram under the OS. Why didn't they
  32. just use address lines A5, A6, & A7?  I don't know, but it
  33. would've saved 1.8K of space.  As it turns out, they probably did
  34. us a favor since it makes adding additional chips trivial.  Like I
  35. said, the 74LS138 is a one of 8 decoder, but have you ever counted
  36. the LSI chips in your computer? Antic & the CPU take care of
  37. themselves, so the only lines that are used on the 74LS138 are O/0
  38. for GTIA @ $D000, O/1 @ $D100 for the enhanced cartridge interface
  39. on the XE, O/2 @ $D200 for Pokey, O/3 @ $D300 for the PIA, & O/5
  40. for the cartridge control line. Antic decodes it's own stuff @
  41. $D400 thank you!  Outputs on pins [4, 6, 7] aren't used anywhere
  42. on anything.  Since this is a minimal project, I just used the O/7
  43. (pin #7 of the 74LS138) for the project.  This mod was done on an
  44. 800XL, but should work for a 1200XL or XE.  Buy any one of the
  45. following; 6520, 6521, 6821. I left the input pins CA1 & CB1 tied
  46. to the existing 6520, this should prevent spurious interrupts. As
  47. far as I know, PIA interrupts are not used by anything, but if
  48. someone every uses them, the software may have some trouble
  49. clearing the 2nd 6520's status.  Bend out the following pins: [2-
  50. 17, 19, 23, 39].  Piggy back/solder the remaining pins to the
  51. existing 6520. Run a wire from pin #7 of the 74LS138 to pin #23 of
  52. the new 6520.  That's it! Pins 2-17 are the PORTA & PORTB I/O pins
  53. respectively. What I did to check out the circuit is wired a
  54. single 220 Ohm resistor to the +5V supply on pin #20 of the 6520,
  55. then ran LEDs from it to each of the bent-out pins of PORTA.  To
  56. run it through it's paces just:
  57.  
  58.  10 PORTA=55040:PACTL=55042
  59.  20 POKE PACTL,0
  60.  30 POKE PORTA,255
  61.  40 POKE PACTL,4
  62.  50 FOR N=0 TO 255
  63.  60 FOR DELAY =1 TO 300:NEXT DELAY
  64.  70 POKE PORTA,N
  65.  80 NEXT N
  66.  90 GOTO 50
  67. )
  68. 4              REQUEST TO SEND (RTS)
  69. 20             DATA TERMINAL READY (DTR)
  70. 23         
  71.