Author Topic: Programming ICE40 FPGA on a board?  (Read 7202 times)

0 Members and 1 Guest are viewing this topic.

Offline thor.lucasTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Programming ICE40 FPGA on a board?
« on: June 09, 2020, 09:03:01 pm »
Hi,

I've been playing around with FPGA lately. I'm trying to stay open source so I'm going with an ICE40 since open source synthesizers exist for this.

Sidenote: I think it's pretty BS to charge $3k for a synthesizer. Why not just add a couple bucks to the chip to offset this cost? I truly don't understand how any sort of hobbyist could possibly ever get into using Xilinx FPGAs. You either shell out $3k or use one of the like 3 options available on the free version of Vivado, all of which the devboards for are like $200. And then you're limited to those chips forever cause that's all the programmer will do. Or am I misunderstanding things?

Anyway, this seems good and all. But I was wondering how I would do this in more concrete projects. I don't want to buy a $50 tinyFPGA per every little project I do. For Atmel microcontrollers, I use the dev board to... develop, then I just use the ATTiny or ATMega chips in the final project and it's absolutely trivial to program those up, and it costs me less than $1 each.

So I was looking at TinyFPGA's github (https://github.com/tinyfpga/TinyFPGA-BX) and it seems you need a lattice FPGA programmer to do this. Makes, sense, but the link is dead. So I do some searching around for "lattice fpga programmer" and I found out that lattice makes something called "IceProg". So I check out their store, and I find this: https://www.latticestore.com/products/tabid/417/categoryid/4/productid/4612/searchid/1/searchvalue/iceprog/default.aspx

Great, a programmer, but again it's $500 and nonstock. Even if I was willing to shell out the money, it's not stocked so I couldn't get it anyway (or do they make it to order?)

So all in all it's looking pretty god damn impossible for any sort of hobbyist to get into FPGA. Sure I have a TinyFPGA and can program it up, but I can never use it in any real project because I'm not going to spend $50 per board just for the FPGA. It costs me literally 50ยข per atmel avr with the only initial investment being a $20 arduino that I can use as the ISP. Meanwhile to program an FPGA I'd need a $500 initial investment plus $4 per chip? It's really not looking great...

Now it's very possible that I'm just missing something here. Can someone please explain how a hobbyist can get into FPGA at a reasonable price? The immense cost of the synthesizer software plus the ridiculous cost of the programmers just make it seem impossible to do anything with FPGA as a hobbyist other than play around with a dev board.

 

Offline pigrew

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: us
Re: Programming ICE40 FPGA on a board?
« Reply #1 on: June 09, 2020, 09:34:14 pm »
I've used the MachXO2 as a hobbyist, and I _think_ it's similar to the Ice40.

I use a dead ispLever 4256ZE breakout board as a programmer. Its target CPLD fried. I removed it, and used its header pins for the JTAG connections. The board used to be US$30, but looks like it's been bumped to $105 recently.

On their breakout boards, the programmer is actually just a FT2232H. The Lattice software should work fine with one of the generic FT2232H boards, though perhaps you'll need to program an EEPROM for it to indentify itself properly. The boards can also be programmed over SPI or I2C, but that takes a bit more work to setup.

For hobbiest level, I really like the MachXO2. It comes in easily solderable packages, can operate with only a 3.3V rail (no need for 1.8V), has integrated flash, and Lattice gives away 1-year licenses for its synthesizer.

The higher-end programmers would have IO voltage translation, or perhaps isolation. These wouldn't need for most situations.
« Last Edit: June 09, 2020, 09:59:16 pm by pigrew »
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2746
  • Country: ca
Re: Programming ICE40 FPGA on a board?
« Reply #2 on: June 09, 2020, 11:53:05 pm »
Sidenote: I think it's pretty BS to charge $3k for a synthesizer. Why not just add a couple bucks to the chip to offset this cost? I truly don't understand how any sort of hobbyist could possibly ever get into using Xilinx FPGAs. You either shell out $3k or use one of the like 3 options available on the free version of Vivado, all of which the devboards for are like $200. And then you're limited to those chips forever cause that's all the programmer will do. Or am I misunderstanding things?
What are you talking about? Free Vivado license allows using a ton of different FPGAs and SoCs - from smallest $12/piece Spartan-7 all the way to chips which cost several thousands of $. That includes entire Spartan-7 and Artix-7 families. They also provide a ton of useful IPs for free, including things like DDR2/3 memory controllers, Video processing system, a ton of AXI/AXI-Stream infrastructure IPs (like DMA controllers, crossbars, stream conversion, and others). No other FPGA vendor is even close to Xilinx when it comes to free stuff.
There are a ton of boards for all budgets (from about $50 to multiple $1000s), and you can always build your own (like I do), for example check a project in my signature.

