home *** CD-ROM | disk | FTP | other *** search
/ ftp.elysium.pl / ftp.elysium.pl.tar / ftp.elysium.pl / docs / hardware / 1750_to_2MB < prev    next >
Internet Message Format  |  2010-08-07  |  21KB

  1. From: Artie.Stevens@p2.f158.n633.z3.fidonet.org (Artie Stevens)
  2. Newsgroups: comp.sys.cbm
  3. Subject: 1750 Expansion
  4. Date: Sun, 23 May 1993 07:50:00
  5.  
  6. Thanks goes out to STAN LOGAN for sending the text-converted file of the
  7. geowrite-file in which the original article was written.
  8. The material contained in this document is of an experimental nature. As such,
  9. all consequences resulting from the use of the information is the express
  10. responsibility of the user. The author shall not be held liable, and implies
  11. no warranties or guarantees what so ever. The author does certify that the
  12. information presented was correct, to his knowledge, at the time of the first
  13. distribution of the document. This document and the information it contains is
  14. the sole property of the author, who retains all copyrights, and patents to
  15. the material presented.  The author does grant a limited distribution right to
  16. all if the following conditions are satisfied: The document is distributed in
  17. complete and unaltered form, with this legal form included. No commercial
  18. distribution (i.e.. publishing) of the document is entered into without the
  19. written consent of the author. Lastly, no monies shall be exchanged for the
  20. distribution of the document, except for reproduction and shipping charges,
  21. without the written permission of the author. With these conditions fulfilled,
  22. the limited distribution license grants the holder of the document to
  23. otherwise freely distribute, and store it in any manner.
  24. Beyond 512 kb: The Two Megabyte REU
  25. By Andrew E. Mileski
  26. Copyright October 3, 1989.
  27. In Volume 9, Issue 6 of the Transactor, Paul Bosacki showed us a miracle; the
  28. one megabyte C64. Paul had developed an elegant method of allowing the C64 to
  29. access this extra memory out of the C64's own memory map. Unfortunately, this
  30. extra RAM is rather difficult to access, not all of it is available to the
  31. user, and C128 owners cannot expand their machines in the same manner. The
  32. circuit necessary for this feat allows a C64 to use 256 k RAM chips, instead
  33. of the 64 k RAM chips it was designed to use. Although a brilliantly simple
  34. circuit, it is over-kill when one already has a Ram Expansion Unit (REU) that
  35. directly supports 256 k RAM chips! Expanding a REU is relatively simple, and
  36. if you already know how to program a REU you can easily take advantage of an
  37. expanded one. In fact, all your software that uses a REU is completely
  38. compatible! Now are fellow C128 owners can expand their machines easily too,
  39. since the extra RAM is accessed out of a REU, and not off a modified
  40. mother-board! In a 512 kb REU, there are two dynamic RAM chip banks on the
  41. circuit board. They each consist of eight, 1 bit by 256 k dynamic RAM chips,
  42. which gives us our 512 k bytes. The REU's internal bank register at $DF06
  43. works in 64 kb increments, and has only eight of these REU banks. Banks 0 to 3
  44. are accessed out of chip bank one (U2 to U9), and banks 4 to 7 are accessed
  45. out of chip bank two (U10 to U17). Please note the distinction between chip
  46. banks, and REU banks.  Note: signals preceded by an asterisk indicate that
  47. they are active low Dynamic RAM Basics.
  48. Dynamic RAM memory chips are constructed with multiplexed address inputs.
  49. This means that they carry different information at different times. To access
  50. a particular memory cell, we first supply the chip with half of the actual
  51. address, a row address. Next we latch this address into the chip by asserting
  52. the Row Address Strobe (*RAS). Now we supply the chip with the other half of
  53. the address, the column address. Once again we latch this address into the
  54. chip by asserting the Column Address Strobe (*CAS). Depending on the state of
  55. the Write Enable (*WE) signal, a read or write memory cycle will occur.
  56. Unfortunately dynamic RAMs forget everything unless they are reminded, or
  57. refreshed. This must be done about every 4 milliseconds! To refresh the memory
  58. a RAS only cycle must be done for every row address. This means that only the
  59. row address is latched into the chip; the column address is not needed here.
  60. The entire row of data stored in the chip will be refreshed, and our data will
  61. be safe for another few milliseconds. In a REU the RAM Expansion Controller
  62. (REC) chip takes care of all this for us.
  63. Fooling the REU
  64. Since a REU was only designed to access 512 kb of expansion memory, we must
  65. fool it in order to access more. We do this by letting the REU think that it
  66. has only 512 kb available at any one time. This means we need some way to
  67. switch between the extra banks of memory. The circuit shown in the schematic
  68. helps us to do this by adding two bits to the REU bank select register. This
  69. two bit output port lets us select one of four banks of 512 kb. So in other
  70. words, are REU now thinks it is four separate 512 kb REUs. Now we can easily
  71. access up to 2 Mb out of a REU!
  72. How the circuit works
  73. The secret to expanding dynamic memory lies in the *CAS signal. Since all the
  74. RAM chips need to be refreshed with *RAS, we don't do anything to this signal
  75. and pass it to all memory chips. This leaves us with manipulating *CAS.
  76. Manipulation of *CAS is the job of IC1, a dual two to four line
  77. decoder/demultiplexor. It is used to direct the REU signals *CAS0 (chip bank
  78. one), and *CAS1 (chip bank two), to the correct bank of eight RAM chips. When
  79. one of the REU CAS signals is asserted, the CAS signal of the selected bank is
  80. asserted. The bank selection is done with the two select inputs S0 and S1 of
  81. IC1. IC2 and IC3 form a two bit write-only register, whose outputs are the
  82. bank select inputs to IC1. Bits 3 and 4 of the REU bank register at $DF06 are
  83. latched into IC2, two D type flip-flops, on the negative edge of the system
  84. clock (theta2). By mapping our new two bit register to these normally unused
  85. bits, the extra memory appears to the user as extra 64k banks beyond the
  86. normal maximum of 512 kb. IC3 is a 3 to 8 line decoder/demultiplexor, which
  87. is used to decode the lowest three bits of the I/O2 page ($DF00 to $DFFF)
  88. address. The IC3 signal *O6 is used as the clock signal for the two
  89. flip-flops, which latches bits 3 and 4 of the data bus on the positive edge.
  90. This happens whenever $DF06 is written to. On a read memory cycle to $DF06,
  91. IC3 is disabled and the REU's regular internal register appears on the data
  92. bus. A switch pulls the *CLR inputs to each of the flip-flops low when it is
  93. closed  (position 1). This forces them to select bank zero of 512 kb at all
  94. times, which is present in all 512kb REUs. When the switch is open (position
  95. 2), the flip-flops can freely take on the values of bits 3 and 4 of $DF06.
  96. This allows complete software compatibility with a 1750 (512 kb) REU. Lastly,
  97. the two Light Emitting Diodes (LEDs), which are optional, simply show us (in
  98. binary) what bank of 512k we are using. They allow us to quickly check
  99. software compatibility, as explained later.
  100.  
  101. Installation
  102. All the expansion hardware fits inside the REU case. You will not be able to
  103. use the RF shield, and it will be a very tight fit with all 2 Mb  installed
  104. (don't use IC sockets!). Start by expanding your REU to 512 kb, or in other
  105. words you need a 1750 REU. See Volume 9, Issue 5 of the Transactor, or the
  106. article by ScottB30 on Quantum Link for expanding 1764 and 1700 REUs. Take the
  107. usual static precautions, and of course, any modification to the REU will void
  108. the warranty! Proceed at your sole risk! On the component side of the REU,
  109. with the edge connector towards you, locate Resistor Package RP3 on the left
  110. side near the middle of the board. Flip the board over to the solder side,
  111. again with the edge connector towards you. Locate RP3 again on the right side
  112. of the board. From the top of the board, find pin 7 of RP3 and cut the trace
  113. leading away from the pin. Solder a wire to this pin (pin 7); this is the
  114. *CAS0
  115. signal. Find pin 3 of RP3 and again cut the trace leading away from the pin.
  116. Solder a wire to this pin (pin 3); this is the *CAS1 signal. Flip the board
  117. over to the component side with the edge connector towards you, and locate
  118. ram chips U2 and U10 on the top left side of the board. Flip the board over
  119. to the solder side and again locate these chips. To pin 15 of U2 solder a
  120. wire;
  121. this is the *CASBANK0 signal. Solder a wire to pin 15 of U10; this is the
  122. *CASBANK1 signal. Run the four wires you now have, down to the right side of
  123. the edge connector and secure them in the corner with a piece of electrical
  124. tape. This completes all the solder connections to the solder side of the
  125. board. Locate the fifth pin from the right on the edge connector and follow
  126. the trace to a component leg; note the placement. Flip the board to the
  127. component side for the last time, and locate the component. It is labelled
  128. FB2,
  129. and should be a Ferrite Button, but is a 430 Ohm resistor (yellow, orange,
  130. brown, gold bands) on my REU. To the opposite end of the component, away from
  131. the edge connector, solder a wire; this is the system clock signal theta2.
  132. Locate the thirteenth pin from the right on the edge connector. Follow the
  133. trace to a pass-through, and solder a wire into it; this is the *I/O2 signal.
  134. Locate the eighteenth pin from the right of the edge connector, and follow the
  135. trace to Ferrite Button FB1. To the side away from the edge connector solder a
  136. wire; this is the R/*W signal. Locate the empty pinout (U18) next to the
  137. square
  138. REC chip. Solder wires into the holes for pins 8, 9, 10, 14, 15, 16, and 28.
  139. These are the signals A2, A1, A0, Ground, D3, D4, and +5 volts respectively.
  140. This completes the signal hunting.  Lay a 2 inch strip of double-sided foam
  141. tape down the centre of the missing IC (U18) pattern. Try to leave room near
  142. the right edge of the case so you can mount a switch. Mount the ICs, in order
  143. from left to right, to the tape UPSIDE DOWN (pins sticking up) with the
  144. notches
  145. (or dots) towards the top of the board. Place them as far apart as you can on
  146. the tape.
  147. Now connect the ICs using (carefully!) point to point soldering, or wire-wrap
  148. DIRECTLY on the IC pins (yes, it can be done). If you do wire-wrap, only 4
  149. wrap
  150. per connection are necessary, and "over wrapping" (wrapping on top of
  151. wrapping)
  152. is recommended for the second connection to a pin. Keep the connections as
  153. short as possible e.g.. +5 volts to pin 14 of IC1 in mine is 1/4 of an inch
  154. long. Mount the switch in the top half and on the edge of the REU's case in a
  155. convenient place. I recommend placing it near the bottom right corner, near
  156. the
  157. plastic post since there is nothing in the way here. A slide switch is neater
  158. than a toggle switch, but it isn't very much fun trying to make a square hole
  159. for a the slide switch! Mark (or just note) the position of the switch on the
  160. case (open: 2 Mb, closed: 512 kb) with a marker (Sanford "Sharpie" writes
  161. permanently on anything!) or use "Letraset" type lettering.
  162. The next step, and last step, is to wire and mount the two optional LED
  163. indicators. Solder wires to all the leads of both the LEDs. Drill holes for
  164. the
  165. at the top edge, of the top half of the case, so they're visible with the REU
  166. installed. Make sure to put LED1 on the left and LED0 on the right, so you can
  167. read the bank of 512 kb  in binary (0=un-lighted, 1=lighted).
  168. Your REU now works the same as before, at least it should! Plug it in, move
  169. the
  170. switch to  position 1 (switch closed, the optional LEDs should both be
  171. un-lighted) and give the REU a spin with any test program of your choice. If
  172. things look bad, power down and recheck all connections! If it does work,
  173. congratulations! You now have an REU that can be expanded to 2 Mb  by adding a
  174. meagre (48) RAM chips.
  175. Adding memory
  176. Expand the memory by piggy-backing the existing RAM chips in chip banks one or
  177. two, starting with chip bank 1. Bend pin 15 up, to a 45 degree angle, on each
  178. of the RAM chips to be added. Connect a wire to this pin before soldering it
  179. to the other RAM chip. Once the chip is soldered in place, connect the wire to
  180. pin 15 of the next RAM chip to be added. Solder another wire to its pin 15,
  181. and solder the chip in place next to the other. Continue in this way until all
  182. the RAMs in a chip bank are piggy-backed, and all pins 15 are connected in a
  183. daisy-chain fashion in each chip bank. Solder a wire to pin 15 of the
  184. rightmost RAM chip in the bank; this is the *CASBANKx signal. Now use an
  185. ohmmeter or continuity tester to see that all the chips in the newly added
  186. bank share the same signals on pins 1, 3 to 13, and 15 and 16. All that is
  187. left is to connect the wire *CASBANKx to an appropriate numbered signal on
  188. IC1.
  189. Odd numbered CASBANK signals are for RAM chips piggy-backed in chip bank one,
  190. even numbered ones are for RAM chips piggy-backed in chip bank two. Choose the
  191. next available signal when adding a new bank of RAMs. *CASBANK0 and *CASBANK1
  192. are reserved for the two chip banks already in a 512 kb REU. Connect the
  193. *CASBANKx signal, and you now have another 256 kb of memory! Repeat for chip
  194. bank two for 512 kb extra RAM. Add just as much RAM as you need in 256 kb
  195. increments!
  196. Programming an expanded REU
  197. You don't need to do anything different to use the extra memory in the REU.
  198. Just remember that you now have more 64 kb banks that you can access through
  199. the bank register at $DF06 when in 2 Mb mode (switch in position 2). When in
  200. the 1750 emulation (512 kb) mode (switch in position 1), remember you only
  201. have access to banks 0 to 7 of 64 kb. Keep in mind the peculiarities of the
  202. 2 Mb mode as well. That's all there is to it! The number of banks depends on
  203. how much memory you added; 0 to 15 with 1 Mb, and 0 to 31 with 2 Mb for
  204. example. Note that all software that tests for a REU will only find 512 kb
  205. available, so a slightly different memory test is necessary to check on how
  206. much expansion memory we have. Since the REU can be expanded up to 2 Mb  in
  207. 256 kb increments at the users discretion, a slightly different test is
  208. mandatory to figure out just how big the REU is. See listing 1 for an example.
  209. Peculiarities
  210. There are a few very minor inconveniences with this expansion project detailed
  211. as follows:
  212. 1) The REU will not wrap internally between banks of 512 kb, instead the REU
  213. will wrap to the beginning of the same 512k bank. For example, saving 2 bytes
  214. to $FFFF in bank 7 will put one byte at $FFFF in bank 7, and the other at
  215. $0000 in bank 0 NOT bank 8 as expected. This is because the REC chip does not
  216. recognise more than 512 kb directly; we have fooled it to use more RAM.
  217. 2) Bank register at $DF06 is write-only where bits 3 and 4 are concerned. If
  218. $DF06 is read, bits 3 and 4 (as well as bits 5, 6, and 7) will always be one
  219. no matter what bank of 512 kb the REU is in.
  220. 3) Bits 3 and 4 of the bank register at $DF06 are now significant, but in an
  221. unexpanded REU they are ignored. This is why we have a switch to disable all
  222. but 512k of memory when we run into non-compatible software. See the next
  223. section for details.
  224. 4) The 512 kb bank select bits are memory mapped by only the three lowest
  225. address bits. This means there are images of these bits at $DF0E, $DF16,
  226. $DF1E,
  227. etc. This is a trivial matter since no sane person uses image addresses!
  228. Compatibility
  229. There is only one source of software incompatibility in this modification; the
  230. 2 bit 512 kb bank select register we had added to $DF06. Since these two bits
  231. are now significant and didn't used to be, we could have a problem; software
  232. that doesn't set these bits to the same value at all times, or sets the bits
  233. to a bank of 512 kb that isn't installed yet, won't work. But this is what the
  234. switch is for! The 2 Mb modification is 100% compatible with any software
  235. written for a 1750 (512kb) REU, when in the switch selectable 1750 emulation
  236. mode (position 1, switch closed). Unfortunately none of the extra memory
  237. beyond this can be accessed when in this mode. This is of no consequence,
  238. since the software can't make use of any additional memory anyway. When the
  239. 2 Mb mode is switch selected (position 2, switch open), we have complete
  240. access to how ever much memory we have added. The switch should be in
  241. position 2 whenever possible! Most software can function in this mode,
  242. includin
  243. GEOS! The two optional LEDs are very useful to determine if the software is
  244. compatible in the 2 Mb mode. If you are using software meant to be used with
  245. a 1750 REU, you can use the software in the 2 Mb mode if: during a REU
  246. transfer
  247. the LEDs are always showing the same bank of 512 kb is being accessed (LEDs
  248. not
  249. flickering), and they indicate a bank that is installed (bank 0 of 512 kb is
  250. always present). Without the LEDs, it is simply a matter of saying "It works",
  251. or "It doesn't work" when you use software for a 1750 REU.
  252. Final words
  253. Don't let the length of this article discourage you; it only seems difficult
  254. in print! Your REU can now contain as much memory as an average IBM PC. So be
  255. nice to your IBM buddies, and don't brag too much! I can be reached on Q-link
  256. (screen name Recursion), or you can write me directly if you have any
  257. questions
  258. comments, or construction ideas.
  259. Andrew E. Mileski 210-180 Lees Avenue Ottawa, Ontario Canada, K1S 5J6
  260. Listing 1: Recommended type of REU memory check
  261. It is implemented here in BASIC with a REU wedge for the C64, but can easily
  262. be translated into assembly. This check will always return the number of 64 k
  263. byte banks that are useable in the REU. FETCH and STASH do exactly what you
  264. might think. The operands are bytes to transfer, computer base address, REU
  265. bas
  266. address, and REU bank (of 64 kb) number.
  267. 2000 REM ****INITIALISE ****
  268. 2010 REM Put a single status byte, that shows an unchecked bank, in each bank
  269. of 64kb.
  270. 2020 POKE 49152,136
  271. 2030 FOR I=0 TO 255
  272. 2040 !STASH 1,49152,0,I
  273. 2050 NEXT
  274. 2060 REM ****    TEST    ****
  275. 2070 REM Test for # banks present by seeing if bank checked yet. If not,
  276. change
  277. status of
  278. 2080 REM bank to checked, and add 1 to the # of banks. Else, bank is checked
  279. already and
  280. 2090 REM we're done! Note that we only test one byte per bank to speed things
  281. up.
  282. 2100 POKE 49152,27
  283. 2110 I=0
  284. 2120 !FETCH 1,49152,0,I
  285. 2130 IF PEEK(49152)<>136 THEN 2190
  286. 2140 POKE 49152,27
  287. 2150 !STASH 1,49152,0,I
  288. 2160 I=I+1:IF I<256 THEN 2120
  289. 2170 REM ****    DONE    ****
  290. 2180 REM Number of banks of 64kb is now in I.
  291. 2190 IF I=0 THEN PRINT "REU NOT PRESENT, OR NOT SEATED PROPERLY"
  292. 2200 IF I=2 THEN PRINT "THIS IS A  1700 (128 K) REU"
  293. 2210 IF I=4 THEN PRINT "THIS IS A  1764 (256 K) REU"
  294. 2220 IF I=8 THEN PRINT "THIS IS A  1750 (512 K) REU"
  295. 2230 IF I>8 THEN PRINT "THIS IS AN EXPANDED"; 64*I ;"K REU"
  296. Parts List and Miscellaneous Data
  297. Required parts
  298. IC1:   74F139      Dual 2 to 4 line decoder/demultiplexor.
  299. IC2:   74F74       Dual D-type flip-flops.
  300. IC3:   74F138      3 to 8 line decoder/demultiplexor. FAST series components
  301. recommended!
  302. 3.3k Ohm Resistor, 1/4 watt and 5% tolerance.
  303. SPST micro-mini toggle, or slide switch.
  304. Two inch strip of double-sided foam tape.
  305. Supply of 30 gauge wire.
  306. And other standard tools and equipment.
  307. Optional  Two LEDs T-1 size.
  308. Two 390 Ohm resistors, 1/4 watt and 5% tolerance.  Pin connections
  309. IC1 Pin 16: +5 Volts
  310. 1: *CAS0
  311. 15: *CAS1
  312. 2: IC2 pin 5
  313. 14: IC1 pin 2
  314. 3: IC2 pin 9
  315. 13: IC1 pin 3
  316. 4: *CASBANK0
  317. 12: *CASBANK1
  318. 5: *CASBANK2
  319. 11: *CASBANK3
  320. 6: *CASBANK4
  321. 10: *CASBANK5
  322. 7: *CASBANK6
  323. 9: *CASBANK7
  324. 8: Ground  IC2 Pin 14: +5 Volts
  325. 1: **1**
  326. 13: **1**
  327. 2: D3
  328. 12: D4
  329. 3: IC3 pin 9
  330. 11: IC2 pin 3
  331. 4: +5 Volts
  332. 10: +5 Volts
  333. 5: IC1 pins 2,14
  334. 9: IC1 pins 3,13
  335. 6: LED0 **2**
  336. 8: LED1 **2**
  337. 7: Ground  IC3 Pin 16: +5 Volts
  338. 1: A0     15: No connection
  339. 2: A1     14: No connection
  340. 3: A2     13: No connection
  341. 4: *I/O
  342. 12: No connection
  343. 5: R/*W
  344. 11: No connection
  345. 6: Theta2
  346. 10: No connection
  347. 7: No connection
  348. 9: IC2 pins 3,11
  349. 8: Ground
  350. **1** Connect this pin to one side of the switch. There should be two pins
  351. connected to the same side of the switch. To the same side of the switch
  352. connect a single 3.3k Ohm resistor. Connect the free end of the resistor to +5
  353. Volts. Connect the other side of the switch to ground.
  354. **2** Connect this pin to the cathode of the LED shown. Connect the anode of
  355. each LED to its own 390 Ohm resistor. Connect the free end of each resistor to
  356. +5 Volts.  Top of ICs are indicated by a dot or notch. When the chips are
  357. installed up-side-down, the pin numbering is clockwise from the top right pin!
  358. Since the RAM chips are installed right-side up, their pin numbering is
  359. counter
  360. clockwise from the top left pin. Don't mix up the numbering!!!
  361. ***Note***  This file was converted from the original geoWrite 2.1 file by the
  362. author. The schematic in geoPaint format has been reduced into the pin
  363. connection table shown above. If you have GEOS 2.0 I recommend you obtain the
  364. original ARCed files from Q-Link ("BEYOND512KB.SDA" by Recursion)
  365.  
  366.  * OLX 2.1 TD * Venturing Inn - with Heath - Commodore Network Magazine
  367.  * Origin: Commodore Network - Melbourne Australia +61-3-802-3852
  368. (3:633/158.2)
  369.