home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / info / memhack.zoo / 1meg.txt next >
Text File  |  1990-02-08  |  20KB  |  425 lines

  1. NOTE: This is the text of an article that appeared in Amazing Computing. It
  2.       refers to some pictures that were in that article. It can be done
  3.       without the pictures. Also reference is made to 'make512' to get 
  4.       around the problem with WB 1.2 & following. See the accompanying
  5.       articles that show better ways around that problem.
  6. ----------------------------------------------------------------------------
  7.  
  8.             A Megabyte without Megabucks
  9.  
  10.                 by Cris Erving 
  11.              Copyright 1986, All Rights Reserved
  12.  
  13.    If you have tried to do any serious development work with
  14. C, or if you have worked with memory-intensive programs like
  15. Aegis Draw, you have undoubtedly become acquainted with the
  16. Amiga's biggest limitation...  its lack of memory.  Although
  17. 512K seems like a lot at first, it is very easy to use it
  18. all up, especially if you do a lot of graphics.  The
  19. conventional solution is to go out and buy an external
  20. memory expansion board.  Although these boards are nice,
  21. they cost about $350 and up, which puts them out of the
  22. reach of many of us impoverished Amiga users.  Fortunately,
  23. there is a solution.  For about $70 and an evening of
  24. hacking, you can internally expand your 512K Amiga to a full
  25. megabyte.  A word of warning first:  this hack is not
  26. supported by Commodore, and voids your warranty.  If you
  27. aren't comfortable playing around inside your computer, you
  28. would probably be better off saving up for an external
  29. board, or finding somebody who can do the upgrade for you...
  30. ask around at your local users' group.  That being said,
  31. let's start hacking!
  32.  
  33.    First, you will need to get some memory chips from your
  34. favorite chip supplier.  IC Express, Microprocessors
  35. Unlimited, and JDR Microdevices are good sources of memory
  36. chips...  look them up in 'Byte' or 'Computer Shopper'.  You
  37. need sixteen 4464-type 256K RAM chips, rated 150 ns or
  38. faster.  These are NOT the same 256K RAM chips that the IBM
  39. PC uses...  those are 41256-type RAM chips, and will NOT
  40. work in the Amiga!  You will also need some wire (28-gauge
  41. wire-wrap wire is nice), eight 18-pin solder-tail sockets
  42. (NOT 16-pin!), and eight 33 ohm, 1/4 watt resistors.  You
  43. will also need a low-power soldering iron with a very fine
  44. tip; I recommend that you use one rated under 20 watts.
  45. Radio Shack sells a decent 15-watt iron with a grounded tip
  46. for about $6...  ask for stock number 64-2051.
  47.  
  48.    OK, disconnect everything from your Amiga, and lay it
  49. upside-down on a table.  Unscrew the phillips-head screws
  50. that hold the top on; they are inside deep recesses, and
  51. there are 5 of them.  Also remove the two smaller screws
  52. near the front of the computer, which hold the bezel on.
  53. (See Photo 1).  After you have done this, put a piece of
  54. tape over the holes to keep the screws from falling out, and
  55. turn the computer rightside-up.  With a flat-blade
  56. screwdriver, carefully pry the lid off the top of the
  57. computer; you will hear a pop as each of the four catches
  58. comes off.  Lift the lid off, and you will see a large metal
  59. shield.  (See Photo 2).  Remove it; you will have to twist a
  60. few metal tabs to get it completely off.  There are about 15
  61. screws holding this shield on, so if it won't come off you
  62. probably missed a screw.  Lift off the bezel; you will have
  63. to pull two small plastic tabs back to remove the two LED's
  64.  
  65.  
  66.  
  67. from the bezel.
  68.  
  69.    You will now see the main board, with a smaller
  70. "daughter" board piggybacked upside-down on top of the main
  71. board.  (See Photo 3).  This is the Kickstart RAM board.
  72. Remove the 3 screws holding the daughter board, and
  73. carefully pry the daughter board out of its sockets by
  74. gently rocking it back and forth.  Use care, as the header
  75. pins that connect the daughter board bend easily if you
  76. apply too much force.
  77.  
  78.    If you look at the front and the left side of the Amiga's
  79. mother board, you will see some letters and numbers
  80. silkscreened on the board.  Chips on the Amiga's PC board
  81. are located at the intersection of a row number and a column
  82. letter.  For example, a chip located at 1C is in the first
  83. row, column C.  Near the expansion RAM port you will see
  84. three IC's - two 74F138's and a 74F399.  From left to right,
  85. these IC's are located at position 1H, 1I, and 1J.  Also,
  86. you will see the eight RAM chips on the Amiga's mother
  87. board, located at 1B-1E and 2B-2E.  These RAM chips will be
  88. marked "4464", "41464" or "50464".  (See Photo 4).
  89.  
  90.    Take the eight 18-pin sockets, and clip pin 16 off of
  91. each one, as close to the socket as possible.  Now, solder a
  92. socket on top of each of the RAM chips on the Amiga's PC
  93. board, making sure that the socket matches the RAM chips'
  94. orientation.  Don't use any more solder than it takes to get
  95. a good connection, and let the RAM chips cool down a few
  96. seconds between each solder joint.  A solder bridge here is
  97. extremely difficult to remove, so be careful and take your
  98. time.  If you did this correctly, you will have soldered all
  99. 18 pins except for pin 16, which you clipped off of each
  100. socket.  (See Photo 5)
  101.  
  102.    With a pair of fine cutting pliers, CAREFULLY clip pin 3
  103. of the two 74F138's (at 1H and 1I) as close to the PC board
  104. as possible, and bend the pins up away from the PC board.
  105. IC pins are numbered counterclockwise from the notch (or
  106. dot) at one end of the chip, so pin 3 will the the third pin
  107. from the front on the right side.  Do the same with pins 11
  108. and 12 of the 74F399 at 1J.  Connect a wire between pin 3 of
  109. both 74F138's and pin 10 of the 74F399.  Connect another
  110. wire between pin 12 of the 74F399 and pin 8 of the 74F399
  111. (which should still be soldered to the PC board).  Cut a
  112. wire about 8" long, and solder it to pin 11 of the 74F399;
  113. leave the other end loose for now.  Label the loose end of
  114. this wire "A19" with a small piece of tape; this will make
  115. life easier later on.  (See Photo 6).  Check your work
  116. before you go any further.
  117.  
  118.    Take the sixteen 4464-type RAM chips you bought, and
  119. CAREFULLY cut the narrow part of pin 16 off of each chip.
  120. Do NOT cut the pin off entirely...  only cut off the narrow
  121. part!  Now comes the tricky part.  Solder one of these chips
  122.  
  123.  
  124.  
  125. on top of another one, being very careful that you have them
  126. pointed the same direction; you can tell by the notch on one
  127. side.  You will be soldering all pins EXCEPT for pin 16,
  128. which you clipped short.  These chips are static and heat
  129. sensitive, so it's a good idea to use a grounded soldering
  130. iron and as little heat and solder as is necessary to get a
  131. good electrical connection.  Be extremely careful not to
  132. accidentally create any solder bridges between the RAM chip
  133. pins.  It wouldn't hurt to solder them together over a piece
  134. of aluminum foil to reduce static, either.  Repeat the
  135. process for the other chips.  What you will end up with is
  136. eight "piggybacked" RAM chip pairs, that is, eight sets of
  137. two RAM chips stacked on top of one another.
  138.  
  139.    Make eight wire jumpers about 1 1/2" long.  Take two of
  140. the piggybacked RAM chip "stacks", and solder a jumper from
  141. pin 16 of the top RAM chip on one of the stacks to pin 16 of
  142. the top RAM chip on the other stack.  Solder a 6" wire to
  143. pin 16 on one of the chips; the other end should be left
  144. free.  Do the same for the bottom RAM chips.  You should now
  145. have two stacks with two short wires connecting them, and
  146. two longer wires attached to them.  Repeat this process for
  147. the other RAM chip stacks.  When you are done, you should
  148. have four sets of two chip stacks, with each set connected
  149. by two jumpers and each set having two longer free wires.
  150.  
  151.    Insert a set of RAM chip stacks into the RAM sockets on
  152. the mother board at 1B and 1C, making sure that the
  153. orientation is correct.  The notches on the RAM chips should
  154. be facing towards the front of the computer.  Do the same
  155. for the other three RAM chip stacks, placing them in the
  156. sockets at 1D and 1E, 2B and 2C, and 2D and 2E.  Now, label
  157. the eight free wires coming from the RAM chip stacks as
  158. follows:  (See Photo 7)
  159.  
  160. From the Bottom RAM at 2E/2D  : LC4
  161. From the Top RAM at 2E/2D     : LC6
  162. From the Bottom RAM at 1E/1D  : LC5
  163. From the Top RAM at 1E/1D     : LC7
  164. From the Bottom RAM at 2C/2B  : UC4
  165. From the Top RAM at 2C/2B     : UC6
  166. From the Bottom RAM at 1C/1B  : UC5
  167. From the Top RAM at 1C/1B     : UC7
  168.  
  169.    Take the eight 33 ohm resistors, and trim the leads of
  170. each one to about 1/4".  Solder one resistor to pin 7 of the
  171. 74F138 at 1H.  Do the same at pins 9, 10, and 11.  Repeat
  172. the process with the other four resistors and the 74F138 at
  173. 1I.
  174.  
  175.    Solder the eight wires coming from the RAM chip stacks to
  176. the free end of the eight resistors as follows:  (See Photo
  177. 8)
  178.  
  179. UC7 to the resistor at 1H, pin 7
  180.  
  181.  
  182.  
  183. UC6 to the resistor at 1H, pin 9
  184. UC5 to the resistor at 1H, pin 10
  185. UC4 to the resistor at 1H, pin 11
  186. LC7 to the resistor at 1I, pin 7
  187. LC6 to the resistor at 1I, pin 9
  188. LC5 to the resistor at 1I, pin 10
  189. LC4 to the resistor at 1I, pin 11
  190.  
  191.    Solder the wire marked "A19" to pin 3 of the IC on the
  192. daughter board marked "DPALCAS".  It's located at the rear
  193. end of the daughter board at location 6K, and the IC has the
  194. marking "PAL16L8" on it.  (Photo 8) Put the daughter board
  195. back, making sure that all of the header pins fit into the
  196. header sockets on the daughter board.  Finally, replace the
  197. 256K expansion ram cartridge in its slot.
  198.  
  199.    You are now ready for the moment of truth.  With the
  200. cover off (in case you need to debug this mess!), hook the
  201. keyboard, monitor, and power to your Amiga.  Turn it on.  If
  202. the computer won't boot (i.e.  you don't see the Kickstart
  203. or Workbench screens), you have wired something incorrectly
  204. or you have a solder bridge somewhere...  turn the Amiga off
  205. and retrace your work.  Pay particular attention to the
  206. order of the wires; this is quite critical.  If you got to
  207. Workbench, you will need to use the AddMem utility to tell
  208. your Amiga to make the extra memory available.  This utility
  209. came with the developer's package, and is also on Amicus
  210. Disk  4 (along with the C source!).  To add all 512K to free
  211. memory, type 'AddMem 80000 FFFFF'.  You should now have a
  212. total of 1 megabyte to play with; if something seems wrong,
  213. turn the computer off and check your wiring.  There is
  214. another utility called Avail on the utility disks, which
  215. will tell you how much memory you have.  To use it, simply
  216. type 'Avail'; it will tell you how much Chip and Fast RAM
  217. you have.  (The 'Maximum' column should read 1048568).  You
  218. can also use the Gfxmem utility to show you how much memory
  219. you have; this program appears on several of the Amicus and
  220. Fish disks.  A hint:  if AddMem seems to work, but you get
  221. an AmigaDOS error when you do a DIR, you might have reversed
  222. the UC and LC wires...  go back and check your work.  When
  223. you are satisfied of the memory's operation, replace the RF
  224. shield, the bezel, and the covers, and you are in business.
  225.  
  226.    OK, time for the technical discussion.  The reason this
  227. works is that Amiga most generously did not fully decode the
  228. lower 2 megabyte RAM space that the internal 256K and 256K
  229. expansion RAM fit into.  They DID decode 1 megabyte, but
  230. they only used half of the available memory select lines.
  231. This makes it fairly easy to add the other 512K, because we
  232. don't even need to add any decoding IC's, just some jumpers.
  233. Basically, we take the memory Column Address Strobe (CAS)
  234. signals that are unused, and connect them to our piggybacked
  235. memory.  The only problem with doing this is that we have to
  236. restrict the 3 custom chips to the lower 512K.  Fortunately
  237. again, there is already a multiplexer on board which selects
  238.  
  239.  
  240.  
  241. between Chip and 68000 addresses (the 74F399, which is a
  242. latched quad 2/1 multiplexer), and it has some unused
  243. sections.  So, we connect input I0C at pin 11 of this IC to
  244. A19, which is the source for the extra address line from the
  245. CPU, then we connect input I1C at pin 12 to ground, which
  246. assures us that the custom chips will always "see" the lower
  247. 512K.  The output of the multiplexer, QC at pin 10, drives
  248. the upper address bit of the two 74F138 3/8 demultiplexers,
  249. which are gated with UDS and LDS to produce the extra upper
  250. and lower CAS signals that the new RAM chips need.  The 33
  251. ohm resistors help reduce ringing on the CAS lines; this is
  252. especially important with long lengths of fine wire, such as
  253. we are using.  Each pair of 74F138 outputs represents 128K
  254. of memory; since there are four selection pairs available,
  255. we can select up to 512K.  See the schematic below for all
  256. the gory details.
  257.  
  258.    What you end up with is your normal 512K of Chip RAM,
  259. mapped from $000000 to $07FFFF, and another 512K mapped from
  260. $080000 to $0FFFFF.  This 1 megabyte "shadows" over the next
  261. 1 megabyte, (from $100000 to $1FFFFF) because the next
  262. highest address bit (A20) is not used for decoding.  This 1
  263. megabyte was "reserved" by Commodore for internal memory
  264. expansion, and you could theoretically add another megabyte
  265. of RAM chips (along with a few more decoder and glue chips
  266. to decode this address space), giving you 2 megabytes of
  267. RAM.  I say theoretically, because you will run out of power
  268. long before you have reached 2 megabytes.  One megabyte,
  269. however, does not tax the Amiga's power supply, and leaves
  270. you with enough left over for a few goodies like A-Time and
  271. Digi-View.
  272.  
  273.    A few other topics before I sign off.  First, you may be
  274. wondering whether this is "Fast" memory or "Chip" memory.
  275. The answer is that it is neither.  Fast memory resides
  276. directly on the processor buss, with no possibility of
  277. contention by the custom chips.  Chip memory is memory which
  278. the custom chips can access.  What we have here is Chip
  279. memory which the custom chips cannot access.  (Of course,
  280. AmigaDOS thinks it's Fast RAM...).  A better term for this
  281. memory might be "Synchronous" memory, since it is
  282. synchronized to the custom chips because it is on their
  283. memory buss, but it is not available to them.  This means
  284. that it will slow down when heavy DMA activity is going on;
  285. in practice, however, this seldom happens.  Also, because
  286. this memory is not on the 68000's expansion buss, it cannot
  287. auto-configure; this is why you need to use AddMem.  Of
  288. course, this also means that it doesn't use up any of your
  289. auto-config address space, too.
  290.  
  291.    You may also be concerned about compatability with future
  292. Amiga hardware, namely Sidecar and Zorro expansion boxes.
  293. Since the lower 2 megabytes of address space "shadows" if it
  294. is not fully decoded internally, it is not possible to use
  295. this address space from the expansion port, because both the
  296.  
  297.  
  298.  
  299. expansion buss and the internal memory would try to be on
  300. the processor's buss at the same time.  Because of this,
  301. there is no way an external expansion box could conflict
  302. with your synchronous RAM.  Since this RAM does not map into
  303. the auto-config space, you don't have to worry about
  304. conflicts with any Zorro boxes you may add later, since
  305. Zorro boxes only map into auto-config space.
  306.  
  307.    Finally, there is one last question...  if it's so easy
  308. to add the memory, why didn't Amiga do it themselves?  I
  309. don't know why; maybe they thought 512K was plenty of
  310. memory.  Considering the software they had at introduction
  311. (i.e.  Textcraft), that may have been understandable.  It
  312. would have been so easy for Amiga to allow us to expand to 1
  313. or even 2 megabytes by simply plugging in a RAM cartridge
  314. that any excuse on their part is unforgivable.  Not only are
  315. the CAS lines already on the board, but the are a whole
  316. bunch of lines on the expansion RAM cartridge which are
  317. arbitrarily tied to +5 volts or ground, so there's already
  318. plenty of room on the connector for the extra RAM select
  319. lines.  The extra power required for 2 megabytes would only
  320. have been a few amps, so it wouldn't have cost them very
  321. much to upgrade the power supply.
  322.  
  323.    One final note is in order.  If you try to use this
  324. memory with Workbench 1.2, you will find that Workbench 1.2
  325. tries to auto-configure the extra memory as Chip RAM.  This
  326. is probably due to the fact that the new "Fat Agnus"
  327. graphics chip will be able to address 2 megabytes, rather
  328. than the 512K that the current Agnus chip supports.  If
  329. there was no fix, this would cause serious problems, because
  330. graphics and other chip data could be loaded into a location
  331. which the chips could not access, resulting in an almost
  332. certain visit from the Guru.  Fortunately, there is an easy
  333. way around this.  The program listed below, which is a
  334. Lattice C program called make512k, will automatically turn
  335. your computer back into a 512K machine.  Then you can use
  336. AddMem to make the extra memory available, just as you would
  337. with Workbench 1.1.  Make sure that make512k and AddMem are
  338. called at the very beginning of your s/startup-sequence
  339. file, and you will have no problems.  I have been running
  340. with late beta versions of 1.2 for over 2 months without any
  341. problems.  ( see accompanying articles for better ways to fix
  342. this problem).
  343.  
  344.    All in all, it's a nice little hack, and I hope a lot of
  345. you take advantage of this cheap way to double your memory.
  346. It's amazing how many uses for more memory you can find once
  347. you have it.  You can copy your C:  directory to RAM:, do an
  348. ASSIGN C:  RAM:, and your CLI commands will execute almost
  349. instantaneously.  You can use RAM:  for all your workfiles,
  350. then copy them to the disk when your're all through...  a
  351. large Aegis Draw drawing takes much less time to save this
  352. way.  Lattice C compiles speed up enormously when you copy
  353. the include and library files to RAM:.  You can finally take
  354. full advantage of the Amiga's multi-tasking without worrying
  355.  
  356.  
  357.  
  358. about the Guru...  I like to play Reversi while I'm waiting
  359. for Aegis Draw to redraw the screen.  It sure makes using
  360. the Amiga a lot more fun.  After all, that's what we bought
  361. an Amiga for!
  362.  
  363. About the Author
  364. Cris Erving is the Systems Manager of a Digital Equipment
  365. VAX 8600 installation at a large California heavy equipment
  366. dealership.  He is very active in the AmigaTech Users Group,
  367. which is based in the Los Angeles area.  His interests are C
  368. programming, CAD/CAE, hardware hacking, and "taking the
  369. Amiga apart".
  370.  
  371.  
  372.  
  373. Photo Captions
  374. ==============
  375.  
  376. Photo 1:
  377. The underside of the Amiga.  The arrows point to the 5
  378. screws holding the case together, and the 2 screws holding
  379. the bezel on.
  380.  
  381. Photo 2:
  382. The Amiga with the top cover removed.  The RF shield is the
  383. large shiny object in the middle.  This particular shot is
  384. with the screws already removed.
  385.  
  386. Photo 3:
  387. The Amiga with the RF shield removed.  The Kickstart
  388. daughter board is the S-shaped board sitting on top of the
  389. main board.  The 3 arrows point to the screws holding the
  390. daughter board on.
  391.  
  392. Photo 4:
  393. The Amiga's RAM chips and the two 74F138's and the 74F399
  394. that we are concerned with.  If you look hard you can see
  395. the notch and the dots on the chips that point to pin 1.
  396.  
  397. Photo 5:
  398. The RAM chips with the sockets soldered to them.  I can't
  399. stress enough that you have to be careful when soldering in
  400. these close quarters, in order to prevent solder bridges.
  401. The arrows point to the pins on the two 74F138's and the
  402. 74F399 which are clipped...  the extra arrow at pin 7 of the
  403. 74F399 should be ignored.
  404.  
  405. Photo 6:
  406. Closeup of the 3 logic chips and the added jumpers.  Note
  407. that pin 3 of both 74F138's have been cut, as well as pins
  408. 10 and 11 on the 74F399.  The wire marked "A19" is about 8"
  409. long.
  410.  
  411. Photo 7:
  412. The piggybacked RAM chips with their pin 16 wires.  Although
  413. you don't have to mark them, it makes life much easier.
  414.  
  415. Photo 8:
  416. The completed upgrade.  Although it looks like a plate of
  417. spaghetti, it's really not THAT bad.  You could route the
  418. wires nicely around the IC's, if you are so inclined.
  419. Notice the resistors soldered to pins 7,9,10, and 11 of the
  420. 74F138's, and the "A19" wire soldered to the PAL16L8 at 6K
  421. of the daughter board.
  422.  
  423. Photo 9:
  424. The moment of truth.  Does it work?....  you bet!
  425.