Offline knapik

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
Re: Programming ICE40 FPGA on a board?
« Reply #3 on: June 10, 2020, 12:05:26 am »
A lot of people use the FTDI MPSSE 3.3V cable for programming the FPGAs. There's one with an FT232H and one with an FT2232H (The latter being more expensive). I'm not sure if the FT232H is supported by the project icestorm's iceprog though.
« Last Edit: June 10, 2020, 12:12:07 am by knapik »
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming ICE40 FPGA on a board?
« Reply #4 on: June 10, 2020, 12:51:14 am »
Hi,

I've been playing around with FPGA lately. I'm trying to stay open source so I'm going with an ICE40 since open source synthesizers exist for this.

Sidenote: I think it's pretty BS to charge $3k for a synthesizer. Why not just add a couple bucks to the chip to offset this cost? I truly don't understand how any sort of hobbyist could possibly ever get into using Xilinx FPGAs. You either shell out $3k or use one of the like 3 options available on the free version of Vivado, all of which the devboards for are like $200. And then you're limited to those chips forever cause that's all the programmer will do. Or am I misunderstanding things?

You completely misunderstand this.

All four of the major FPGA vendors -- Xilinx, Intel, Lattice, MicroSemi -- offer free-as-in-beer tools (synthesis and of course the place-and-route) that work with any device a hobbyist will ever use, and in fact these tools work with most things the average professional uses for products.

I don't use dev kits (no reason to use them) and we use the free tools for everything here. That includes the MicroSemi ProASIC-3E 3000, various Artix-7, Spartan 6 and Spartan 3A, and Intel Cyclones. I used a Lattice MachXO2 for a little side project I did.

Yes, you have to spring for the programming dongles. And yes, everyone complains that they cost more than they should, and everyone complains that since they all do the same thing, why do I need to have a dozen of the fucking things?

Quote
So I was looking at TinyFPGA's github (https://github.com/tinyfpga/TinyFPGA-BX) and it seems you need a lattice FPGA programmer to do this. Makes, sense, but the link is dead. So I do some searching around for "lattice fpga programmer" and I found out that lattice makes something called "IceProg". So I check out their store, and I find this: https://www.latticestore.com/products/tabid/417/categoryid/4/productid/4612/searchid/1/searchvalue/iceprog/default.aspx

Great, a programmer, but again it's $500 and nonstock. Even if I was willing to shell out the money, it's not stocked so I couldn't get it anyway (or do they make it to order?)

That's a production programmer, not something you'd use for projects. Their usual HW-USBN-2B (still overpriced at $230, which seems to be more than what I paid for mine) should work. And apparently some people use an FTDI development board for the programmer.

Quote
Now it's very possible that I'm just missing something here. Can someone please explain how a hobbyist can get into FPGA at a reasonable price? The immense cost of the synthesizer software plus the ridiculous cost of the programmers just make it seem impossible to do anything with FPGA as a hobbyist other than play around with a dev board.

You're missing a lot :)
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2329
  • Country: 00
Re: Programming ICE40 FPGA on a board?
« Reply #5 on: June 10, 2020, 01:47:59 am »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14872
  • Country: fr
Re: Programming ICE40 FPGA on a board?
« Reply #6 on: June 10, 2020, 03:28:45 pm »
I'm not sure I got what the OP meant in this topic.

iCE40 are cheap devices, Lattice provides free tools for all of them (AFAIK - only used the iCE40UP line so far), and you can embed or design your own programming "probe" for pretty cheap. Same applies to most FPGAs at least for entry- to mid-level models. Programming a Xilinx part only requires an FTDI chip, same for Lattice.
 

Offline thor.lucasTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Re: Programming ICE40 FPGA on a board?
« Reply #7 on: June 10, 2020, 09:42:42 pm »
I'm not sure I got what the OP meant in this topic.

