This web page is a part of buffi's web ring
Categories
Old Hardware Retro Computers

Notes from building a Midiori Midi card for X68000

I recently put together a Midiori MIDI card for my X68000, and the process was a little bit complicated, so I thought I’d write down a quick summary if someone else is interested in doing so as well.

Making the bare PCB

This one was straight forward, nothing special here.

  • Clone the Github repo
  • Open midori.pro in latest Kicad, go the the board file and Plot the Gerbers (and drill files). I got some warnings about it updating files due to them being created in an older version, but looks like that didn’t matter much.
  • Zip up and send to board fab of your choice. I used JLCPCB.

I decided to be cheap and not use gold fingers or tapered edges.

Sourcing parts (BOM)

The non-passives are:

For passives, I already had these at home, but should be easy to find.

  • C1 – C2: 4.7uF ceramic capacitors (0805)
  • C3 – C23: 0.1uF ceramic capacitors (0805)
  • R3: 10k ohm resistor (0805)
  • R6, R9: 220 ohm resistor (0805)

Building the FPGA Bitstream

I didn’t see any bin file for the Bitstream, so I compiled my own with the provided files in the repo (gateware/) folder.

You can download it here if you do not want to build it yourself.

Otherwise the instructions follow. This was quite a few steps. I did this on Windows.

  • Install Python 3 if you don’t have it
  • Install Migen
    • In a terminal: pip install migen
  • Install yosys (OSS CAD suite)
  • Build:
    • You should now be in a terminal with [OSS CAD SUITE] as prompt prefix.
    • cd to the midori repo.
    • Run: python3 gateware\midiori.py sim
    • then if no errors: python3 gateware\midiori.py build
    • This will generate a top.bin file in build/ . This is what you need to SPI flash to U2.
    • Take this file and pad it at the end with 0xFF bytes (I used a hexeditor) until it is 1048576 (0x100000) bytes long, which the Flash expects.

Write FPGA bitstream to Flash

If you have a favorite SPI Flash setup to use… then do that. Write top.bin from above to the AT25SF081B.

I used a Tigard device together with a sketchy adapter I made from stuff I had at home, see pic below. You might wanna get something nicer.

Then on OSX, I installed “flashrom” through homebrew by running brew install flashrom.

Then to write the file to the FPGA, I connected things and ran

flashrom -p ft2232_spi:type=2232H,port=B,divisor=4 -w top.bin

Soldering

Not much to say here. The FPGA has tiny pitch, so be careful and use magnification. At least on the revision (2.2 2020) that I soldered, U2 is oriented the other direction than other IC’s, so check for that.