Advanced notice: build your own "pick and mix" FPGA computer

For discussing the 65xx hardware itself or electronics projects.
zx80nut
Posts: 65
Joined: 04 Jan 2012

Advanced notice: build your own "pick and mix" FPGA computer

Post by zx80nut »

Hi.

Many of you have seen my other pages, including the "build your own UK101" in an FPGA
http://searle.hostei.com/grant/uk101FPGA/index.html

Well... now I have something else near completion.
With the UK101, the idea was to implement an existing design.

The other page that I am doing is the opposite - I will provide you all you need, and YOU WILL DESIGN YOUR OWN COMPUTER !
Again, this uses the extremely low cost board that I used on the UK101 FPGA page (see link above), but would work on most FPGAs.

YOU decide if you want a Z80, 6502 or 6809 design (6800 also coming soon).
YOU decide if you want a PS2 keyboard/monitor interface, a serial interface, or both.
YOU decide if you want internal (4K) RAM or to use an external RAM (40K+) or any other size
YOU decide on the speed of the processor
YOU decide if you want an interface to an SD card (only 2G supported at the moment - not SDHC) - Yes, if you use a Z80 with external RAM and the SD card the full CP/M is available (two serial ports or one serial, keyboard and video)

The keyboard and monitor interface I wrote entirely myself - also supports the keyboard LEDs, the display is 80x25 characters, using the PC CGA font with a BUILT-IN ANSI INTERPRETER so you can send standard ANSI escape sequences to control the cursor. Scrolling and text display is blisteringly fast - all done within the FPGA so no CPU RAM needed except for a couple of bytes. The monitor/keyboard is a 6850 ACIA emulation, so directly replaces a serial port with a TV/keyboard display ( :) ) and will work with any code that normally expects to write to a serial port (6850 compatible).

I provide the ROM BASIC to run on all of them. YOU decide what you want, follow my step-by-step instructions to build up the VHDL then you program the FPGA and use it :)

Just "plug in the code" that you need.

I will be providing skeleton "bare breadboard" VHDL, plus every piece of code you need to add each component.

The concept is as shown on this diagram, which is an example of a computer with internal RAM and a serial port for I/O...
6502.org wrote:
As you can see with my diagram, I am taking spending a lot of time on this to make it as painless as possible, and hopefully fully open up the option of making your own FPGA-based computer to beginners and experts alike.

It works, just need to complete the page. Give me a week (hopefully sooner) and it should all be online.

All the best.

Grant
http://searle.hostei.com/grant/
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by BigEd »

Exciting! Well done, and thanks!
User avatar
BigDumbDinosaur
Posts: 9427
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by BigDumbDinosaur »

Looks real good. How fast does this thing go in real time, meaning 6502 instructions per second?

Have you ever thought about implementing a DMA controller in a CPLD or FPGA, one that is 65xx bus-compatible? :D I'd be your first customer.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
jonb
Posts: 104
Joined: 08 May 2011

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by jonb »

Hi Grant

What a great idea! I'm interested in these programmable devices but didn't know where best to start learning.. well, thanks to you, I do now. I was going to have a go at the UK101 FPGA implementation, but now I think I'll try something else.