iCE40 are cheap devices, Lattice provides free tools for all of them (AFAIK - only used the iCE40UP line so far), and you can embed or design your own programming "probe" for pretty cheap. Same applies to most FPGAs at least for entry- to mid-level models. Programming a Xilinx part only requires an FTDI chip, same for Lattice.


Really? There's no proprietary programmer I have to buy? Any generic FTDI programmer will work? I guess I haven't seen anyone do this. All the guides online show people using dev boards. I assumed you had to program some sort of bootloader in using some proprietary programmer. Does this mean theoretically I could use an existing ICE40 dev board, which would have the FTDI chip (?) as an ISP to program ICE40 chips?

Also I meant that the TinyFPGA BX is an expensive device. Of course the ICE40 chips itself are cheap, but any dev board is going to be way over budget for use in a project.

I don't use dev kits (no reason to use them) and we use the free tools for everything here. That includes the MicroSemi ProASIC-3E 3000, various Artix-7, Spartan 6 and Spartan 3A, and Intel Cyclones. I used a Lattice MachXO2 for a little side project I did.

So how do you test your ideas beforehand? I don't really have the balls or the patience to have a PCB manufactured before I'm sure what I'm doing is going to work.

Yes, you have to spring for the programming dongles. And yes, everyone complains that they cost more than they should, and everyone complains that since they all do the same thing, why do I need to have a dozen of the fucking things?

Right, this is I guess what I'm most annoyed by. Programming an atmel chip only costs me a $20 arduino, which I can use as an ISP. But the Lattice programming cable thing is like $250. Another Xilinx one would be (I assume) the same price, if not more expensive. So there's no cheaper way?

And apparently some people use an FTDI development board for the programmer.

Hm, how? That seems like it would be the cheapest solution, but I can't seem to find anything online about it.

I've used the MachXO2 as a hobbyist, and I _think_ it's similar to the Ice40.

I use a dead ispLever 4256ZE breakout board as a programmer. Its target CPLD fried. I removed it, and used its header pins for the JTAG connections. The board used to be US$30, but looks like it's been bumped to $105 recently.

On their breakout boards, the programmer is actually just a FT2232H. The Lattice software should work fine with one of the generic FT2232H boards, though perhaps you'll need to program an EEPROM for it to indentify itself properly. The boards can also be programmed over SPI or I2C, but that takes a bit more work to setup.

For hobbiest level, I really like the MachXO2. It comes in easily solderable packages, can operate with only a 3.3V rail (no need for 1.8V), has integrated flash, and Lattice gives away 1-year licenses for its synthesizer.

The higher-end programmers would have IO voltage translation, or perhaps isolation. These wouldn't need for most situations.

This would be very interesting if I could find more information on it. I wonder if I could use the TinyFPGA to do the programming, then?

 

Offline jaromir

  • Supporter
  • ****
  • Posts: 338
  • Country: sk
Re: Programming ICE40 FPGA on a board?
« Reply #8 on: June 10, 2020, 11:08:31 pm »
Really? There's no proprietary programmer I have to buy? Any generic FTDI programmer will work? I guess I haven't seen anyone do this.

