Another year or so passed, and I've gotten a bit of free time sorting out again!
This round, after encountering the limits of the Spartan-6 chip I had, I thought I'd look again at the Spartan-7 platform and find out what has changed. (And a lot of changes in the STM32 line as well, but leaving that aside..)
Spartan-7 chips have come down in price! Dev boards have become available, at good prices! (you can roll your own board fairly easily these days, but FPGAs take a bit more support chips, and often require BGA soldering which is tricky for new folks!) Verilog and VHDL books are a litlte more available and cheaper! Old textbooks are coming on the 'used' market as well!
So, Spartan-7 is back on the menu, boys! (to borrow a quote from The Two Towers…)
Also of note - Spartan-7 is also an older architecture but much much newer than Spartan-6, and is supported on the newer and much nicer toolchain .. Xilinx Vivado! Vivado is another of those 'unreachable expensive' toolchains, but you can get it free for a specific subset of the chips. (Why do these hardware companies hit you for the software, when its only useful for their hardware? Give it away free, sell more hardware……)
So moving to Spartan-7 _now_ is certainly an option - they're about as cheap as the Spartan-6 were a couple years ago, the tools are far superior and supported!
And it gets better – what features do the Spartan-7s have over the -6? Glad you asked! Theres a tonne of new and slick stuff in there, but the one that jumps immediately out at me is the much higher internal block ram counts you can get, depending on the chip model. To wit, for the lower end models that free Vivado supports, are some with _a couple hundred KB of block ram_. If we're aiming for 320×200 8bpp we need 64KB per screen, and having a couple of those (for page flipping or sprite storage say), so we can easily use a couple hundred KB up. Fantastic! We can get a chip that costs $30 (still a lot, but at least affordable) that doesn't need external RAM to do what we need it to do. Still needs an external flash chip to load its configuration from, and still needs BGA soldering, but ehh.
Good enough to have some fun with!
The chip I went with not only has enough internal RAM to let me have a couple screen buffers, it has far more logic units to grunt what we need and then some. We could run a whole virtual CPU in the thing if we wanted to (and just like the STM32 we used for GPU before, it could run the entire sbc on it without anything else. But thats not the point.. we want 6502, z80, 6809, 68000 or other fun old CPUs to drive the whole thing!) So we could run the whole console/computer on the FPGA without a problem, thats not why wer're here.. we're here to be stupid, learn things, have fun, be stupid!
So with this Spartan-7 much nicer toolchain and hardware, I was able to figure out some basic HDMI 640×80 video modes; some helpful websites online suggest we could probably even manage to drive higher resolutions, but I'm totally happy with 640×480 for now. Given the size of ram and framebuffer we want to drive, 320×200 is plenty!
We can run a CPM machine or custom OS with rendering 8/16 bit style text or graphics and be very happy. Very happy indeed.
So, what are we doing here, now? What is the goal? One should always have goals…
Zikzak - the laptop, perhaps?
The zikzak rev3 sbc with a case was not a bad little piece of kit. But to keep propelling, it occurred to me a few years back that wouldn't it be fun to roll a whole laptop?
- designing a keyboard from scratch is hard but you know .. you can buy nice Cherry MX keyboard key switches for mechanical keyboards; its very easy to design a pcb to have a small mechanical keyboard on, and use knock-oiff Cherry switches if you like!
- designing an lcd panel? no, not going to try! But we can get a panel for cheap, and this is what I use for testing on my bench. The 5“ panel I have takes VGA or HDMI in…
- zikzak before did VGA; well, the new FPGA can drive HDMI now that I've coded that up, and it can drive VGA _at the same time_; no timing issues, it all runs in hardware!
- we already had everything else we needed - storage via cart or SD or serial or etc, processing, serial, even wifi via an ESP32 module
So the immediate goal is..
- design the 'video card' requirements and code up the Verilog to support that
- design a basic pcb for the FPGA as a test board; ie: a FPGA + flash chip, supporting caps, ISP / usb jtag programmer port, and breakout pins for the busses
- test the dev board and VGA/HDMI out
- given that, work on integration with zikzak .. a new 'sbc2' or rev4 board that is ez80 + fpga for video? built in HDMI and VGA ports so no shield is needed? or keep shield, to keep pricing down for manuf? we'll see..
- design keyboard pcb and find a cheap source of 100-200 Cherry MX switches or knockoffs..
- once all thats going, design a crappy physicl case to house it all, to make a ghetto laptop; or maybe go steampunk with a nice wood box with lions feet brass corners?
What requirements do I forsee for the video system on the FPGA?
Well, from zikzak earlier I had a number of video modes that were all useful and fun..
- pure text mode - for simple 'get up and go' software from the eZ80 side; maybe an 8×8 font for big readable characters 40 across, and a small font like 4-5 pixels wide so we can get 80 character wide display? Great for text adventures, coding, or running CP/M in, etc
- pure bitmap mode - slow to render from a slow cpu, but we could offer some special abilities in the FPGA, such as 'blit' for copying regions around or filling an area, etc; still, good for rendering nice picture scenes or slow but detailed updates or plotting
- hybrid tile + sprite mode - tilemaps for the background layer, with a foreground sprite layer? Allow the cpu to upload small tiles and sprites, and then be able to do very fast grpaphic operations by updating the tile map or sprite location table, without sending the graphics every frame. Your common gaming coding mode, for high speed but nice graphics! Also support basic effects like tile-offsets for scrolling backgrounds and such?
So lots of Verilog FPGA coding and testing to do, but all very fun things.
Project is slow moving at times, but very much alive.
Thanks for reading!