home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / text_files / new1meg / memother.arc / automg.txt next >
Text File  |  1989-07-06  |  15KB  |  243 lines

  1.  
  2.  
  3.  
  4.     How to Make Your PiggyBack RAM Expansion Auto-Configuring
  5.  
  6.             (c) 1986 by Dave Haynie
  7.                 CIS:    76703,2047
  8.                 Usenet: {allegra,caip,ihnp4}!cbmvax!daveh
  9.  
  10.  
  11.     This article assumes that you have already made an addition of 512K
  12. of RAM piggybacked on the existing video RAM of your Amiga.  An article and
  13. drawings detailing this modification have been available in various places,
  14. as written by Chris Erving.  I've looked over Mr. Erving's instructions, and
  15. they are quite clear and appear to present no problems.  Although such an
  16. addition does double the DC and capacitive loads on most of the video bus,
  17. this is no big deal, since everything on the video bus is driven by at the
  18. very least a standard "F" type gate, and in most cases an "F" type line
  19. driver.  This also does not interfere with Expansion bus loading at all, 
  20. since the Expansion bus is electronically isolated from the video bus.  Of
  21. course, the extra 1/2 Amp or so drawn by this extra 512K will affect the
  22. Amiga's power budget, and this must be taken into account when any
  23. Amiga-powered peripherals are added externally.  There are, however, a few
  24. problems associated with Chris Erving's modification, specifically in the
  25. physical location chosen to place this expansion memory.
  26.  
  27. WHY NOT JUST SETTLE FOR THE MODS I'VE GOT?
  28.  
  29.     The Erving modification locates the extra memory at $080000, the
  30. start of the second block of RAM address space reserved for chip memory.
  31. The rationale behind this is clear.  The Amiga has several PAL chips
  32. programmed for various tasks.  The main address-decoding PAL only looks at
  33. the three most significant bits of the 68000 address.  This is due to the pin
  34. limitations of the PAL used.  Anyway, this results in a grain limitation of
  35. 2 megabyte boundaries thoughout the entire system.  The memory space at
  36. $080000 is fully decoded for RAM operation, so with the addition of only the
  37. A19 address line into an already existing multiplexer and set of decoders,
  38. Chris Erving's modification gives you a functional extra 512K. 
  39.  
  40.     The problem starts when the V1.2 system starts up.  V1.2 of the 
  41. Amiga OS has been designed to look for any memory located in the first
  42. 2 megabytes of 68000 address space.  Any memory found here is assumed to
  43. be Chip memory.  Even though the current Amiga chipset can only address
  44. 512K of chip memory, the OS considers the possibility that a future
  45. version of this chip set might be capable of addressing more.  So the
  46. 512K of memory that you get in Chris Erving's setup is in fact detected as
  47. Chip memory, even though its not.  The memory is dangerous when considered
  48. Chip memory, since a program may attempt to place a screen, image, or floppy
  49. disk buffer in it, assuming that the chips have access to it.  When in fact
  50. they don't.  So in order to use the Amiga with this memory added as such, its
  51. necessary to run a program that will de-link the memory from the OS's list
  52. of Chip memory locations, then link it into the OS's list of Fast memory
  53. locations.
  54.  
  55.     Technically, this memory isn't Fast.  Its on the same physical
  56. memory bus as the normal 512K of Chip memory is.  It shares refresh
  57. with the normal Chip memory.  And if the custom chips demand more than
  58. their half of the bus, as they do in very high resolution modes and in
  59. some blitter modes, this new memory will generate wait states just as
  60. would the built-in 512K.  The reason it must be called Fast memory is
  61. that the Amiga OS only knows of two kinds of memory, Chip and Fast.  You
  62. can easily crash the machine by calling non-Chip memory Chip memory.  So
  63. any memory on the Amiga appears to the OS as Fast memory, even if its
  64. no faster than the Chip memory.
  65.  
  66. THE CASE FOR AUTO-CONFIGURATION
  67.  
  68.     Anyway, back to the subject of the expansion RAM.  Most things that
  69. you add-on to the Amiga support what's called "auto-configuration".  What
  70. this means is that the Amiga can figure out what these devices do and assign
  71. them areas of memory to run in, all without user intervention.  There's no
  72. need to run the AddMem program with auto-configuration memory, since the
  73. Amiga detects it while its starting up and links it into the Fast memory
  74. list automatically.  If its not auto-configuring, you've got to do it
  75. manually.  The consequences of this are a little worse than just having to
  76. put the AddMem command in every Startup-Sequence.  First of all, some
  77. programs don't let you write on them, they're got some weird copy protection
  78. schemes.  But more important, during startup, lots of memory areas are
  79. reserved by the Amiga OS.  If you have Fast memory available, these overhead
  80. things are placed in Fast memory, otherwise they end up in Chip memory.  Any
  81. Fast memory add later via AddMem is too late, the system is already set up
  82. in Chip memory, which is always a more limited resource than Fast memory.
  83. What my modifications do for you is make the 512K that you've added via the
  84. Chris Erving piggy-back plan properly auto-configure under 1.2.  This isn't as
  85. bad as it sounds, and only takes 2 common "F" series chips and some wiring on
  86. your WCS daughterboard.  Which I'll get to soon.
  87.  
  88.     Now, you've probably heard something about 1.2 auto-configuration
  89. circuitry.  Doesn't it require PALs and ROMs and things?  Well, normally.
  90. But there's a hook built into 1.2 for cheap expansion memory that's perfectly 
  91. legal.  Previously I've mentioned the main address decoding PAL in the
  92. Amiga, the one that's limited to a 2 megabyte decoding granularity.  Well,
  93. it turns out that a stock Amiga has 2 megabytes, from $C00000 to $DFFFFF,
  94. just for the 68000 memory image of the custom chip registers.  This is 
  95. obviously a lot of wasted address space for a few hundred chip registers,
  96. especially considering that the OS only talks to these registers at the
  97. end of this address space.  Under 1.2, RAM may be located starting at $C00000 
  98. and continuing up at least to $CFFFFF (1 megabyte).  The OS looks for it
  99. here during system startup and will link anything found here into the
  100. Fast RAM list, just as if it were normal autoconfig memory.
  101.  
  102.     What my circuit does for you is to fool the address decoding PAL into 
  103. thinking that the 68000 generated address range from $C00000-$C7FFFF is 
  104. actually in the range from $000000-$07FFFF, while selecting the bank of RAM 
  105. you've added with the A23 address line.  Thus, whenever the first 512K 
  106. starting at $C00000 is addressed by the 68000, the decoding PALs think that 
  107. its internal RAM, and decode RAM just as if it were built-in RAM, which is
  108. what we want so that everything is handled just as it is with the first
  109. 512K of RAM.  Otherwise, the decoding PALs go on with business as usual.
  110.  
  111.     The "fooling" is done by feeding the DPALEN PAL on the daughterboard
  112. a different A23 and A22 whenever we're in the proper range.  My circuit
  113. (if you haven't printed it yet, now's a good time) takes the 68000 generated
  114. A23 and A22 and selectively gates them to the DPALEN PAL.  At almost all
  115. times, two AND gates pass A23 and A22 unmodified.  The rest of the circuit
  116. detects the condition !(A23 * A22 * !A21 * !A20 * !A19), passing this signal
  117. to the other half of each of these AND gates.  Thus, this detected address
  118. range, $C00000-$C7FFFF, forces the output of both gates to 0, thus tricking
  119. the DPALEN PAL into the mapping rules that apply in the lower part of
  120. memory where RAM normally resides.
  121.  
  122. BUILD THE THING, ALREADY!
  123.  
  124.     Before you start, you'll need a bit more thin wire and two "F"
  125. series parts, a 74F08 and a 74F10.  The 74F08 is a 14 pin, quad 2-input
  126. AND gate, and the 74F10 is a triple, 3-input NAND gate.  The nice thing
  127. about these F series parts is that each gate has a typical delay of about
  128. 2-3 nanoseconds, which really helps to eliminate timing problems.  You'll
  129. of course need tools: screwdriver, needle-nose pliers, an X-Acto knife, and
  130. a good soldering iron are very useful, and a buzz-o-meter or other form
  131. of continuity tester is also a good thing to have with you.
  132.  
  133.     To start this modification, take your Amiga apart as before, being
  134. sure to remember where everything goes.  Next, you'll be removing the 
  135. daughterboard, as before.  Providing you've made the Chris Erving piggyback 
  136. mods, you'll have a single wire from your added circuit up to the 
  137. daughterboard, connected to A19.  This is the only thing you're going to
  138. change about the original circuit, and the only thing that you change on the
  139. main PCB.  You can cut this off of the daughterboard as you're removing it,
  140. leaving the other end of it connected to its place on the main board.  This
  141. free end should now be connected to 68000 address line A23.  The A23 line 
  142. can be found as Pin 1 of what's called U5L or "EN" on the PCB, located up
  143. by the left end of the disk drive.  This is actually one of the tall headers 
  144. for the daughterboard, though on a ROM based Amiga this socket would contain 
  145. the main board version of the address decoding PAL.  Anyway, once this wire 
  146. is soldered in place (shortening the wire if at all possible), you've made 
  147. your last main board connection.
  148.  
  149.     Now you'll be dealing exclusively with the daughter board.  The
  150. daughter board I speak of is a 4-layer PCB labeled REV 3 on the back, up
  151. at the end with all of the PALs.  This end is where most of the changes
  152. take place.  The first thing you've got to do is make some cuts to the 
  153. daughterboard.  This isn't quite as bad as it sounds, but it does take some 
  154. care.  Orient the PCB so that the PALs are all closest to you (if you can't
  155. find the PALs, there are 4 of them, all 20 pin DIPs, and each is labelled 
  156. "PAL 16L8A" or something similar).  The DPALEN PAL will be on your far right 
  157. at "6N", right next to the "P" tower socket.  The first two pins of the DPALEN 
  158. PAL must be isolated from the corresponding pins of the "P" socket; the 
  159. easiest way to do this is to cut each pin at its base, being careful to leave 
  160. enough metal on each pin to later solder to.  Once free, bend these up to be 
  161. parallel with the plane of the PCB.  Next, find the 74F02 chip, called U5M on 
  162. the PCB.  This chip is up one and slightly to the left of the DPALEN PAL.  Cut 
  163. pins 10, 11, 12, and 13 away and up from the PCB as before.  The NOR gate 
  164. made up of 11, 12, and 13 is used as an inverter on the PCB.  I use it in the
  165. address detection circuit, and use a gate of my own to replace its inversion
  166. function in the daughterboard circuit.
  167.  
  168.     Next thing to do is add the two "F" chips.  The best way I've found
  169. of doing this is to take each chip in turn and bend up every pin except for
  170. pins 7 and 14.  Then I place the 74F08 directly piggybacked on the 74F02 at 
  171. U5M, in the same orientation, and solder the untouched pins 7 and 14 to those
  172. of the 74F02, picking up ground and power, respectively.  Next to the 'F02 is
  173. an 'LS393 at U5L;  I place the 74F10 on top of it very similarly.  Now comes
  174. the connection work.  First of all, two of the three gates in the 74F10 
  175. package will be used as inverters, so four pins can immediately be tied up to 
  176. the power supply.  Connect pins 1, 2, 3, and 4 of the 'F10 to pin 14 of the
  177. 'F10.  One of the gates in the 'F08 is unused, I ground these pins.  Connect
  178. pins 4 and 5 of the 'F08 to pin 7 of the 'F08.
  179.  
  180.     Now let's replace the stolen inverter from the daughterboard 
  181. circuit.  Connect pin 13 of the 'F10 to pin 10 of the 'F02 at U5M.  Now
  182. find the chip at U2H, which is kind of in the middle at the far end of
  183. the PCB.  This is an 'F257 chip.  Connect pin 10 of this chip back to the
  184. 'F10, at pin 12.  This now replaces the 'F02 gate which we will use soon.
  185.  
  186.     The original values of A23 and A22 must be brought into the 'F08
  187. chip.  These can be found, intact, on the DAUGEN PAL at L6.  Connect pin 1
  188. of the DAUGEN PAL to pins 1 and 9 of the 'F08, and then pin 2 of the DAUGEN
  189. PAL to pins 2 and 12 of the 'F08.  The A21 signal is available on DAUGEN as 
  190. well; connect pin 3 of DAUGEN to pin 5 of the 'F10.  The final input signals
  191. are A20 and A19; connect pin 18 of the DAUGEN PAL to the freed pin 12 of 
  192. the 'F02 at U5M, and connect pin 16 of the DAUGEN PAL to the freed pin 11 of
  193. the 'F02.
  194.  
  195.     Coming out of this circuit are two signals, both of which go to
  196. the freed pins of the DPALEN PAL.  Connect pin 8 of the 'F08 to the freed 
  197. pin 1 of the DPALEN PAL, and then connect pin 11 of the 'F08 to the freed
  198. pin 2 of the DPALEN PAL.
  199.  
  200.     Now all that's left is interconnects.  Connect freed pin 13 of
  201. the 'F02 to pin 11 of the 'F10.  Now connect pin 6 of the 'F10 to pin
  202. 10 of the 'F10, and then pin 3 of the 'F08 to pin 9 of the 'F10.  That's
  203. the address detector, which is now wired to the AND gates; connect pin 8
  204. of the 'F10 to pins 13 and 10 of the 'F08.  That's all there is.
  205.  
  206.     Make sure that all your wiring is correct; a visual inspection will
  207. suffice, but if you have a buzz-o-meter, checking it that way is generally
  208. more accurate.  The only pin that shouldn't be connected is pin 6 of the
  209. 'F08, which doesn't go anywhere, as that part of the 'F08 isn't being used
  210. anywhere.  Once everything's done here, you should be able to replace the
  211. daughterboard (be careful, its not as easy as it looks), then power up.
  212. If you boot with 1.1, you'll have to AddMem from $C00000 to $C7FFFF.  If you
  213. boot with 1.2, your WorkBench screen should come up indicating over 900000
  214. bytes free.
  215.  
  216.     It would be a very good idea to immediately run some memory tests on
  217. this added memory.  While I don't have a format test, I've done several things
  218. to exercise the memory.  First of all, I start up many demos of various kinds,
  219. and let them run all night or so.  Make sure you start up enough to really
  220. fill a good portion of RAM.  Running the 1.2 performance monitor at the same
  221. time should give you a good idea of where memory is being used.  Next thing
  222. I do is load the RAM: disk full of CLI commands, and then type PATH ADD RAM:
  223. to put the RAM: disk into the search path (1.2 only).  The RAM: disk uses
  224. added memory extensively, so it looks like a good way to test the system.
  225. Also, the CLI commands are a known quantity; you don't want to be testing
  226. uncertain hardware with uncertain software.  And hopefully, someone will
  227. come up with an extensive RAM test; such a test is really what's needed to 
  228. verify such a modification as this.
  229.  
  230.  
  231.             Dave Haynie
  232.     Home:        (609) 423-4021
  233.     Work:        (215) 431-9100 ext. 9816
  234.  
  235. ** This article and the accompanying schematic drawing may be freely posted **
  236. ** on computer BBS systems, in Freely Redistributable software collections, **
  237. ** or given away for free (plus nominal copying charge).  Please ask me     **
  238. ** before you publish it in any sort of publication (I'll probably have no  **
  239. ** problem with it anyway), and please keep this distributed as a whole.    **
  240. ** There are no guarantees expressed or implied in this article, other than **
  241. ** the fact that such modifications will DEFINATELY void you warrenty.      **
  242.