Sunday, January 19, 2025

FPGA's 2025 Part II: Lattice/iCEcube2

Hello again, continuing on my quasi-annual attempt to get started with low cost Field Programmable Gate Arrays, or FPGA's. 

How will I do in 2025?

Last post I installed a Windows toolchain for Altera/Quartus; I read that offerings from Lattice Semiconductor are a bit more DIY/hobbyist friendly. Let's find out.

Nandland Go Board, sporting a Lattice FPGA chip


WHICH LATTICE-BASED DEVELOPMENT BOARD?

I already owned a couple of Lattice FPGA based boards: "TinyFPGA BX's",  hardware and their open source toolchain are covered in this previous post.

As far as I could tell BX boards were no longer not being manufactured, also, I guessed that Lattice's software might be easier to get going vs. open source, the latter being a bit tricky. 

After research: fingers pointed to Nandland Go Board as an affordable way to get started with Lattice FPGA's.....bought one!



TOOLCHAIN

The lower-end (read: less expensive) Lattice FPGA chips are programmed or "designed" using Lattice's iCEcube2 software. 

An Aside: Lattice almost removed itself from the DIY/student/hobbyist FPGA world forever (smart move? How much money do we spend on this stuff compared to these guys?) by raising license fees for IceCube2 from free to more than $470USB. 

Fortunately Lattice changed its mind, and iCEcube2 is available again using the five finger discount; we are back in business.

I followed the webpage here to get the toolchain going. Conclusion: Nandland's one-stop online resources (tutorials, purchasing, videos, more) made things much easier than figuring out how to set up Quartus Prime and Altera. Their "getting started" video and webpage (here and here) were invaluable; I went from nothing to blink in about 2 hours.

How I got iCEcube2 for free:

I had to create an account on the Lattice Semi page: here.

Then I emailed the Lattice Licensing dudes (lic_admn@latticesemi.com) with the subject "New iCEcube2 License Request" from my audiodiwhy email. I sent the email on Saturday. 

I was a bit surprised that the following Monday, yes indeed, I got an email from Lattice Semi that had a serial number in it. 

With that, I went back to Lattice's website (the page here) to turn the serial number into a license (*.dat file). Lattice emailed the .dat file to me, I saved that on my Window 11 system's hard drive, then used it complete the installation of iCEcube2.

NOW--A WORD FROM OUR SPONSOR

I haven't crafted any audio projects yet using an FPGA, but when I do, I will run, not walk, to PCBWAY to get the boards--might be 4 layer?  They have been instrumental in helping get my projects working and they will take great care of you as well. 

If you need injection molding, 3D printing, assembly, and a lot more hit 'em up: 

You can also help out this blog by checking them out here

Back to today's topic....

ICECUBES (2 of them) in YER TROUSERS

During the iCEcube2 installation I had to enter the MAC address of my windows system (start > run > cmd > ipconfig); everything else was straightforward.

iCEcube2 did not have a built in programmer. As per the Nandland tutorials, I had to install the Diamond Programmer Standalone (here).  Be sure to download the 50 odd MB Standalone programmer, not the 1GB+ Diamond software zip. You only need the former.

I downloaded and installed the Windows title:

You will need the "Diamond Programmer Standalone" to get your .bin files onto your FPGA board

I also downloaded the FTDI Windows driver for the Go Board, here. I installed the driver for Windows 11 using all defaults, a reboot wasn't necessary.

All in all--pretty easy.  

Next: a few screenshots that might prove helpful in 6 months when I forget all this.


When creating an iCEcube2 based design, the program will save your critical .bin file--the binary file needed to blow into the FPGA--to god-only-knows where. Wait, I know where! [project]\sbt\outputs\bitmap.  

The Diamond Programmer needs the changes in red above to work with the Go Board....



Then: "device properties" need to be set for the Go Board. Note--"Device: M25P10" did not match what is shown the Nandland blink project video, but the M25P10 setting worked.

Thankfully, you can save your programming configuration as an xcf file. That way you don't have to configure the standalone programmer every time you have a new project. 

Cool!


CODE

To test the toolchain I used the .v blink code from the Nanoland site.


module Switches_To_LEDs

(input i_Switch_1,

input i_Switch_2,

input i_Switch_3,

input i_Switch_4,

output o_LED_1,

output o_LED_2,

output o_LED_3,

output o_LED_4);

assign o_LED_1 = i_Switch_1;

assign o_LED_2 = i_Switch_2;

assign o_LED_3 = i_Switch_3;

assign o_LED_4 = i_Switch_4;

endmodule 

I uploaded it using the instructions from the "getting started" tutorial--here.  

It didn't work at first, but I ran through the steps a second time and viola:

BLINKORAMA!

I reached Newbie Nirvana: press SW1 through SW4, the damn thing blinked.

Boy Howdy!

What next? There are low-code/no code options, like Icestorm (here), and, maybe I can use AI so I don't have to learn Verilog. I also found an interesting video about using Logisim Evolution (previous LSE post is here) to generate code from schematics: click here.

But first I have to come up with a project for my nifty FPGA boards. 

Maybe some sort of all-FPGA Lunetta thingy?  

We will see. See ya next time!

No comments:

Post a Comment

FPGA's 2025 Part II: Lattice/iCEcube2

Hello again , continuing on my quasi-annual attempt  to get started with low cost Field Programmable Gate Arrays , or FPGA's.  How will ...