I am starting to look at using FPGAs/CPLDs as I am going through Learning the Art of Electronics. In the book they have briefly touched on verilog and use a CPLD programmed to be a counter.
I don’t plan to do any really extreme logic programming with it. I mostly want to create a few more complicated logic circuits (than I’ve made on the breadboard) and to be able to potentially jump back into it if I think I have a good application for it.
I do have a couple of questions that I’ll outline below.
What would be the best manufacturer to go with?
I would like the option to use CPLDs since it seems to me like they would be a better option for me since I’m not wanting to implement extremely complex stuff. The three companies that I found still make CPLDs are Altera (Intel), Microchip, and Lattice. Xilinx used to have CPLDs, but AMD announced they were phasing them out.
I am currently leaning towards Altera mostly because I got Quartus Prime Lite installed on my computer and have started playing around with it. I did think about Microchip because I have used some stuff from them before, but online people kept complaining about the software. I briefly looked at Lattice but left it because I never have heard of them before I started looking at this stuff (not really a good reason but whatever).
Do you think CPLDs are being pushed out? If you do why?
This is more of a comment than anything, but I have noticed most manufactures focus a lot more on their FPGA options and it seems like CPLDs are being phased out. I’ve only just started to look into this, but to me I think CPLDs would be more useful to me because I picture that it may be useful to implement logic functions on a chip and then integrate it into other parts of a circuit.
From what I have read FPGAs can accomplish what I want, but they would be overkill (almost non of the chip would be used for what I would want).
Would it be that people would rather write C code on a micro-controller for some simple ish logic than to implement it in hardware? Or is there something I’m missing?
At least in Xilinx, CPLDs are out. I’d avoid anything Xilinx that requires ISE as that has not been updated since 14.7 which was released in 2013, requires Windows 7 or running in a virtual machine. That means Spartan-6, all of their CPLD offerings are out for new designs. Cheapest Vivado part is most likely XC7S6 at about $20 in small quantity. It is a very capable part. I do a lot of work with their low end and midrange parts, they are impressive.
I’m not very familiar with Intel/Altera’s current offering.
Lattice is worth a look for smaller lower cost parts. Software seems to be a bit of a mess. I use their ICE40 FPGAs for things I would have used a CPLD for in the past and can’t justify an XC7S6. Configurations are small, can be put in a microcontroller’s flash, they configure over SPI. I use the open source workflow rather than the official tools.
There’s a lot overlap between small FPGAs and CPLDs. The ICE40LP384 I use a lot of is $2, a 32 pin QFN, few external components.
I used two iCE40 Ultras on the original Joulescope JS110.
The new low-cost ForgeFPGAs also look interesting. I have the dev board but have not played with it yet, so no recommendation.
Programmable logic is commonly used where you have tight timing deadlines or need to perform a lot of processing in parallel. Digital signal processing with lots of multiply-accumulate (MAC) operations are particularly well-suited for FPGAs.
The current Joulescope JS220 use a Lattice ECP5 FPGA. It is much bigger that the iCE40 but still cost-effective.
A totally different way to explore hardware acceleration is using the PIO on the Raspberry Pi Pico 2 with the RP2350. While the PIO state machines do not have all the flexibility of PLDs and FPGAs, they enable a lot of very fast hardware interactions.
At the moment, I definitely don’t intend to use programmable logic in the way most people do. I primarily want to create a few logic circuits and set up a toolchain to program PLDs.
So, it’s mostly experimentation out of curiosity. I find it pretty cool that you can create almost any logic circuit by programming FPGAs.
I still feel like I’m missing something, though, and I may find out what it is when I start experimenting. It seems to me that by programming a PLD, you can create a whole bunch of different devices that don’t necessarily have to be complex. Is it simply that it’s much easier to find an IC that can do what you want, or to program a microcontroller to do it, and that the work/cost needed to use a PLD doesn’t make sense until you need the speed?
It looks like I should definitely take a closer look at Lattice, since there seems to be a good open-source community around it that I didn’t find when I was Googling. Thanks for all the links!
You can always use discrete gates. When you start adding lots of discrete gates to the design, a CPLD is a good option, especially if the logic needs to be available at board power on / reset. FPGAs take a while to program, so they cannot control reset logic. Large boards often have complicated reset demands, and CPLDs have historically been used to help consolidate the logic. Modern ICs tend to be either easier of have dedicated power management ICs that result help reduce the need for this custom logic.
Microcontrollers also require time to power up and run, so they are not suitable for controlling reset. However, they are very capable of performing logic on the GPIO signals through software. While you will never get the same latency as hardware gates, many applications don’t care…