Building your own custom computer with the MiST FPGA board (part 1)

I’m still a noob when it comes to understanding the FPGA stuff. But I’m eager to learn an recently I’ve discovered the nice page of Grant Searle.
He takes the time to explain on how to build your own custom computer.
I thought it would be a nice challenge to get that running on my MiST. I’ve altered all sources of the module altsyncram to fit to the Cyclone III used in the MiST. Since the MiST is big enough I’ve used the following options without using sram:

  • CPU: Z80
  • ROM: Z80_BASIC_ROM
  • Program RAM: InternalRam4K
  • Interfaces: SBCTextDisplayRGB
  • Chip select: 4K internal RAM

I’ve connected the internal 27MHz clock of the MiST directly to the clock of this example. I knew that the example board is clocked with 50MHz but I wanted to see if it makes any difference. I’m still experimenting with this why not try it? 😉
I found in the minimig sources that the MiST uses there only two RGB output pins and that the pins 0-1 and 4-5 are unused. So I tried the same with the multicomp example:

Now the exciting part when starting the example the first time on the MiST. Unfortunately not much happened. The monitor didn’t show anything and went into sleep mode soon. So what is wrong?
I supposed that the monitor was driven by the wrong clock. Since the example board was driven by 50MHz it could be that the rest of the code is based on that.
I’ve used the Altera Megafunctions to create a module altpll with 27Mhz as input clock and 50MHz as output (c0). To enable that for the multicomp I’ve added the following code before the cpu entity:

Heureka! The boot prompt was visible and the cursor flashes so retro. 🙂
Still the screen was a little off and IIRC the monitor showed a refresh rate of 59MHz. In another attemped I changed the clk0_multiply_by of the alltpll from 50 to 60 and voila the screen looked really nice.

The next step will be to somehow connect the keyboard via SPI. The MiST uses SPI to talk to its IO ports like joysticks, keyboards, usb, etc. The example uses PS2 and I have to find a way to bring that together. For a regular vhdl developer this will be an easy task but for me it will be an adventure. 🙂

The current source code of this project can be found in my github repo.

(Click here for part 2)

2 thoughts on “Building your own custom computer with the MiST FPGA board (part 1)

Leave a Reply

Your email address will not be published. Required fields are marked *