FPGA platform recommendation for a synthesizer
Tobia wrote 07/04/2021 at 18:06 • 0 pointsI'm thinking of building a small synthesizer (MIDI in, audio out) where all the MIDI decoding and the DSP would be done in an FPGA, in order to get consistent performance and low latency. But I'd like to have a GUI on a small screen, one of those 3.5" TFT screens with resistive touch, and I'm afraid programming a GUI on an FPGA would be incredibly hard (how would you even do fonts? pixel by pixel?)
So I was thinking of having a regular processor to the side, one where I can use some pre-made graphics libraries. What platform should I go for? Are there any combo mcu + FPGA boards that are cheap and easy to program? I'm talking $35 kind of cheap, like the Waveshare CoreEP4CE6 board.
Any recommendations or pointers to previous projects would be great.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I'm currently doing a design based on the ICE40HX8K-BG121. Lattice's 0.8mm 121 ball BGA package is pretty easy to work with and I have about 100 IO's. If you want a step up from 8k LUT4's to 35k LUT6's, you can jump to the BGA-256 Artix 35 for about $30. If you could use the memory, the ICE40UP5K-SG48 has 1mb of memory and a QFN48 package that's a little easier than BGA. How many LUT's do you need for a single channel to generate the PWM/PCM/PDM signal? Also are you using a single 10nF ceramic cap on the IO's to synthesize?
Are you sure? yes | no
Hi. Thank you for the pointers. But I should have mentioned that I'm an absolute newbie to FPGA design. Also there's no way I can solder BGA in my home setup, and with all the passives and regulators and stuff around an FPGA chip, there is a lot that can go wrong. Therefore I'll stay within the bounds of ready-made dev boards.
I have yet to begin, therefore I still don't know how many LUTs I will need.
So far I've read up quite a bit and I have decided for the following:
- Bluespec HDL, classic version (Haskell-like) because life is too short to be writing (and debugging) Verilog
- Altera / Intel FPGA, because their IDE runs on Linux and is somewhat user-friendly (Xilinx gives off way too much of an elitist vibe)
- At first I'll try to do everything in hardware, including the graphics primitives for the display, because this will allow me to use the display as a real-time oscilloscope / FFT, which is a functionality I'd like to have.
If that proves too difficult, or if I run out of LUT space hard, my next best option is to add a $10 Pi Zero W and do all the GUI using whatever programming language and library I find most appropriate.
Actually, another option would be to program the GUI and all the application logic on the Pi, but pass the display serial interface through the FPGA in a pass-through mode, so that I can "hijack" it when I want to use the display as a scope.
- As for audio, I will try to use some of the FPGA-based techniques. So far I like @zipcpu's "bit-reversed counter PDM" technique the most. Do you know if there are standard values for the audio-range RC filter? You were talking about a 10nF cap. Anyways, if that proves too dodgy, I might look into a discrete DAC chip.
Wish me luck...
Are you sure? yes | no
Well, BGA's are surprisingly pretty simple. Do you have an easy-bake oven or hot plate around? That's all you need lol. I use the $50 "electronic soldering hot plate" from eBay that have aluminum square heating blocks. I apply solder paste with a razor to the board, then I place parts with tweezers, BGA's align with the silkscreen and positioning doesn't need to be perfect since surface tension takes care of a majority of the positioning within 0.5mm, then I place it on the hot plate, raise to 250C, turn off and remove board. Very reliable and fun workflow even with BGA's. I rarely use my iron and I plan on never using through-hole parts, aside from connectors, in my lifetime because of how great SMT technology has become..
In terms of ideal values for the RC filter, I'll be honest. The right thing to do is a SPICE simulation, but, I'm too lazy. Luckily though, since you have digital synthesis, you can apply a digitally designed digital filter which adjusts the input/output transfer function to tune your output to unity gain across the frequency spectrum right at the output of your speakers. So you can even knock off the non-linear gain of your speakers. Take your microphone and sweep the frequencies with some PCM/PDM signal and measure with a microphone in the room. The inverse of that transfer function can actually be designed by a digital filter in some audiophile related software directly in some HDL/VHDL (I personally use Symbiflow and the Icestorm tools like aranche-pnr since they are open and it's not for a class so I don't have to use ugly-GUI Vivado. The digital filter can also be synthesized in matlab with its xilinx tools. If you pay for your software *scoff*.
If you're interested, you could synthesize MHz level PCM/PDM signals and these can be directly amplified and filtered instead of filtered and amplified to produce a compact, high efficiency audio amplifier! Specifically, if this is done with GaN instead of silicon transistors, you can achieve the MHz level switching in a tiny, lower power dissipation package because of GaN's faster switching. We could collaborate on a power amplifier on GaN if you're interested. I could design a pmod connector plugin that can directly drive your speakers and doesn't need any heatsinks. It could power a 1kw blaster and cost $20 and be smaller than your thumb and still not need heatsinks.
Are you sure? yes | no
Re: amplifier
That's cool. But I only need line output, so I think a filtered FPGA pin should be enough. Yes, I intend to use MHz PDM and a RC filter.
Are you sure? yes | no
Well in your case a Fomu board should work great. https://www.adafruit.com/product/4332 Fits INSIDE of your USB slot. In terms of what RC filter to use, you kind of need to know what line load you're gonna need to drive. Will there be a lot of inductance from that line through a long cable? Or will they be short. If you can limit the scope of the application, calculate your RC filter from a high value resistor like 10k to 100k ohms. If you want something rugged despite drawing more power, use something like a 100 ohm to 1kohm resistor derived RC filter. Again, it doesn't matter what frequency you put it at. You get a passive response, so anything around 15kHz to 20kHz can be the cutoff frequency, and then you can filter away the non-linearity with a digitally designed filter. If I recall correctly from my digital filter design lab, it only cost about 200 LUT6's to synthesize a 10 stage digital filter with very sharp bandpassing. If you want an incredibly smooth near unity output response from the inverse filter, I'd say it would take thousands of LUT4's to generate the perfect digital filter, but that's an exceptional case. Either way, a FOMU with the Lattice Ice40UP5k FPGA has enough power to have a lot of interesting fun with.
But, I'd say use a 100kHz carrier frequency since all that switching will cause a lot of power dissipation. The FPGA is not based on GaN after all! So, I'd say design the RC filter to stop at 15k-20k, then design the digital filter to correct for non-linearities, and have the carrier be 100KHz which is enough not to be sent through speakers.
Are you sure? yes | no
If open toolchains are important, I would go with a Lattice ECP5. There's probably one that's big enough for your synth, and they're basically cheap. The various RAMs, distributed and block, are all supported, as are the fast multipliers. AFAIK, some of the chip's fancy DSP functions are still to be worked out, though, so if you need them, you might look elsewhere. (My guess is that you won't. Audio is "slow" for FPGAs.)
I like your strategy of an external chip for the UI, mostly because you can crib existing UI code, and especially if you have used something before. You could go with a bigger FPGA and a soft core, but you'd want to be sure that the UI would be there for you.
Are you sure? yes | no
Yes, I will only need to use the various RAM and multipliers.
By the way, do you know if the open-source synthesis tools for Lattice FPGA are noticeably faster than, say, Altera / Intel tools for Linux?
I'm thinking that a $10 Pi Zero W would make my life incredibly easier as far as programming the UI is concerned. I could write the UI in any programming language and library I want. Also I could SSH into the Pi via WiFi to debug or update the system.
On the other hand, doing everything in the FPGA, including the display logic, would mean being able to use the display as a real-time oscilloscope / FFT, which would be very useful for my purpose.
In fact, I might be able to do both. (See my answer to @Sina Roughani above)
Are you sure? yes | no
Although above your pricepoint (and truthfully probably overkill) a Xilinx Zynq on some devboard might still be an option. An FPGA with an onboard CPU, linux capable but standalone (FreeRTOS) possible just as well. It is quite steep to learn but there is a lot of examples to find as well. Altera probably has similar offerings. A shortlist I found: https://www.joelw.id.au/FPGA/CheapFPGADevelopmentBoards
Although cheaper options are available, as a learning platform I'd suggest something many other people have used.
Are you sure? yes | no
literally just plugging my own project, but I recently designed a simple board with an atmega328pb and a lattice lmcxo2-2000hc-5tg100i: https://hackaday.io/project/180005-a-digital-real-time-clock, github link to the board: https://github.com/ZakSN/z_1_rtc_pcb/tree/2000hc-version. Its definitely not the cleverest way to do things, but you can maybe use it as a starting point (or as an example of what not to do...)
Are you sure? yes | no
Altera (now intel) and Xilinx both have synthesizable processors and the IP blocks to implement a complete processor inside the FPGA. This would let you do your display and user interface in software, while implementing the synthesizer in logic. The boards that I used for the custom processor implementation that I did were from Digilent and were around $100 US with Xilinx FPGAs.
Are you sure? yes | no
A similar idea to @Bharbour came to mind for me. My affection for CPLD meant that I imagined a CPLD in coordination with a commodity CPU, using the CPU both for UI elements as well as advanced synthesizer functions. Of course, the market has proven that FPGA-based synthesizers are viable. FPGAs have also progressed to the point that you'd have fairly limitless flexibility in addition to your pick of platforms and toolsets (check @Elliot Williams' post). Don't be afraid to jump in and find yourself with a few extra dev boards as you determine what mix of features works for your design goals.
I've linked below to what I would consider a more minimal version of what you're attempting(?). Good luck!
https://thetinysynth.wordpress.com/technical-details/
Are you sure? yes | no
Wow, that is super helpful! Thank you!
Are you sure? yes | no