FPGA Spectrum Project

For experts to discuss very technical stuff and newbies to ask why the Spectrum they bought off ebay doesn't work.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

FPGA Spectrum Project

Post by zxmicrojack »

Moved by PJ

Hi all,

Wondered if this was the right place, but during lockdown in the UK, I thought I would have a try at FPGA programming which is something I've always wanted to have a go at - saw all the projects around, so thought, I can make some simple and cheap hardware based on a cheaper FPGA eval board, and then try to use some of the MiSTer sources available. The board I brought up, was all fine, but the existing codebases wouldn't work for me as I had based the whole idea on a single SDRAM device, and a single SD card for BIOS.

I've ended up re-engineering a ZX-Spectrum 48/128 with Multiface 1 / 128, and with Opus Discovery single disk drive, and a menu system to load tapes and disks from SDcard. Also I've patched loaders to give us turbo (4x loading tape speed) and recently almost instant loading by patching the ROM and adding a direct read IO port. This has been tremendous fun, and I intend to continue improving ZX spectrum or maybe moving to other old devices, maybe BBC etc.

The thing is then, I've based my hardware on a sub 35 GBP board and a simple home made hardware daughter board I made for less than 10 GBP, and it mostly works - I have a few issues, not every game works yet, some oddities, some bugs etc, but then I thought maybe someone else could get a kick out of it, maybe if I clean up and share the hardware design, verilog source, and bootstrap source code then others could make their own device, run either my microcode or make their own and share it. Maybe we could make between us a cheap board, case, or other developments.

What do people think? Would someone be interested in sharing my project, perhaps developing it further in the spirit of open source/hardware?

Cheers,
M.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: FPGA Spectrum Project

Post by azesmbog »

Lay out the sources, why pull the cat by the tail.
If anyone is interested, they will compile and try.
But better than MiSTer, or cheaper than Uno - no longer do. The "Next" one is a separate song, for which I will not say anything.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

Trying to gauge if it's worth the effort of documenting and sharing properly - something I will not gain anything from. Pulling the cat by the tail, not even sure what that means. But thanks for your reply.
User avatar
ketmar
Manic Miner
Posts: 696
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: FPGA Spectrum Project

Post by ketmar »

zxmicrojack wrote: Wed Aug 05, 2020 4:51 pm Pulling the cat by the tail, not even sure what that means.
google translate. ;-) that first line roughly means "oh, just publish the sources as they are, why not?"

[mention]azesmbog[/mention] try to avoid proverbs and such, it's usually hard to properly translate 'em. ;-)
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: FPGA Spectrum Project

Post by azesmbog »

This is an idiom about a cat :)
Something like - Don't keep me in suspense!
If your project is for Altera or Xilinx - then you can lay out without documentation, as it is, if under Latice - then it would be necessary with a description :)
And of course, how to boot from an SD card.
If it's not too confused and tricky, then what problems can you repeat on other devboards? A lot of them.
And I wonder what you expect to get :) Besides the fun.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

I must admit I'm not familiar with that one. Problem is I've been a software engineer for 23 years, what I consider good to share is definitely not what I have at the moment. Documentation, I wouldn't dream of sharing stuff without. But I see your point. I'll do a bit of clean up then start to share. I'll share some photos and stuff in due course, thanks!
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: FPGA Spectrum Project

Post by azesmbog »

zxmicrojack wrote: Wed Aug 05, 2020 6:36 pm Problem is I've been a software engineer for 23 years
The problem is that I'm not a programmer at all, ketmar won't let you lie,
but I will distinguish VHDL from Verilog, but I don't like modules on SystemVerilog, it's hard for me to translate them back to Verilog :)
Let's wait.
User avatar
ketmar
Manic Miner
Posts: 696
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: FPGA Spectrum Project

Post by ketmar »

azesmbog wrote: Wed Aug 05, 2020 7:29 pm ketmar won't let you lie,
i.e. "ketmar knows that". all hail automatic translators! ;-)

(as written, it means "ketmar won't let zxmicrojack to lie". this is definitely not what expected. ;-)
akeley
Dynamite Dan
Posts: 1041
Joined: Sat Feb 01, 2020 5:47 pm

Re: FPGA Spectrum Project

Post by akeley »

[mention]zxmicrojack[/mention] what you did sounds very interesting and impressive, skills wise.

But to be honest, I'd much rather see talented FPGA devs join forces and concentrate on one platform. At the moment this already very niche retro zone is quite fragmented - there are many different boards and projects (MiST, MiSTEer, Sidica, ZX Uno/ZXDoS/ ZX ???, some others I don't rememebr names of.) Sure, lots of the code is shared but there are also a lot of unfinished cores.

