In summer 2007, Infinite coder Edwin Velds was trying out his 1chipMSX, adding/adjusting the VHDL code to be exact. For a while, this worked fine, developing for the 1chipMSX almost seemed an easy thing to do! But as always, when something looks too good to be true, it usually is. At a certain point the 1chipMSX wouldn't boot anymore. A bug had sneaked in, and without a booting 1chipMSX, there's no way to reset this machine using software. A cable would bring a solution.. if it wouldn't be so darn expensive. Aiming at a cheap solution, Edwin tried to create this cable himself using low-cost components. Initially it didn't work out, and the 1chipMSX remained to be a 1brickMSX for half a year. Recently however, he managed to create a perfect cable. Edwin's own whole story and guidelines can be read below!  


Resurrecting a 1chipMSX


I did quite a bit of research on the programming of the 1chipMSX after a uploading a faulty configuration. In order to do this without much expenses, I wanted to make a cable by myself instead of buying the relatively expensive ones that are available. For that purpose I pulled a schematic off the internet. But I never was able to get it to work. It turns out that things weren't as clear as I though they were.  


Some background. The FPGA board has three modes by which a configuration can be uploaded. JTAG, Passive Serial and Active Serial. When examining the schematics you can determine that the JTAG pins of the FPGA chip aren't even connected, so that option won't work. The other modes are selected by the status of the MSEL pins of the FPGA. In the 1chipMSX however, these appeared to be hard wired to Active Serial. Therefore, any solution has to be able to do Active Serial configuration.  


The cable I initially made (and for which the schematics are easiest to find) is the ByteBlasterMV cable. However, this cable can only do JTAG and Passive Serial. Which is the reason why I never got it to work. Fortunately, with some digging, a solution was found to convert this cable into a ByteBlasterII with a little rewiring. The ByteBlasterII cable is capable of doing active serial configuration. Here is a working schematic if anyone needs it. Note that this is a parallel port solution. USB cables are much more tricky.  


The actual programming is done with the programmer application. This is part of the Quartus II application (Tools menu), but there is also a separate one which doesn't actually need a licence to work. Before you can work with the programmer you need to manually install the driver for the parallel cables (see here). After that you have to select "Hardware setup" and add the "ByteBlasterMV or ByteBlasterII" hardware on the correct parallel port. If you have a USB blaster it may actually be detected already, but I'm can tell for sure since I don't have one.  

If everything is connected, the correct cable type should be detected. Now the programming can be done by:

  • Turn on the 1chipMSX.
  • Select "Active Serial" mode.
  • Choose "Add File..." and select the ESEMSX3/pld/emsx_top.pof file from the CD.
  • Verify that below the file there is a "Page_0" and a "emsx_top.hex" block under the file.
  • Check the "Program/Configure" column on all lines. And the "Verify" column if you feel like it.
  • Push Start and wait till it's done.
  • Now you can turn it off, disconnect the cable, and turn it on to watch the 1chipMSX in all its original glory.

If you installed the Quartus version supplied on the CD, then the verification step should be no problem. However, if you have a newer version installed (I have 7.1), then the hex data block tends to disappear. Which will leave out the ROM files from the configuration and it will fail to boot if you program this. Which is why I did.  


To correct this, you have to make a new pof file. However, the needed files aren't on the CD and you need to build the project first. I assume that the reason that you need to follow these steps is because you were doing more with the 1chipMSX and that you have done your own Compilation at this point.  


To create the file, go to "File -> Convert Programming Files ...". First you can try to open the original emsx_top.cof file by pressing "Open Conversion Setup Data". This should setup everything for you. You can also it manually with the following steps:

  • Select "Programmer Object File" as Programming file type
  • Select "EPCS4" as Configuration device. (Mode should be greyed now)
  • Select a file to save it to.
  • Keep memory map file checked.
  • Now you need to add two blocks, but the exact representation differs between versions.  


Version 6:  

- You start with two blocks, a main block and a "Page_0". If the "Page_0" block isn't there, you can add with Add Data.  

- Select the Page_0 block, choose "Add File" and select the "emsx_top.sof"  

- Click the file line, click Properties and turn on Compression.  

- Select the Main Block block, choose "Add File" and select the "emsx_top.hex"  

- Click the file line, click Properties and set addressing to relative.  

Version 7:  

- Select the SOF Data/Page_0 line, choose "Add File" and select the "emsx_top.sof"  

- Click the file line, click Properties and turn on Compression.  

- Click "Add hex data" to open the properties window for the new hex data.  

- Select Relative addressing.  

- Check "set start address" and set it to 0x40000.  

- Add the "emsx_top.hex" file.  

- After clicking OK the file should be visible in the list.

  • Click Generate.
  • In the same directory where you selected the .pof file to be saved, there should be, .map file. Open this in notepad and check whether you have a Page_0 block starting at 0x00000000 and a hex block at 0x00040000.
  • Now you can program the new file as described before.  



I hope this help when you start playing around with your 1chipMSX.