For ICE40 device I used (LP384) there was no FPGA programming part. The FPGA loads its configuration from an external ordinary SPI FLASH. I could use any of many solutions to program the bitstream (binary file generated by ICEstorm, I vaguely remember using ICEcube2 from Lattice too) into the FLASH, but for easy workflow I opted to massage my arduino PIC programmer to support FLASH memories. It was something like half an hour of work, later I made variant with STM32 Nucleo board acting as programming hardware. This modification was quick hack for my personal need and isn't released yet.
FLASH loading can be done in "on-board-programming" way, provided all SPI signals and CRESET is brought to programming header. Programmer has to assert CRESET pin (so that FPGA doesn't touch SPI FLASH and wait for reconfiguration), perform FLASH programming and then release CRESET pin, so that new configuration is loaded into FPGA. When programmer is disconnected, FPGA loads configuration automatically after POR.
I've heard of somebody using one of those cheap AVR ISP programmers (3USD delivered, from asian vendors) with alternative firmware for SPI FLASH programming. No other information available, but I believe it's perfectly possible, too.
You could use one of the CH341 programmers to load bitstream into SPI FLASH, but swapping chips manually is PITA.

TLDR: For ICE40 one can use ICEstorm and cheap arduino as free and open source toolchain, with total cost 2USD. Using ready-to-go devboard is more convenient, though.
« Last Edit: June 10, 2020, 11:10:03 pm by jaromir »
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2746
  • Country: ca
Re: Programming ICE40 FPGA on a board?
« Reply #9 on: June 11, 2020, 03:32:42 am »
Right, this is I guess what I'm most annoyed by. Programming an atmel chip only costs me a $20 arduino, which I can use as an ISP. But the Lattice programming cable thing is like $250. Another Xilinx one would be (I assume) the same price, if not more expensive. So there's no cheaper way?
Digilent sells programming cables for all Xilinx devices for $59, which is still much more than what they should cost, but at least it's a one-time expense. Those who aren't concerned about IP theft and stuff can buy clones of Xilinx programmer on aliexpress for few bucks, though I heard conflicting info on their functioning.
But that stuff is required if you need/want full debug experience (like live debugging, using integrated logic analyzer, ADC dashboard, transceivers status, and other stuff like that), if you only want to "program" (the right term is "configure") FPGA, there are several documented ways of achieving this - including using MCU and serial protocol, or JTAG, or simply have FPGA boot from QSPI flash and provide a way to program that flash.

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming ICE40 FPGA on a board?
« Reply #10 on: June 11, 2020, 06:16:26 am »
I'm not sure I got what the OP meant in this topic.

iCE40 are cheap devices, Lattice provides free tools for all of them (AFAIK - only used the iCE40UP line so far), and you can embed or design your own programming "probe" for pretty cheap. Same applies to most FPGAs at least for entry- to mid-level models. Programming a Xilinx part only requires an FTDI chip, same for Lattice.


Really? There's no proprietary programmer I have to buy? Any generic FTDI programmer will work? I guess I haven't seen anyone do this. All the guides online show people using dev boards. I assumed you had to program some sort of bootloader in using some proprietary programmer. Does this mean theoretically I could use an existing ICE40 dev board, which would have the FTDI chip (?) as an ISP to program ICE40 chips?

The FT2232H Mini Module works with Lattice Diamond.

Quote
I don't use dev kits (no reason to use them) and we use the free tools for everything here. That includes the MicroSemi ProASIC-3E 3000, various Artix-7, Spartan 6 and Spartan 3A, and Intel Cyclones. I used a Lattice MachXO2 for a little side project I did.

So how do you test your ideas beforehand? I don't really have the balls or the patience to have a PCB manufactured before I'm sure what I'm doing is going to work.

Well, let's just say I've been doing this professionally for a looooong time.

And with the kind of products we design, there's no point to "testing ideas beforehand" on an eval board. Not when the products have multiple high-speed LVDS DDR serial ADCs for sensor-output digitizing, a sequencer/controller for the sensor, multiple slower SPI ADCs for housekeeping, a gigabit communications channel implementing a custom protocol over fiber, a command parser, a system initializer module, a side-band serial (UART) interface, on-board non-volatile parameter storage, and etc etc. If you have to design a board (or boards) to glue onto an eval kit, well, you might as well just design the whole damn board that goes into the product.

I spend a lot of time simulating the design, which means finding or writing models of the various peripherals. It means testing and functional verification of all of the low-level modules. It means scratching out timing diagrams and sequences on quadrille paper before even thinking about writing VHDL, and certainly before you synthesize and place and route. When I do get to the fitter tools, most of the time is spent closing timing. Sometimes that's easy. Sometimes it's not, so you spend time pipelining and whatnot so you meet timing, and since adding pipeline stages changes the design, you have to go back and re-verify the code to make sure you account for the latency.

It's called engineering.

Before we have first-article boards sent out for fab, there's enough of the FPGA design complete to say that our pinout choices will work. This means understanding the chip architecture so you can tell the layout person, "These pins can't change because they're clocks, these pins have to be on a 3.3 V bank, these pins are LVDS so they have to be on the 2.5 V bank, these pins connect to the gigabit transceiver so they can't change, these pins are for the memory interface and can't change." And when layout makes the pinout choices, those get put right into the design and checked by running the FPGA fitter tools with them.

So when we get first-article boards back from assembly, a lot of the design already works. A lot of what doesn't work comes from misunderstanding the data sheet for some other part. (You've read data sheets, right? So you know that they are a fountain of correctness and completeness!) Sometimes those other parts simply don't work as advertised. I spent way too much time trying to figure out why an ADC, with the simplest of interfaces, was giving us nonsensical noise histograms. I tried all manner of control timing changes to get it to work properly, and it turns out that the ADC quantizer is broken. Well, it meets the published spec, which means the 16-bit converter is really only good for 12 bits over the full temperature range.