MiSTer is the second priciest of the aforementioned FPGAs but also has the biggest potential and community. Why not jump on its repos and try to contribute there? The microcomputer cores are pretty good already but could still benefit from and attention of a skilled dev.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

[mention]ketmar[/mention] I understood perfectly what [mention]azesmbog[/mention] meant - even the pulling of the cats tail I should have guessed at. Maybe western hemisphere arrogance or stupidity in me. I see your work already in the community and it makes me even more nervous about sharing. Though you will be happy to know other than the code I borrowed, it's almost entirely in verilog. Only started verilog in March, and it shows - some of the earlier code is quite terrible.
User avatar
ketmar
Manic Miner
Posts: 696
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: FPGA Spectrum Project

Post by ketmar »

eh. "release often, release early!" ;-)

just dump it as it is. everybody had to start somewhere, and we aren't here to make fun of your first attemps. in the worst case you'll get no feedback, which doesn't change the situation much from the current one, i guess. ;-) and in the best case you'll get some valuable hints and maybe some help. it is understandable that you're still learning, and i guess nobody expects the perfectly written and documented code from the beginner. ;-)

tl;dr: if the only thing that worries you is bad code quality, then go on, share the code! there is nothing to be ashamed of.

p.s.: i'm not trying to push you, of course. it is up to you to decide anyway, and whatever you decide will not be wrong.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

https://photos.app.goo.gl/UJf4Aw2q3bGpkF1K6

Some photos of the board - I'm using delta-sigma audio dacs, one single flash device for file system / roms, and one single SDRAM, which already comes on the Altera Cyclone IV eval board. Result is a very simple daughter board. VGA is done by simple resistor DAC, and of course PS2 keyboard. I wanted to have something that a complete novice could throw together. The ZX Spectrum core is nearing it's MVP (48k, 128k, turbo, hyper loading, opus discovery disk, multiface). SDcard has to be <= 2GB for now. File system is simple and proprietary for now. ROMs stored on same device as games / disks.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

Thankyou, [mention]ketmar[/mention]. I've decided on the strength of these conversations to do a full disclosure. I'll share on gitlab in the next few days. Also I'm creating a electronic form of the schematic - currently it's scribbled on a few sheets of A4 with a few coffee stains on. I had not expected to get anywhere with it - it was just a handy distraction from the lockdown, the empty shelves, the empty streets and the empty schools. The trajectory it took is a equal and opposite reaction to the way I was feeling at the time. Now it's just fun, and to share it will be even better.

Watch this space :)
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

I'm working and making good progress on the cleanup. Of course, some horrid things will remain.

Circuit diagram here: hope it is allowed: https://drive.google.com/file/d/1QMU1GS ... sp=sharing.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

And as promised, I'm sharing the source here. I've borrowed bits from other projects from people kind enough to share.

https://gitlab.com/zxmicrojack/fpga-spec

All comments are welcome - try to keep it constructive. All modifications are allowed, but please contribute back to me if you find a bug. If you want to build the hardware yourself, then drop me a line I'll include more step by step info. Really, this board can be put together by people of limited soldering ability, and no fancy equipment other than a soldering iron, a craft knife and a glue gun.

Enjoy, and please get in touch. Also I've added a couple of extra photos showing the new menu screens. Nothing major, just made a bit more neat, and added a spectrum style rainbow in the corner.
User avatar
ketmar
Manic Miner
Posts: 696
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: FPGA Spectrum Project

Post by ketmar »

by the way, could you recommend some free textbooks for those who knows almost nothing about fpgas? or, let me be more specific: i can program in asm for various architectures, so i know what bits, registers and such are, and have some rough understanding of how CPUs are working on a lower level. what should i read to proceed to design my own fpga devices? ;-)
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

Not sure if I can recommend. My degree was in computer systems engineering, 26 years ago - a mix of electronics and software, so lots of digital electronics and software, and I wrote some tiny amount of VHDL, but dreamed of picking this up in my career. This never happened due to lack of demand in this area at the time, so I went pure software, but with a good understanding of electronics, the hardware guys passed me schematics so I could write bring up code initially, moving onto bigger projects later on. I programmed embedded in many languages with 6-7 different assembly languages ranging from 32 bit down to 8 bit, and recently moved to Java web services 5 years ago. This is my attempt to fill the gap that was never filled in my career.

So, I'm not sure how much of my limited knowledge of HDLs is by osmosis and how much by self teaching. As a first jump - I read this free ebook:
https://www.amiq.com/consulting/misc/fr ... _ebook.pdf

