The 6502-RAMROM as drive expander

Page jump links:

6502-RAMROM prototype test report from Womo, 2003-02-07
6502-RAMROM final release test report from Womo, 2003-02-16
Conclusion and application scenarios

This page provides a short overview of the 6502 microprocessor based hardware extension, that was designed by Nicolas Welte [1]. It contains a dedicated test report with my personal experiences and some application examples.

Originally the 6502-RAMROM 6502-RamRom inserted into 1541 drive, side view
[6502-RamRom inserted into
1541 drive, side view, 242KB]
was conceived by Nicolas Welte and Paul Förster for the Commodore PET series computers as a RAM and ROM expansion and diagnostic board, leading to it's first name: PETRAM. Based upon many discussions with Nicolas in the design phase, he (we ?) decided to make use of a Flash-ROM chip instead of just EPROMs. And other 6502 microprocessor based Commodore computers like the VIC20 or the 1541 disk drive should be taken into account. The processor adaptor board can be configured for different systems by simply replacing one little GAL 16V8 programmable logic chip [2]. To keep the hardware simple, the C64 computer or other non pure 6502 micro's are not supported.

6502-RAMROM prototype test report from Womo, 2003-02-07


Some weeks after Nicolas received his professionally manufactured printed circuit boards (PCBs) of the 6502-RAMROM [17], I ordered two of them Delivered 6502-RamRom and Flash-Adaptor PCBs
[Delivered 6502-RamRom and
Flash-Adaptor PCBs, 216KB]
along with some of the needed components. Since I don't own a PET computer nor a VIC20, I ordered only two GALs for the Commodore 15x1 drive replacement configuration. Since I can call myself an experienced electronic craftsman, soldering the board was no big problem. Although I have to state that, for a beginner, it may be too hard. Please look onto Nicolas' construction page [3] and carefully decide, if you feel able to solder the board. If not, you should order the ready-built extension board [4].

At this time, the Flash update software wasn't available for disk drive in-circuit updates, so I had to use my IBM-PC based c't-Flasher [5] for burning some contents into the ROMs. I tested several speeder ROMs, flashed different versions into the four ROM banks and switched them forth and back. Everything worked fine, cool.

Dolphin-DOS 2.0

Before I could test the RAM options I needed to solve some problems. I wanted to test out the Dolphin-DOS 2.0 floppy speeder ROM [6,7], which makes use of additional RAM [8]. But for this and other speeder systems I needed to install a parallel cable from the floppy's 6522 VIA chip to my C64's user port. And I needed a simple solution to quickly test out different C64 Kernal replacements.
The second was no problem, because I also ordered some Flash-ROM C64 Flash-Adapter Kernal ROM switch, top view
[C64 Flash-Adapter Kernal ROM
switch, top view, 197KB]
Inserted C64 Flash-Adapter Kernal ROM switch
[Inserted C64 Flash-Adapter
Kernal ROM switch, 189KB]
adaptor PCBs [9] and could easily build a Flash-ROM to C64 Kernal adaptor. Inserting a parallel cable into my 1541 drive was a little bit problematic, because the 6502-RAMROM board overlays the 6522 VIA chip location. First I used some additional 40 pin sockets to lift the 6502-RAMROM a bit higher, but I didn't feel happy with it; the case couldn't be closed now. So I built a very special lowest-profile parallel cable adaptor.

This all done, I first tested my beloved SpeedDOS (35 and 40 tracks) and made sure, that it worked fine. I also tested some of the most important copy programs to make sure, that the parallel cable and the ROM replacements don't fail. Preparations for the test of Dolphin-DOS 2.0 [8] were done, flashing the 1541 drive ROM and C64 Kernal. I configured the RAM option switches to DD2 and made the first steps. Anything looked fine. And wow, DD2 isn't as slow as I thought all the time. Although beaten by Professional-DOS [10], working with it brings fun. I couldn't see any problems like load or CRC errors, all games loaded fine and were playable. So the RAM seemed to work fine also.

In-circuit flashing

The next test phase came, when Nicolas was finished with the in-circuit drive flashing software [11]. This piece of software was designed a very, very special way. The ROM, that is going to burned is not loaded into the computer's memory and transferred back into the drive's Flash-ROM memory. That would be much too long winded. No, the ROM contents are transferred directly, block by block, from the disk's surface into the drive's buffer memory and further into the Flash-ROM. This is possible, because Flash-ROMs from Atmel [12] were used, that can be flashed page by page. Unfortunately the Flash software does only support chips from Atmel until now, but you can use differently sized ROMs, if you want (AT29C256, AT29C512, AT29C010) and if you don't need that much ROM banks.

