| 1 |
;ACME 0.95 |
| 2 |
|
| 3 |
!ifdef lib_cbm_c64_reu_a !eof |
| 4 |
lib_cbm_c64_reu_a = 1 |
| 5 |
|
| 6 |
; This file contains definitions for accessing a RAM Expansion Unit (REU) of |
| 7 |
; type 1700, 1764, 1750 and compatible. These units contain a chip called REC |
| 8 |
; (RAM Expansion Controller) capable of direct memory access (DMA). |
| 9 |
; Standard base address of control registers is $df00 in i/o space. |
| 10 |
|
| 11 |
!address { |
| 12 |
; status register |
| 13 |
rec_status = $df00 ; reading will clear IRQ, END and ERROR bits |
| 14 |
} |
| 15 |
rec_STATUS_IRQ = %#....... |
| 16 |
rec_STATUS_END = %.#...... |
| 17 |
rec_STATUS_ERROR = %..#..... ; for verify command |
| 18 |
rec_STATUS_TYPE = %...#.... ; chip type (do not use to determine unit size!) |
| 19 |
rec_STATUS_VERSION = %....#### ; always zero |
| 20 |
!address { |
| 21 |
; command register |
| 22 |
rec_command = $df01 |
| 23 |
} |
| 24 |
rec_COMMAND_EXECUTE = %#....... ; setting this starts the operation |
| 25 |
;reserved = %.#...... ; register bit exists, but does nothing |
| 26 |
rec_COMMAND_RELOAD = %..#..... ; reload address registers when done (do not use in verify mode, because you want the address in case of an error!) |
| 27 |
rec_COMMAND_IMMEDIATELY = %...#.... ; do not wait for $ff00 write |
| 28 |
;reserved = %....##.. ; register bits exist, but do nothing |
| 29 |
rec_COMMAND_MODE_MASK = %......## ; bit mask for the four modes |
| 30 |
rec_COMMAND_MODE_STASH = %........ ; computer-to-REU |
| 31 |
rec_COMMAND_MODE_FETCH = %.......# ; REU-to-computer |
| 32 |
rec_COMMAND_MODE_SWAP = %......#. ; exchange |
| 33 |
rec_COMMAND_MODE_VERIFY = %......## ; compare |
| 34 |
rec_COMMAND_STASH = %#.#..... ; these wait for $ff00 before |
| 35 |
rec_COMMAND_FETCH = %#.#....# ; starting and then reload values. |
| 36 |
!address { |
| 37 |
; internal address (computer RAM) |
| 38 |
rec_int_low = $df02 |
| 39 |
rec_int_high = $df03 |
| 40 |
; external address (expansion RAM) |
| 41 |
rec_ext_low = $df04 |
| 42 |
rec_ext_high = $df05 |
| 43 |
rec_ext_bank = $df06 ; upper five bits always read as 1 |
| 44 |
; A stock 1700 unit has two banks (128 KiB). |
| 45 |
; A stock 1764 unit has four banks (256 KiB). |
| 46 |
; A stock 1750 unit has eight banks (512 KiB). |
| 47 |
; Upgraded units and clones may have more, but the REC chip will always |
| 48 |
; "wrap around" after eight banks if crossing bank borders! |
| 49 |
; amount of bytes to process |
| 50 |
rec_amount_low = $df07 ; using $0000 results in |
| 51 |
rec_amount_high = $df08 ; 64 KiB being transferred |
| 52 |
; when to request interrupts |
| 53 |
rec_irqctrl = $df09 ; lower five bits always read as 1 |
| 54 |
} |
| 55 |
rec_IRQCTRL_ENABLE = %#....... |
| 56 |
rec_IRQCTRL_ON_END = %.#...... |
| 57 |
rec_IRQCTRL_ON_ERROR = %..#..... ; for verify errors |
| 58 |
!address { |
| 59 |
; address control (set to zero for normal operation) |
| 60 |
rec_addrctrl = $df0a ; lower six bits always read as 1 |
| 61 |
} |
| 62 |
rec_ADDRCTRL_FIX_INT = %#....... |
| 63 |
rec_ADDRCTRL_FIX_EXT = %.#...... |
| 64 |
|
| 65 |
; $df0b..$df1f always read as $ff, |
| 66 |
; at $df20 the registers repeat. |
| 67 |
; these "32 registers" are visible 8 times in the $df00 page. |
| 68 |
|
| 69 |
; The REC is labeled "MOS 8726R1" and was available as a giant (64-pin) DIP |
| 70 |
; version and as a 68-pin quad-pack version. Both packages seem to contain the |
| 71 |
; same die, but because of the different number of pins, they are bonded |
| 72 |
; slightly differently. |
| 73 |
|
| 74 |
; Pinouts: |
| 75 |
; |
| 76 |
; DIP version |
| 77 |
; ____ ____ /reset 1 |
| 78 |
; | V | /irq 2 | 68 n.c. |
| 79 |
; /reset | 1 64 | vcc dotclk 3 \ | / 67 vcc |
| 80 |
; /irq | 2 63 | bs r/w 4 \ \ | / / 66 bs |
| 81 |
; dotclk | 3 62 | /cas1 1 MHz 5 \ \ \ | / / / 65 /cas1 |
| 82 |
; r/w | 4 61 | /cas0 /cs 6 \ \ \ \ | / / / / 64 /cas0 |
| 83 |
; 1 MHz | 5 60 | /ras1 /ba 7 \ \ \ \ \ | / / / / / 63 /ras1 |
| 84 |
; /cs | 6 59 | /ras0 /dma 8 \ \ \ \ \ \ | / / / / / / 62 /ras0 |
| 85 |
; /ba | 7 58 | /dwe d7 9 \ \ \ \ \ \ \ | / / / / / / / 61 /dwe |
| 86 |
; /dma | 8 57 | dd0 \_\_\_\_\_\_\_\_|_/_/_/_/_/_/_/_/ |
| 87 |
; d7 | 9 56 | dd1 d6 10| o |60 dd0 |
| 88 |
; d6 | 10 55 | dd2 d5 11| |59 dd1 |
| 89 |
; d5 | 11 54 | dd3 d4 12| |58 dd2 |
| 90 |
; d4 | 12 53 | dd4 d3 13| |57 dd3 |
| 91 |
; d3 | 13 52 | dd5 d2 14| |56 dd4 |
| 92 |
; d2 | 14 51 | dd6 d1 15| |55 dd5 |
| 93 |
; d1 | 15 50 | dd7 d0 16| |54 dd6 |
| 94 |
; d0 | 16 49 | vss n.c. 17| quad pack |53 dd7 |
| 95 |
; vss | 17 48 | ma8 vss 18| |52 vss |
| 96 |
; a15 | 18 47 | ma7 a15 19| version |51 n.c. |
| 97 |
; a14 | 19 46 | ma6 a14 20| |50 ma8 |
| 98 |
; a13 | 20 45 | ma5 a13 21| |49 ma7 |
| 99 |
; a12 | 21 44 | ma4 a12 22| |48 ma6 |
| 100 |
; a11 | 22 43 | ma3 a11 23| |47 ma5 |
| 101 |
; a10 | 23 42 | ma2 a10 24| |46 ma4 |
| 102 |
; a9 | 24 41 | ma1 a9 25| |45 ma3 |
| 103 |
; a8 | 25 40 | ma0 a8 26|_________________________________|44 ma2 |
| 104 |
; a7 | 26 39 | test / / / / / / / / | \ \ \ \ \ \ \ \ |
| 105 |
; a6 | 27 38 | vss a7 27 / / / / / / / | \ \ \ \ \ \ \ 43 ma1 |
| 106 |
; a5 | 28 37 | vcc a6 28 / / / / / / | \ \ \ \ \ \ 42 ma0 |
| 107 |
; a4 | 29 36 | /romsel a5 29 / / / / / | \ \ \ \ \ 41 n.c. |
| 108 |
; a3 | 30 35 | /roml a4 30 / / / / | \ \ \ \ 40 test |
| 109 |
; a2 | 31 34 | /romh a3 31 / / / | \ \ \ 39 vss |
| 110 |
; a1 | 32 33 | a0 a2 32 / / | \ \ 38 vcc |
| 111 |
; |_________| a1 33 / | \ 37 /romsel |
| 112 |
; a0 34 | 36 /roml |
| 113 |
; 35 /romh |
| 114 |
; |
| 115 |
; Basically, half of the pins (the low numbers) are for talking to the c64/c128 |
| 116 |
; and the other half (the high numbers) are for talking to the REU's own RAM. |
| 117 |
; "/romh", "/roml" and "/romsel" are just the inputs and the output of a simple |
| 118 |
; AND gate, the result is used to select the EPROM socket. |