After that I just tried and failed to do simple things for 2-3 months until I got the "hang" of it. Trial and error, but mostly error I would say is your greatest training tool for any thing. However, I'm more than happy to share what I've learned, please just DM, or even build my board, build my code and mess about with it. It's based on this board:

https://www.ebay.co.uk/itm/ALTERA-Cyclo ... SwpBdd5s3s

And if you are able to hold a soldering iron, the daughter board is simplicity itself. As for verilog, things started to go much better for me when I stopped thinking about this as a sequential program, and thought about it as an expression of the digital hardware. In summary, still very much a beginner, but happy to share.
User avatar
ketmar
Manic Miner
Posts: 696
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: FPGA Spectrum Project

Post by ketmar »

thank you alot! i know how hard it may be to give a proper list of things to start with when you collected various random knowledge over the years. ;-) i did various embedded programming too, but never touched the hardware side. i know some theory, and know which side of soldering iron is hot, but that's basically it. but i'm not scared to learn new things. ;-)

so thank you for the book! i'll prolly start (slowly) reading it, and we'll see how it will go from here.
User avatar
cmal
Manic Miner
Posts: 629
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: FPGA Spectrum Project

Post by cmal »

Very interesting project, although I know almost nothing about hardware and especially fpga. Thanks for posting. I've downloaded the book and will dig into it.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: FPGA Spectrum Project

Post by azesmbog »

zxmicrojack wrote: Thu Aug 13, 2020 9:54 pm
https://gitlab.com/zxmicrojack/fpga-spec

All comments are welcome - try to keep it constructive.
I would like to be constructive, but I don't see the project itself ??
Does he already exist or will he only someday ??

Well, about the scheme, constructively)
The keyboard, of course, will work in this version, but it will still be correct to install protective diodes.
Desirable.
but this is a personal matter for everyone.
FPGA inputs are not very tolerant to 5 volts.
Image
Last edited by azesmbog on Fri Aug 14, 2020 9:39 am, edited 1 time in total.
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

Thats great information, thanks. As for the repo - I thought I had made it public - Now fixed :)
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: FPGA Spectrum Project

Post by azesmbog »

and what, ready-made hex files can not be laid out ??
Sources are great, but not all Linux systems, and of course you can run the Makefile under Windows, but it's very, very difficult :)
zxmicrojack
Drutt
Posts: 36
Joined: Tue Aug 04, 2020 7:29 pm

Re: FPGA Spectrum Project

Post by zxmicrojack »

I wouldn't expect anyone to want to view the hex files at all, but yes I can format them more neatly, just I had some initial difficulties importing srecords into verilog compiler, and this kind of worked, so I left it. Until speaking to yourself and [mention]ketmar[/mention], I had not imagined I would share quite so quickly, so yes there is probably more cleanup work needed. This had fallen into a - it works, so no need to fix it yet - tech debt :)

Thanks for the comments so far.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: FPGA Spectrum Project

Post by azesmbog »

zxmicrojack wrote: Fri Aug 14, 2020 10:17 am I wouldn't expect anyone to want to view the hex files at all
i only need 2 files:
hyperloader.hex & bios.hex
to check if the assembly is correct
Spoiler
Image
Legendary DE1 !!!
Image
Is this the menu ??
I compiled in a completely different assembly language. There are too many differences with yours, perhaps I was mistaken somewhere and did not overlook :(
And of course, you need an archive of files that must be written to the SD card
Last edited by azesmbog on Fri Aug 14, 2020 8:16 pm, edited 2 times in total.
User avatar
DouglasReynholm
Manic Miner
Posts: 349
Joined: Wed Feb 20, 2019 8:38 pm

Re: FPGA Spectrum Project

Post by DouglasReynholm »

Older members of this site will know I've gone on about this before, so I hope they can forgive me for mentioning it one last time..

But I find it so bloody frustrating that I worked for Altera for 7 years, and tried to get the retro computing/gaming sceners interested in FPGA for so long, only to be met with blank stares..

"What's an FPGA!?"..

Now I'm well out of touch with the technology (worked for a couple other FPGA manufacturers, finally left the electronic industry behind in 2011 completely) and everyone has finally embraced the tech. And I can't really help like I could have back then.

I still have some 'insider' insight if anyone newer to the tech needs any clarity on anything (feel free to ask/pm) but I'm disappointed that I could have been much more useful to the community had things taken off a bit earlier - dev kits, tools, advice etc, all of which I had in my power to give away!

There, I've finally said it. Ghost can be laid to rest.

(Altera are now Intel FPGA, and I suspect due to Intel struggling with node tech, are now suffering)

Edit: just seen post above. Had 10 DE1's to give away at one point, no questions asked!
Post Reply