Hacker News new | ask | show | jobs
by analog31 2444 days ago
I recently got a TinyFPGA-BX, and have been slowly working through the tutorials. The amusing thing is that, for the actual applications I'm working on, a contemporary microcontroller can actually keep up just fine, and is easier for me to comprehend. Still, one of these days, a use will for an FPGA will crop up for which I'll be glad that I learned.
3 comments

I find this to be true for a lot of applications. Some times it seems like fpgas are hammers looking for a nail.

Where they can shine is if you need some odd combination of peripherals attached to a microcontroller: think of something like a uc with 4 uarts or multiple separate i2c buses.

Anywhere you need a lot of parallel processing that you can guarantee won't be interrupted, like a video processing pipeline is also a good fit.

I picked up a TinyFPGA BX to make a VU-meter with strips of neopixels for a Halloween project (keystep+volca keytar with lots of reactive lights). You can do this with microcontrollers but I wanted to stretch myself and see if I could get a crazy-responsive 7-band meter working. I'm like 95% of the way there after several months learning verilog, testbenches, how a few modules off github work, the I2C protocol, and how to use a logic analyzer -- but I'm stuck trying to get a ADS1115 to do one-shot conversions reliably and probably have to implement the VU-meter with an arduino to get it done for Halloween. It's absolutely thrilling to be working with nanosecond-scale operations and totally parallel design though.
Sounds like a fun project.

You might find this video helpful: https://www.youtube.com/watch?v=us2F8wAncw8

I think his design is very interesting, showing how to mix custom peripherals with picosoc so you can get very good response but also be able to program in C.

Interfacing with arbitrary hardware, for example random LCD devices with sometimes proprietary on the wire protocols. (Don't have a graphics chip for that screen? Make yourself a graphics chip for that screen!) Or Digital Signal Processing.
If you get a high-end microcontroller like a Cortex-M, you can normally just bit-bang the interfaces to devices that you don't have hardware for. DSP is similar - for a hobby project you're normally better off using a high-end device like a Cortex-A and doing the processing in software, rather than futzing with custom digital logic in an FPGA. If you're on a power budget (e.g. for a portable device) you could use a DSP chip like the C6000, but writing the software for it is pretty complicated if you haven't used one before.

If you're building a device that's going to be mass-produced and sold, then the situation is different and using FPGAs can make sense, because you'll amortize the engineering cost for the digital logic across all the units you sell. It can be worth it if it lets you use a cheaper processor or microcontroller.