I'm a believer in in-circuit debug tools like ChipScope, but not as a substitute for simulation and verification prior to synthesis. You want to start synthesis with the idea that your design is correct. I know there are a lot of burn-and-crash guys who pooh-pooh simulation, but when the designs get large, you end up wasting a lot of time analyzing in-system. This is exacerbated by long tool run-times. But! ChipScope is great for telling you that the peripheral connected to the FPGA doesn't behave the way you think it should. When that happens I update my models, re-simulate, then re-spin with the FPGA tools. And then you realize, like with the ADC above, that the part doesn't work ...

Anyway, all of the above is the difference between the hobbyist and the professional. And we like to say, "If it was easy, everybody would be doing it."

good luck.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14872
  • Country: fr
Re: Programming ICE40 FPGA on a board?
« Reply #11 on: June 11, 2020, 02:40:29 pm »
Yes. You can use FTDI chips for programming at least Xilinx parts and Lattice parts. Since this is just JTAG access and off-the-shelf parts can be used, I don't think you're even infringing on anything. You need to configure the FTDI EEPROM right in order to setup the channels correctly for JTAG access, but (at least for Lattice) I don't think you even need to put in any Lattice-specific information (TBC).

As for Xilinx, same, except even OpenOCD supports many Xilinx FPGAs, so all you need really is ANY cheap JTAG probe supported by OpenOCD. Digilent sells HS2/HS3 probes which are just based on an FTDI chip as well. There's nothing more in them than in most cheap JTAG adapters or modules based on FTDI chips, even a breakout board or embedding the chip directly on your own board will work.

Regarding specifically the iCE40 series, at least for the UP versions, you can also program them through SPI. Take a look at the Upduino 2 project, which just embeds an FTDI chip on board just for that as well. You can absolutely use Lattice Radiant with that.

https://github.com/tinyvision-ai-inc/UPduino-v2.1
« Last Edit: June 11, 2020, 03:07:35 pm by SiliconWizard »
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Programming ICE40 FPGA on a board?
« Reply #12 on: June 11, 2020, 10:02:18 pm »
I'm not sure I got what the OP meant in this topic.

iCE40 are cheap devices, Lattice provides free tools for all of them (AFAIK - only used the iCE40UP line so far), and you can embed or design your own programming "probe" for pretty cheap. Same applies to most FPGAs at least for entry- to mid-level models. Programming a Xilinx part only requires an FTDI chip, same for Lattice.


Really? There's no proprietary programmer I have to buy? Any generic FTDI programmer will work? I guess I haven't seen anyone do this. All the guides online show people using dev boards. I assumed you had to program some sort of bootloader in using some proprietary programmer. Does this mean theoretically I could use an existing ICE40 dev board, which would have the FTDI chip (?) as an ISP to program ICE40 chips?

Also I meant that the TinyFPGA BX is an expensive device. Of course the ICE40 chips itself are cheap, but any dev board is going to be way over budget for use in a project.


I really can't think of any way of putting this without sounding harsh.

Have you considered bothering to read Lattice's ICE40 documentation? i.e. iCE40 Programming and Configuration.

Quote from: iCE40 Programming and Configuration, page 1, paragraph 1
Introduction

The iCE40TM devices are SRAM-based FPGAs. The iCE40LP, iCE40HX, iCE40 UltraTM, iCE40 UltraLiteTM and iCE40 UltraPlusTM devices also have an on-chip, one-time programmable NVCM (Non-volatile Configuration Mem- ory) to store configuration data. The SRAM memory cells are volatile, meaning that once power is removed from the device, its configuration is lost, and must be reloaded on the next power-up. This behavior has the advantage of being re-programmable in the field which provides flexibility for products already deployed to the field. But it also requires that the configuration information be stored in a non-volatile device and loaded each time power is applied to the device. The on-chip NVCM allows the device to configure instantly and greatly enhances the design security by eliminating the need to use an external memory device. The configuration data can also be stored in an external SPI Flash from which the FPGA can configure itself upon power-up. This is useful for prototyping the FPGA or in situations where reconfigurability is required. Additionally, the device can be configured by a processor in an embedded environment.