Do you think it is possible to emulate a SID and graphics chip (so as to emulate a typical 80's micro), or is it short on cells to do this on one board, given that we need an external SRAM to go above 4K? What if one were to use a board with more capacity?

Hmm... you could build a micro emulation with the best of all, in one device. Shall I make a shopping list? :D
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by GARTHWILSON »

jonb wrote:
Do you think it is possible to emulate a SID and graphics chip (so as to emulate a typical 80's micro), or is it short on cells to do this on one board, given that we need an external SRAM to go above 4K? What if one were to use a board with more capacity?
It's not all in the same device, but you might be interested in SID emulators, on Atmega and on a 32-bit ARM Cortex:
http://roboterclub-freiburg.de/atmega_s ... gaSID.html
http://www.swinkels.tvtom.pl/swinsid/
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
zx80nut
Posts: 65
Joined: 04 Jan 2012

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by zx80nut »

With a 6502, serial port, internal ROM then less than about 50% of resources are used, even on such a small chip as this.

I have actually managed to get TWO 6502s running, sharing the same BASIC ROM (made it dual port) and individual RAMs (2K each) with their own serial port, both running at 25MHz (yep) simultaneously, all on this tiny board.

I was able to open two terminal sessions on the PC, connected to the separate serial ports and could run completely independent programs simultaneously on them at the full 25MHz processor speed.

I am now using a PLL to increase the master clock from 50MHz to 60MHz (makes it better timing for the 80 char display) so I assume I can run two 6502 cores at 30MHz each simultaneously.

So, providing you don't plug too many VHDL components into the breadboard then you may well have space for a sound generator chip. Once I have published, if anyone has any components they have made that will fit in, please let me know.

I've also done input ports, output ports, multiplexed 7-seg displays that will easily interface to the 6502/09/Z80 code (PEEK's, POKE's, IN's or OUT's in BASIC). Also, the SD controller is easy to control - in BASIC POKE the sector number, POKE the write command, POKE 512 bytes to the same location to write a sector, or POKE the sector number, POKE the read command, and PEEK 512 bytes to read a sector.

Regarding the timing question - the 6502 will run at 30MHz using internal RAM. The T65 core is quite accurate with timing, so that really is 30x as fast as a real 1MHz 6502 processor. Using external SRAM, you are limited to the SRAM speed, but I have got 16MHz with no problem. Using FAST SRAM (I used old CACHE RAM from a 486 motherboard - 7nS access speed) I can achieve 25MHz 6502 (didn't try 30MHz at the time).

Thought I'd give advanced notice, as the boards take a few weeks to arrive from China, if that's where you decide to buy them from, so if I have given you an interest, then everything should have been online for a while before yours arrives. I have been so impressed by these little boards that I have several.

One more thing...
I am using a common connection for ALL of the computers, so you can simple upload a new configuration if you want to use a Z80 or whatever. This is also exactly the same pinout as I used on the UK101 so again, you can swap between my other published design or these ones with no changes needed to the board whatsoever.

The amount of components you can add depends on the board, so you can't have two TV displays running at the same time due to lack of RAM resource (or can you... hmmm... maybe, if you share the character ROM!) but you could on a larger board. Anyway, can't see much point in that anyway, but you never know.

The display is currently 80x25 monochrome, but I can also get 40x25 COLOUR using the same resources (using ANSI codes to control the foreground and background so that the colour is CP/M compatible etc.) - but that's an upgrade to be published later ;)

I will also provide ONE ready-made example code so that you can follow if you have got stuck/lost and to make sure your connections are fine, but the idea is that I don't do too much so that this can be used as a GENTLE learning experience into the world of FPGAs.

Regards.

Grant
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by BigEd »

For those who want to dig deeper, these boards use an Altera Cyclone II EP2C5 part, which has 26 RAM blocks, each being dual-port 512x9 bits (or related 4k organisations.) I imagine Grant is using these for code ROM and character ROM as well as RAM.

The parts have 4,600 LEs and more 18x18 multipliers than you're likely to need. Even if you use them for audio filtering. For notes on 5V interfacing, see http://www.altera.co.uk/literature/hb/c ... c51011.pdf
zx80nut
Posts: 65
Joined: 04 Jan 2012

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by zx80nut »

Thanks Ed.

That Altera 5V interface document you linked to in particular is very useful to me.

Regards.

Grant
Tor
Posts: 597
Joined: 10 Apr 2011
Location: Norway/Japan

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by Tor »

BigEd wrote:
For those who want to dig deeper, these boards
You'll notice that the search comes up with 0 results for EP2C5T144C8N, so the results shown are for just EP2C5T144. I noticed that when I tried to search for these boards after Grant's original post. I assume though that these are the boards we should be looking for (although I'll dig out a larger board I bought quite some time ago and never put to use - maybe it could be used as well).

-Tor
zx80nut
Posts: 65
Joined: 04 Jan 2012

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by zx80nut »

Grrr... supply and demand - I see the greedy eBayers are PUTTING UP THEIR PRICES !!!

You can still get them from some at a reasonable price - some are silly prices.

If you google EP2C5T144 (thanks Tor!) or CYCLONE II MINI BOARD then I see they are also available from other suppliers, including Amazon resellers etc.
User avatar
cbscpe
Posts: 491
Joined: 13 Oct 2013
Location: Switzerland
Contact:

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by cbscpe »

What is a reasonable price? You find a lot at Chinaman when doing a search for EP2C5T144, starting at approx. 20USD incl. free shipping. Although shipping times are often 20 to 30 days. But as long as you are not in a hurry.
zx80nut
Posts: 65
Joined: 04 Jan 2012

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by zx80nut »

Reasonable prices that I can see are $30 including the programmer and about $21 without.

So, they are still available without paying too much - phew!

There are a few different sellers selling them for under $25 or $30 for the board.

A UK supplier had raised the price to £59 for the board and programmer, but back down to £35 which is higher than it used to be, but better.

The seller that I had previously paid £12 including post is now charging £59 !!
There are also other sellers charging more than they used to as well. Hope they drop back down again, but the one at $21 seems a good price at the moment.

Grant
User avatar
cbscpe
Posts: 491
Joined: 13 Oct 2013
Location: Switzerland
Contact:

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by cbscpe »

Ok, so you need a programmer. I assume a USB Blaster is ok? Sorry for asking these questions, but I have absolutely no experience regarding FPGA but it is a subject I'm very curious about.
zx80nut
Posts: 65
Joined: 04 Jan 2012

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by zx80nut »

Hi cbscpe

Yes, that's right - a "USB Blaster" is perfect. It can program the FPGA using JTAG (when trying out using the FPGA volatile memory) or Active Serial (to program the configuration chip ("flash eprom") ) for the setup to remain.

The pinout seems standard so could be used for other boards as well, so not just for this one.

On eBay, if you search for Altera USB Blaster you'll find several for about $10 to $12.
I'm sure they are not official "Altera" ones, but work well.

Starting off, you may want to get a board and programmer together, but don't have to.

The Quartus II software is free of charge from the Altera website, but if you do go for this or any other Cyclone II board you need version 13.0 SP1 because the very latest version (13.1) no longer has support for Cyclone IIs. Several versions are available on the site, so I can't see them stopping support for quite some time.

Regards.

Grant
zx80nut
Posts: 65
Joined: 04 Jan 2012

Re: Advanced notice: build your own "pick and mix" FPGA comp

Post by zx80nut »

While I'm at it, I also have an extra "component" for the FPGA breadboard...
6502.org wrote:
Image no longer available: http://searle.hostei.com/grant/misc/colourFPGA.jpg
40x25 colour text display

Standard ANSI codes will control the color, as they already do for cursor positioning.
The ANSI sequence in the screenshot is NOT correct yet, but enough for my testing. I will complete it using the correct sequence before releasing.

Will work, as for the other components, with ANY processor (6502, 6809, Z80) - will be up to you whether to have serial, monochrome 80x25 or colour 40x25.

:)

Online as soon as I can....

Regards.


Grant
Post Reply