For the first times flashing new drive ROMs went flawlessly, but whenever a SpeedDOS-ROM was configured via the main ROM switches I ran into problems with flashing other ROM banks. Some tests revealed, that whenever a SpeedDOS-ROM was selected with the 6502-RAMROM and the Flash enable switch was set, the drive hung up, when a file was loaded or the error channel was retrieved with the '@' command. I discussed it with Nicolas and he told me, that he found similar problems with the original CBM VIC20-ROM. We found out that some misdesigned ROM code fragments were responsible for this (Note: the VICE emulator's built-in monitor [13,14] was exceedingly helpful with this: <ALT>-m, device 8:, watch store 8000 FFFF, exit). Whenever the Flash enable switch is set and parts of code executed by the desired 6502 processor store values to the ROM (to the Flash-ROM), the internal logic of the Flash blocks the whole chip so that even reading the ROM fails for some time.

After discussing this point in the cbm-hackers mailing list [15], Nicolas managed to fix this ROM bug and so did I with the SpeedDOS-ROMs [16]. Now, with the patched ROMs, I was able to Flash other ROM banks without the need to switch back to the original CBM DOS 2.6 ROM (which worked flawlessly with all previous tests).

Problems with the prototype

Another problem manifested when analyzing the »store-to-ROM« problem with the drive expansion 6502-RAMROM prototype [17]. What happens, when someone wants to flash the whole ROM, but the DD2 RAM configuration is selected? Because the DD2 RAM overlays the drive's address space from 0x8000 to 0x9FFF [8], the Flash-ROM cannot be addressed there. Furthermore, DD2 went crazy, whenever the Flash enable switch was set. Nicolas detected the problem by carefully reviewing the 1541 GAL equations. The Flash option switch disables the overlaying RAM for write operations. Not a big task, because only the GAL needs to be replaced, I thought.

First we decided to patch the floppy DOS ROM part of Dolphin-DOS 2.0. The ROM code should not access the 8kB RAM at the memory address location 0x8000...0x9FFF anymore, but at the addresses 0x6000...0x7FFF. That way no changes to the 6502-RAMROM would needed, because the RAMboard configuration could be used instead. And flashing the full 32kB ROM bank should become possible, too.

But Nicolas reported, that the patched DD2-6 ROM [21] didn't work, although other tests with the VICE emulator showed no problems. He found out, that there was a real hardware problem, that depends on the special address decoding behaviour of the CBM drive series (RAM and especially VIA locations mirrored at different addresses; IRQ flag handling). Since the PET and VIC20 computers don't contain such mirrored device address spaces, this problem couldn't be detected with the PET/VIC20 6502-RAMROM prototypes.

The Solution

Nicolas worked out a solution, that needed the least possible changes to the PCB in combination with changed GAL equations. Without the GAL, this fix would have been a huge patch orgy. Unfortunately you have to redo the patch [3], if you want to use the 6502-RAMROM in a VIC20 or PET again. Although not needed I installed some jumpers to easily configure the PCB for both options.

In the meantime I tested flashing other Flash-ROMs with different sizes. I had an AT29C020 as spare and tested the bigger flashing page size. Reading out the ROM contents with the c't-Flasher [5] at my PC again showed no differencies. Note: you can't access/flash half of the banks of this ROM type without further hardware modifications.
Then I tested an AT29C256 as a small replacement for my C64 Kernal switch board. AT29C256 to 32 pin Flash-Adaptor, bottom view
[AT29C256 to 32 pin Flash-
Adaptor, bottom view, 129KB]
AT29C256 to 32 pin Flash-Adaptor, top view
[AT29C256 to 32 pin Flash-
Adaptor, top view, 154KB]
Before I had to build a small Flash adaptor, because the 29C256 has got a different pinout (28 pins) than the standard 32 pin Flash ROM chips. I hacked Nicolas' Flash-ROM board [9] a little bit by cutting some traces. Although the Flash-ROM PCB was not designed for this purpose it fitted my needs best (instead of building a cable wired adaptor). Flashing the 29C256 with the least possible page size brought me a very small kernal switch board in a few minutes; thanks to the well designed Flasher software [11], that is able to burn different parts of the ROM chip in several steps (by selecting a start address of 0x8000, 0xA000, 0xC000 or 0xE000).

6502-RAMROM final release test report from Womo, 2003-02-16

Retesting different flashing scenarios to check, that the problems with Dolphin-DOS were gone

After I got the new changed GALs I repeated all the earlier tests:

  1. Flashing the original CBM DOS V2.6 into bank 0
  2. Selecting bank 0 and flashing the patched SpeedDOS 40 tracks ROM into bank 1
  3. Selecting bank 1 and flashing the original Dolphin-DOS 2.0 ROM into bank 2. Because of the applied SpeedDOS ROM patch, the Flash procedure went flawlessly.
  4. Selecting bank 2, configuring the DD2 RAM configuration and flashing the patched Dolphin-DOS-2.0-6 ROM (RAM a location 0x6000 to 0x7FFF) into bank 3. No problems with that and it shows, that you can now Flash the ROM locations from 0xA000 to 0xFFFF, when the original Dolphin-DOS 2.0 is enabled. But don't try to Flash the ROM location at 0x8000. Because it is used by DD2's RAM, the drive may become stubborn.
  5. Selecting bank 3, configuring the RAM-Board configuration and flashing the Dolphin-DOS 3.0 ROM into bank 0. With the patched DD2-6 ROM the full ROM bank (0x8000 to 0xFFFF) could be flashed without any problem, thanks to the hardware modification and the new GAL.

After preparing some matching C64 Kernal ROMs AT29C256 to C64 Kernal adaptor, top view
[AT29C256 to C64 Kernal
adaptor, top view, 123KB]
AT29C256 to C64 Kernal adaptor, bottom view
[AT29C256 to C64 Kernal
adaptor, bottom view, 136KB]
I started testing the burned SpeedDOS and Dolphin-DOS versions. As mentioned earlier the patched SpeedDOS and also the original Dolphin-DOS ROM worked without problems. I also tested some special Dolphin-DOS copy programs (Dolphin-Copy) without problems.

The patched Dolphin-DOS-2.0-6 (RAM at 0x6000) [21] is another task, with this ROM, the Dolphin-Copy program doesn't work, because the RAM location seems to be hardcoded into the copy tool. I also tested Dolphin-DOS 3.0, which worked fine with the exception that it was nearly as slow as the original CBM DOS. No wonder, because DD3 makes use of an extra parallel port chip (6821 PIA) within the drive. It cannot communicate over the standard parallel port cable connected to the VIA 6522, therefore it has to use the slow serial bus transfer routines.

The future and some ideas

Until now, mainly the ROM part of the 6502-RAMROM was tested, in the future I'll have to look at the RAM configurations, especially in some applications for the maxRam-Mode. Perhaps Markus Brenner wants to jump in here and extends his Burstnibbler based transfer tool »mnib« [18], so that much more sophisticated copy protections can be dumped to G64 disk images.
I already started analyzing the Dolphin-DOS 3.0 DOS ROM looking for all the parallel port accesses to the 6821 PIA. Maybe I'm able to patch it, so that it makes use of the VIA 6522 parallel port. This way people may use Dolphin-DOS 3.0 without hardware hacking; that means adding an additional 6821 PIA into the floppy.

I should take my 1571 floppy drive sometime and test it with the 6502-RAMROM, too. There are other floppy speeders, especially designed for this drive. Not only to mention Dolphin-DOS 3.0 for the 1571, but especially Prospeed-1571. With this drive, the maxRam mode of the 6502-RAMROM cannot be used, it would overlay the 1571's CIA and the registers of the WD177x controller. It may be interesting what could happen, if the maxRam mode is used nevertheless.
Not enough, there are more problems with the Commodore 1571 disk drive. Since there is incredibly little space between the mainboard and the transformer assembled over it, I currently don't know, how to insert the 6502-RAMROM into the 1571 drive best. One solution may be to connect the board with some flat cable to the processor socket. As for the parallel cable connector (1571 Burstnibbler cable compatible) I already built another lowest profile adaptor.

Conclusion and application scenarios

Speeder system »emulator«

»Emulating« different DOS ROMs and simple speeder systems like Jiffy-DOS, SpeedDOS or Dolphin-DOS is the playfield of the 6502-RAMROM, when inserted into Commdore's disk drives. You only need to add a simple parallel cable for some of these systems.

Atmel Flash device programmer

In combination with a patched Dolphin-DOS (DD2-6) [21], this hardware extends your floppy disk drive to a full blown high speed Atmel Flash device programmer. You will never need to handle with EPROMs and EPROM burners again. There is no need anymore for transfering the ROM files slowly to the computer memory before they can be written to the EPROM. The well designed flasher software makes your life even simpler. Maybe you want to replace your system ROMs with DD2-6, which requires some little hardware modification (using address line A14 for switching the upper and lower part of the DD2 ROM at 0xA000/0xE000); this way you can flash the whole chip. Nicolas is also working on more functions, like programmable bank switching about unused VIA/CIA port lines.

Maybe not only Dolphin-DOS-2.0-6 can speed up the Flash process a little bit, but other drive speeders like Jiffy-DOS, too. Because of the special designed In-System-Flash software, the whole process is not really slow on a 1541 drive equipped with a standard CBM DOS (35 seconds for 32kB). So you don't need to install a speeder system or ROM in any case, instead it is an option. And Nicolas said, the Flash software contains some potential for speedups with the 1541 drive. Let's wait, test and see...

RAM (only) expander (1541/1571 RAMBoard) and RAM diagnostic module

More applications of this board may rely on the RAM option only, you could save some money by not making use of the Flash-ROM chip. Copy software like the well known tool series Maverick already know how to use a RAMBoard equipped drive [20], which the 6502-RAMROM can easily be configured to »emulate«.

Perhaps Michael Klein (cbm4linux [19]) or other people may want to develop special software, that makes use of a maxRAM equipped disk drive (nearly 32kB of RAM usable). Not to mention the RAM diagnostic functionality that replaces the drive's builtin RAM by the one from the 6502-RAMROM.

Things, the 6502-RAMROM can't do easily

Because the hardware was mainly designed for universality and simplicity, it is not a general speeder system hardware emulator. Systems like Dolphin-DOS 3.0, Professional-DOS or Prologic-DOS cannot be used without further extensions or ROM patches. This purpose may be the job of another hardware extension board, one of the projects I am currently working on.


  1. 6502-RAMROM main page
  2. Lattice semiconductor, GAL overview
  3. 6502-RAMROM construction page
  4. Nicolas Welte's order page
  5. c't-Flasher device article (english version)
  6. Patrick van der Poel's Commodore ROMs web resource
  7. C64 hardware detection project page with many Kernal and DOS ROMs
  8. Dolphin-DOS hardware schematic page
  9. Universal Flash-ROM adaptor
  10. Wolfgang Moser's info page about the floppy speeder Professional-DOS
  11. 6502-RAMROM disk drive flash software
  12. Atmel AT29Cxxx series Flash-ROMs
  13. The VICE emulator homepage
  14. VICE built-in monitor commands
  15. cbm-hackers mailing list (at Softwolves): VIC20 Kernal bug report and solution
  16. cbm-hackers mailing list (at Softwolves): SpeedDOS 1541 ROM write bug
  17. 6502-RAMROM prototype page
  18. Markus Brenner's mnib, a fast drive dump transfer tool
  19. Michael Klein's cbm4linux homepage
  20. Michael Klein's 8KB RAM expansion for the 1541 drive
  21. 6502-RAMROM download section


  • Patched SpeedDOS ROMs (2003-03-02, 163KB)

    ZIP archive containing the ready patched drive DOS ROMs of SpeedDOS 35 tracks and SpeedDOS 40 tracks as well as additional SpeedDOS (C64 Kernals and SpeedDOS Expert addon) and Dolphin-DOS (patched version as Flasher OS) ROMs. Take note, that the SpeedDOS ROMs don't only contain the patch for the 6502-RAMROM. They are based on the CBM ROM for the 1541-II disk drive, read the supplied text files for further documentation about the patches.
    The archive also contains a D64 image file with readily prepared versions (CBM style PRG format with prefixed load addresses) of all the ROMs.

  • 1541ROM-Check (2003-02-22, 82KB)

    Win32 commandline tool for checking 1541 disk drive DOS ROMs with a CBM style 8-bit checksum routine. The source code is included (GCC/Cygwin based) and can freely be distributed under the GNU public license.

Page jump links:

6502-RAMROM prototype test report from Womo, 2003-02-07
6502-RAMROM final release test report from Womo, 2003-02-16
Conclusion and application scenarios

Wolfgang Moser, 2004-01-09,  ,  ("contact me" form disabled due to too high demand, sorry)