If you had, you'd know that all that is needed to program ICE40 parts is SPI - either using the FPGA in master mode and loading the bitstream in from industry standard SPI EEPROMs, or in slave mode over SPI from a microcontroller or an in circuit programmer (slave mode is necessary if you're using the onboard flash in some of the newer ICE40 parts). How you get from bitstream file to the chip is up to you; use an expensive programmer, use a cheap clone programmer, use a cheap SPI EEPROM programmer (the one I use is a $5 Chinese throwaway),  heck, you could do it from an Arduino if you really wanted to.

Seriously, if you can't be bothered to read the documentation how do you expect to get any FPGA part to do anything for you? There's a ton of things you have to get right to use one of these parts and you won't manage to do it without reading the documentation.

Sorry to sound ratty, but your question could have been at least partially answered by actually going to Lattice's site and getting the information from the horse's mouth by reading the documentation for the product you want to use.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 
The following users thanked this post: Bassman59

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming ICE40 FPGA on a board?
« Reply #13 on: June 12, 2020, 03:47:08 am »
Seriously, if you can't be bothered to read the documentation how do you expect to get any FPGA part to do anything for you? There's a ton of things you have to get right to use one of these parts and you won't manage to do it without reading the documentation.

This also answers the question of "how do you test your ideas beforehand [without using an evaluation kit]?"

We read the documentation and we understand what the various FPGA families offer, so we choose a device that meets our needs. It's really not rocket surgery.
 

Offline thor.lucasTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Re: Programming ICE40 FPGA on a board?
« Reply #14 on: June 12, 2020, 05:07:09 am »
I really can't think of any way of putting this without sounding harsh.

Have you considered bothering to read Lattice's ICE40 documentation? i.e. iCE40 Programming and Configuration

Sorry to sound ratty, but your question could have been at least partially answered by actually going to Lattice's site and getting the information from the horse's mouth by reading the documentation for the product you want to use.

I did, actually. It's one thing to read documentation on a topic I know a lot about (programming, etc). Reading docs on something I'm a novice at is more complicated. I'm smart enough to go to one of the top universities in this country, but I can't pretend to be smart enough to understand things like this without some help from experts.

This also answers the question of "how do you test your ideas beforehand [without using an evaluation kit]?"

We read the documentation and we understand what the various FPGA families offer, so we choose a device that meets our needs. It's really not rocket surgery.

It may not be rocket surgery for you as a professional. I can go hours programming without needing to test and being confident all unit tests will pass when I finish. I am not at all confident in my EE skills yet, certainly not enough to gamble money away by ordering a PCB before I'm positive it does what I want it to.

Arduino docs, for example, are absolutely idiot proof and are good for beginners like me. The iCE40 technical documentation was written for professionals, not hobbyists, and a lot of this goes over my head.

Additionally, it's not like it's something I can sit down and play experiment for a while until I get it. If there were through hole 2.54mm pin pitch iCE40s then sure, I could bread board it and run it on a slow clock. But these chips are BGA. I have to order a PCB, reflow it, and then find out what I thought was my understanding of the documentation was actually incorrect. Then I have to question whether or not it was something wrong in the programming, or in the layout of the board? Or maybe it was a timing thing? Or maybe it's something I don't even know about?

Getting out and diving head first into something is always a great way to learn. It's not a big deal in programming where mistakes are free, or in art where mistakes are subjective. But false confidence and "playing professional" can cost me real money, and iteration is slow as I have to wait for chinese manufacturing and shipping.

That being said, thank you all for your suggestions. Your help combined with the documentation should get me a little closer to figuring this out, so thanks. From what I gather, the Lattice software just spits out raw data that can be loaded into any external EEPROM / Flash and it will just work with the proper pin configuration? So really, it's a question of how to program the EEPROM or flash memory (for which there is a lot more beginner info on online), right?
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Programming ICE40 FPGA on a board?
« Reply #15 on: June 12, 2020, 02:02:46 pm »
I think you might be trying to run before you can walk. If you're at the point where you can't garner from Lattice's documentation that this part needs to be fed its programming over an SPI interface then I don't think you're ready to start designing these parts into your own projects, not as raw parts anyway. Again, I don't want to be harsh, but I don't think one has to be a hardened professional (I'm not, I'm a self-educated code monkey that didn't go to a top university) to pick up what's needed from:

Quote from: iCE40 Programming and Configuration, page 1, para 3
As described in Table 2, iCE40 components are configured for a specific application by loading a binary configuration bitstream image, generated by the Lattice development system. For high-volume applications, the bitstream image is usually permanently programmed in the on-chip Nonvolatile Configuration Memory (NVCM). However, the bitstream image can also be stored externally in a standard, low-cost commodity SPI serial Flash PROM. The iCE40 component can automatically load the image using the SPI Master Configuration Interface. Similarly, the iCE40 configuration data can be downloaded from an external processor, microcontroller, or DSP processor using a SPI-like serial interface.

If you don't "get it" from that it's an indication that you're so unfamiliar with the territory that designing in a raw part is beyond you at the moment.

As you say, there are so many variables at play that you don't have a hope in hell of debugging why your raw part isn't working. If I were you I'd stick with dev boards for the time being and progress to designing in raw parts once you've got some more experience and accumulated some more knowledge. Then when you hit the inevitable snags you've at least got a known working FPGA subsystem.

The iCE40 series are great parts with a niche of "I want an FPGA here, but i don't want a monster", also it has, as you've noted, an open tool chain. Lattice also have the MACHXO2 series which is an even more beginner friendly part, although you lose access to any idea of using an open tool chain. Lattice sell their own breakout board for the MACHXO2 (MACHXO2 7000HE Breakout Board $89 from Mouser) which has the most minimal extras necessary to make the part function and comes with a USB connected programmer on-board. All the device pins are broken out to individual connections so you can get as close to using a raw part as you like while still having the comforts of having the FPGA's supply, decoupling and programming taken care of for you and some LEDs you can use to "get to blinky" and use as status/debugging flags.

As far as the iCE40 range is concerned, it's not just in BGA packaging, it's also in QFP and QFN packages and if you want to breadboard a raw device it's easy enough to mount one of these on an adapter board that can be had for a couple of dollars from the usual sources (i.e. some Chinese chappie or chapess on eBay).

Whatever you do, you're not going to get there without reading hundreds, perhaps thousands, of pages of documentation and persevering until you understand it, possibly with supporting help from textbooks; it's just part of the territory.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2746
  • Country: ca
Re: Programming ICE40 FPGA on a board?
« Reply #16 on: June 12, 2020, 02:25:02 pm »
For absolute beginners in FPGA field I highly recommend Nandland's Go board: https://www.nandland.com/goboard/introduction.html
It's quite affordable, and the author provides great tutorials to get you started with FPGA, starting from the very basics. I'm not affiliated with that company, nor do I own this board, but I love his videos on YouTube explaining all kinds of things pertinent to FPGAs.

Offline Dmeads

  • Regular Contributor
  • *
  • Posts: 161
  • Country: us
  • who needs deep learning when you have 555 timers
Re: Programming ICE40 FPGA on a board?
« Reply #17 on: June 13, 2020, 04:49:09 am »
Okay first
Quote
A lot of people use the FTDI MPSSE 3.3V cable for programming the FPGAs. There's one with an FT232H and one with an FT2232H (The latter being more expensive). I'm not sure if the FT232H is supported by the project icestorm's iceprog though.

The ICE40 can definatley be programmed using the FT232H. An open source board called the Upduino uses that chip to program the flash or the actual ICE40 FPGA (the FPGA can be itself flashed, you just need to switch some jumpers on the board). All the schematics are open source and actually really easy to understand. https://github.com/tinyvision-ai-inc/UPduino-v2.1

My advice would be to take the schematics and make your own programmer using the FT232H. Then you can put your FPGA on whatever PCB you want (saldy not through hole), and as long as you have external access to the programming pins, you would be golden.

Yes, a custom programmer would need a custom PCB, but the programming side of the Upduino doesnt have too many parts and you can order PCBs from JLC PCB for 2 bucks. I bet you could make a custom programmer for the ICE40 based of FT232H for under 10 bucks :)

I was thinking about doing this a little while ago actually and I have a bunch of my own schematics and footprints and stuff. if you decide to go this route send me a message and I can help you out.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf