RomWriter for 39SF040

The RomWriter is a dedicated stand alone device for programming 39SF040 flash memory chips with a 512k RomWBW image. The design specification called for it to be as simple as possible to use, and to assemble, OS independent and to avoid any feature creep. Sadly, feature creep crept in, and it can also be used for dumping 39SF040 ROMs too.

39SF040 RomWriter PCB render

The RomWriter reads a file from micro SD and writes it to ROM. Alternatively, it can read the ROM and dump its contents to file. This self contained stand alone operation makes it OS independent, regardless if you use Windows, Mac, Linux, Haiku, Android, or anything else, as long as it can put a file on SD. Note that to build custom RomWBW images, though, you will need a Windows, Mac or Linux machine to create the file.

A small OLED display and two tactile buttons are the user interface. The display will show the current status, including a progress bar during read, write or verify operations, or prompt the user if there is an error. The buttons will initiate a Write or Dump operation, or help the user respond to error messages.

Buy RC2014 Kits on z80kits.com

Assembly

The device is supplied almost fully assembled, with all surface mount components fitted. The microcontroller is pre-programmed with custom firmware. Only the chip socket, display and power pins to be assembled by the user. Anybody that has built their RC2014 should be capable of fitting these components without any issues. Power can be applied either via the 2 pins at the bottom, which line up with the Gnd and 5v on the RC2014 backplane, or via the 6 pin FTDI header. The 32 pin socket for the 39SF040 can be either a regular DIP socket, or a Zero Insertion Force (ZIF) socket.

Expected Use Case

RomWBW is a very powerful operating system, and features support for a lot of different hardware. It is also actively maintained, with new releases around once a year, and an ongoing development branch. Whilst it has support for a lot of hardware, the constraints of a computer like the RC2014 Zed Pro mean that only a subset of the most common hardware is supported in the stock ROM.

Therefor users probably fall in to three categories;

  • Those which want to update to a more recent release for extra features or bug fixes.
  • Those which have added a particular piece of hardware which is supported but not included in the stock ROM.
  • Those which want to test out features or support of development branch builds.
39SF040 RomWriter PCB back render

Upgrading to the latest RomWBW release

RomWBW releases can be found here https://github.com/wwarthen/RomWBW/releases with the latest stable release listed as Latest. (Currently 3.4.1).

  • Download the Packages zip file
  • Find the RCZ80_std.rom file in the /binary directory and copy it to a blank micro SD card
  • Put the micro SD card in the RomWriter
  • Insert a 39SF040 ROM chip. This can be a blank chip, or the one from your current RC2014 Zed or RC2014 Zed pro
  • Apply power, either using a USB FTDI adapter (eg the one you use for the serial port) or plug it in to the RC2014 backplane (after removing all other modules and taking care to align the 5v and Gnd pins carefully)
  • Push the Write button when prompted to do so
  • Wait for the the erase / program / verify cycles to complete
  • Remove power. Remove the ROM and refit it to your module and enjoy the benefits of the latest release

Enabling particular options in the latest stable release

RomWBW releases can be found here https://github.com/wwarthen/RomWBW/releases with the latest stable release listed as Latest. (Currently 3.4.1).

  • Download the source zip or tar file
  • Unpack it and read the ReadMe.txt in the /source folder.
  • The instructions are very detailed, and explain how to build your own custom RomWBW ROM using Windows, Mac or Linux. The overall process is to modify the RCZ80_std config file to enable or disable support for different devices or change port addresses or whatever. (Obviously exact details depend on your needs). Then run make clean followed by make. Answer RCZ80 and std to the two questions asked during the build. This can take a couple of minutes or so.
  • This will result in a RCZ80_std.rom file in the /binary directory.
  • Find the RCZ80_std.rom file in the /binary directory and copy it to a blank micro SD card
  • Put the micro SD card in the RomWriter
  • Insert a 39SF040 ROM chip. This can be a blank chip, or the one from your current RC2014 Zed or RC2014 Zed pro
  • Apply power, either using a USB FTDI adapter (eg the one you use for the serial port) or plug it in to the RC2014 backplane (after removing all other modules and taking care to align the 5v and Gnd pins carefully)
  • Push the Write button when prompted to do so
  • Wait for the the erase / program / verify cycles to complete
  • Remove power. Remove the ROM and refit it to your module and enjoy the benefits of the new features.

Trying out latest RomWBW features in the dev branch

The latest RomWBW source code can be found here https://github.com/wwarthen/RomWBW Note that some features may not have been thoroughly tested, so unless you are confident that things will work ok, or that you can easily get back to a stable release, you may wish to make a backup of your existing ROM before overwriting it.

Making a backup

  • Place your current RomWBW ROM in the socket on the RomWriter.
  • Insert a blank* SD card (Does not need to be blank. But should not contain a file called DUMP.ROM)
  • Apply power, either using a USB FTDI adapter (eg the one you use for the serial port) or plug it in to the RC2014 backplane (after removing all other modules and taking care to align the 5v and Gnd pins carefully)
  • Push the Dump button
  • Wait for the reading cycle to complete
  • Remove power.
  • You now have a file on the SD card called DUMP.ROM. If you need to restore it, rename it to RCZ80_std.rom and use the Write function.

The dev releases of RomWBW do not contain precompiled binaries, so you will need to build RomWBW yourself. The section above describes the process.

Safety Checks

If the RomWriter is powered on without a micro SD card inserted it will report this. You will need to remove power, insert a card, and try again to use the RomWriter

The RomWriter is designed to use the 39SF040 flash ROM chip from SST. The chip ID is read to check this. If the ID is anything other than BFB7 then a Chip ID Mismatch error will occur with the option to Abort or Continue. Normally this means that the chip is not present, or even in backwards. In which case, Abort, fix the issue and try again. If you are using a different chip and are confident that it will work then you can continue but please be aware that this is not what this device was designed for or tested with, so positive outcomes cannot be guaranteed.

When writing, the file size of RCZ80_std.rom is checked that it is 512k (524288 bytes). If it is not, then it will give a File Size Mismatch error with the option to Abort or Continue. If the file size is 0, then probably it is either not on the SD card, has the wrong name, or is the wrong file. Push the Abort button, remove the SD card and check before proceeding. If you know that your file is a different size and understand the implications of using it, you can select Continue. It will try and write as many bytes on the file or the chip, whichever is smaller

When reading, a file called DUMP.ROM is created. If this already exists then you will get a File Size Mismatch error with the option to Abort or Append. Note that if you expect to need to restore the file by renaming it to RCZ80_std.rom then you will need to Abort, delete the existing DUMP.ROM and try again. Appending to the current DUMP.ROM file will still write the contents of the ROM to the file, but only the last 512k (524288 bytes) will be the part you need.

When verifying, the contents of the ROM are checked against the contents of RCZ80_std.rom. It will fail at the first discrepancy telling you the address, the ROM data and the file data. This implies that something is wrong (Probably a physical error like the chip is not seated correctly?). Using a mismatched ROM or file may also give that error.

Serial Output

The RomWriter includes a small OLED display which gives you the key information that you need. There is also a serial output on the FTDI connector at 115200 baud which gives a bit more verbose info. This will not be needed for normal operation, but may be of interest. If you get any of the errors above, such as Chip ID Mismatch, or File Size Mismatch, you will get a bit more info on the serial port, including the Chip ID and File Size. There is no serial input in to the RomWriter.

What this device is NOT

This is not designed as a universal EPROM programmer. If you wish to program anything other than a 39SF040 you will be better off buying a TL866-II. If you want to edit ROM contents manually or program individual blocks of memory, you will be better off buying a TL866-II. If you already have an EPROM programmer that works with your operating system then you probably don’t need this.

Bill of materials

  • 1 RC2014 39SF040 RomWriter PCB
  • 1 0.91″ OLED Display & Pins
  • 1 1×6 RA header
  • 1 1×2 RA header
  • 1 32 DIP Socket
  • Option – 1 32 ZIF socket