ICE40 series questions, from a noob - Page 1
Forum section: electronics / general

author: Sniper1
author_rank: Regular Contributor
timestamp: November 21, 2023, 07:35:47 pm
content: So i noticed on mouser they they are the cheapest FPGAs by far and on par with some MCUs in terms of price.I did some googling and they seem to have a open source environment but the tutorials and such are on the older side. This got me worried since i am afraid of tool chain problems since i am very new to verilog.Why am I asking? : since i am tempted to buy a dev boad and try some code* on it and then potentially use the IC on a boad here and there where i want true parallelism ( since i am sure my SW may crash ,basically i think i will make something that is less prone to set a FET on fire). Ideally i would use the ICE40 as an ASIC and tell it what to do with I2C , my ESP32 will have a lot to deal with so i am considering offloading this tak to another MCU or a cheap FPGA.it may also be my self excuse to play with FPGA HW.........TLDR are ICE40 FPGA still supported by the open source tool chain? and are they a good starting point for a HW EE to play with some FPGA/control stuff or it something from AMD/Intel letter suited for that ?

author: woofy
author_rank: Frequent Contributor
timestamp: November 21, 2023, 08:34:55 pm
content: Yes, ice40 is supported by open source tools, however it is quite an old technology now. The cheap fpga's are not very capable, and usually double the price of an equivalent efinix device when comparing similar devices. Search Digikey for Efinix. I have used ice40's with the open toolchain, but for newer projects would use Efinix.

author: Sniper1
author_rank: Regular Contributor
timestamp: November 21, 2023, 09:30:10 pm
content: THX, the price range is ok, tho it is only on digikey...regarding the power i need i am not sure, i want a I2C/SPI slave and some PWM out ( with controlled phase shift and duty cycle ) + some compactors this is my requirement as of now for my napkin sketch probably anything will worki will read more and see what comes out of itI have no idea about the scale the project will balloon to , or rather the time i will need to spend with the FPGA to get it working so a good tool chain is a very important thing for melike in SW yea the arduino is ancient but good enough for my LED, lol no need for the newest iMX9 .I will then continue asking and sketch some verilog and then see what it would need ( i can compile without a certain IC in mind, right?) as in for a generic FPGA family (if i understand right)

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 21, 2023, 09:37:34 pm
content: If you're starting, I would recommend using Lattice tools instead of an open source toolchain. You can move on to Yosys/nextpnr later on. IMO. Yosys works fine for iCE40 chips, but it has a learning curve, and some things are still quirky or impossible, such as defining IO timing constraints (but that may have changed).

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 21, 2023, 09:38:49 pm
content: I've been thinking about getting one of theOlimex iCE40HXnK-EVBdevelopment boards myself. Even though it is older tech, it is exactly the open source toolchain that makes them attractive to me.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 21, 2023, 09:44:24 pm
content: iCE40 "old tech" has been cloned endlessly by chinese vendors. It's absolutely fine for many purposes not requiring complex or very fast designs.There are variants in the iCE40 series, so you can have a look at all of them and pick whatever best fits your needs.Yosys/nextpnr also supports the ECP5 series if you need something beefier.

author: woofy
author_rank: Frequent Contributor
timestamp: November 21, 2023, 10:12:56 pm
content: If you need built in i2c or spi, have a look at the ice40up devices. Others like the ice40hx does not and you would need to write your own verilog.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 21, 2023, 10:27:29 pm
content: The UP series has the benefit of being supported by Lattice Radiant (their latest tool), while older iCE40 variants are only supported by pretty old Lattice software AFAIR.But if you only intend to use Yosys, then all of them are supported, so not a problem.I like the UP series, but it has a very limited number of IOs in all of available packages, so keep that in mind. May or may not fit your needs.

author: TinLethax
author_rank: Regular Contributor
timestamp: November 22, 2023, 06:00:50 am
content: The iCE40UL1K is really nice too.It has 3 dedicated open-drain output for driving 3 separate LEDs (using SB_RGBA_DRV primitive).Also there's built-in PWM primitive with 3 independent PWM signals that you can pretty much use with anything (using SB_LEDDA_IP primitive).Plus 2 I2C cores that really hard to use (SB_I2C_FIFO).Several downsides of this chip- Only available in the crazy WLCSP 4x4 BGA and 0.4mm 6x6 BGA (I have some fully working (6 boards IIRC) using the 0.4mm BGA on OSHPark 4 layers service)- no Yosys support for this chip. Only the iCECube 2 supported it. But IMO beside the crappy text edit of the iCECube. Overall experience of this tool is great.I dropped the link to my GitHub if you interested to build one. I source the chip from AliExpress btw.https://github.com/TiNredmc/iCEStamp

author: Sniper1
author_rank: Regular Contributor
timestamp: November 23, 2023, 09:04:45 pm
content: THX for all the great answers, i will consider all things and decide when i am done sketching.As of now i am a bit concerned about the small pitch ICE40 BGA but i know most FPGA are like that.regrading verilog and practice i think i will buy a devboard first and play with LEDs and maybe some I2C LCD if ia am bold , i am leaning heavy on the OLIMEX one since it s open source and i can copy the schematic with more certainty since overall i dont need much atm and better break this one then a way more expensive one while i learn.I will probably stick with the official tool chain since i have no idea what i will be doing most of the time, LOL

author: zapta
author_rank: Super Contributor
timestamp: November 25, 2023, 07:10:30 pm
content: You may want to look at this one LCMXO2-256HC-4SG32C . It's more 'standalone' and doesn't require external LDOs non standard rails, or clocks.

author: trossin
author_rank: Contributor
timestamp: November 25, 2023, 07:49:55 pm
content: How about a Raspberry Pi Pico. It has I2C, USB, serial and can generate 16 PWM outputs using built in hardware. It costs $4.Check out my servo control project which uses Bezier splines to control a robot arm:https://sites.google.com/site/tedrossin/home/electronics/raspberry-pi-pico

author: Sniper1
author_rank: Regular Contributor
timestamp: November 29, 2023, 04:58:32 pm
content: I can try but i am not sure if it is stable enough to properly control a dual active bridge phase shifted isolated DCDC converterYea it might work but way more resolution and true parallel would be better ( + if code gets stuck i may get FET smoke ) but yes i am thinking also of a MCU version since then it is way easier to write the SWNOTE: i already used the RP2040 IC so i know it ok ish in PCB design.

author: iMo
author_rank: Super Contributor
timestamp: November 30, 2023, 01:57:25 pm
content: I spent quite time with the ice40UP5k (UPduino board) and the ice40LP384 (my own dip sized board).The Lattice free tools work fine - Radiant with the UP5k and iceCube2 for the latter.The Cons - not the best performer with more complex designs (ie I did a Forth MCU and RIsc-V MCU with max 20-24MHz clock), for your purpose perhaps ok.Pros - UP5k got 128kBytes of sram and 15kB of bram, that allows to implement complete MCUs, for example.The hard 16x16bit multipliers infer easily, while I never saw in practice or tried how to use the hard SPI and I2C.You may use the external bitstream flash in your userland as well (ie. I load the C binary into the risc-v's psram off the bitstream flash, or load/store dictionaries in case of the Forth).The YOSIS/nextprn works too, but usually less effective compared to the Lattice tools.Anyhow, unless you want to enter the FPGA space, I would recommend you to use an off-the-shelf MCU, it is the fastest and least troublesome way. Messing with FPGAs is rather time consuming..

author: berke
author_rank: Frequent Contributor
timestamp: December 20, 2023, 05:29:01 pm
content: The Olimex iCE40 boards are nice, they have 512 kiB SRAM and a 100 MHz oscillator but they are a bit harder to work with compared to the Lattice "breakout" boards.One downside is that they don't have an FTDI chip like the Lattice boards. You have to connect an SPI programmer to the 2x5 connector. I use flashrom and a Beaglebone but someone is probably selling an off-the-shelf programmer.You can't directly upload to the FPGA without modifying the board, you have to flash the memory chip using an external programmer. It's slightly slower. You'll probably be dead before you use up the 100,000 erase cycles of the flash chip. Modifying the board to allow direct configuration without going through the flash involves desoldering one 0402 resistor and soldering a small 0402 resistor (or solder-bridging the pads).Another downside of the Olimex board is that while it has 40-ish IOs on 0.1" connectors, most IO's are on tiny 0.05" headers.However Olimex also sells plug-in boards including ADC, DAC, a general-purpose I/O board with a VGA and a PS/2 connector which are nice for quick experiments. I used the ADC, the VGA and the PS/2 connector. The "digital I/O" board is a bit funky, you need to configure a DAC to program the I/O levels, I didn't bother with it.The Olimex boards are directly powered from a 5V source using a barrel jack.The Lattice iCE40HX8K-BB-EVN board is USB-powered, although it's not too hard to mod them to be externally powered. They include an FT2232H chip which provides easy configuration (and flashing), from Linux I use iceprog which comes with Yosys/Nextpnr etc. You can also roll your own SPI configurator. You can flash the chip or configure the FPGA directly (you rotate two jumpers to select the mode.)The B channel of the FT2232H chip is wired in UART mode. You can use A channel in MPSSI mode and get about 30 Mb/s.The Lattice board has pretty much all the I/Os available on four 0.1" headers (not all installed) and eight LEDs. Not all I/Os are used as some are connected to the LEDs and the FTDI.Unfortunately these boards go in and out of stock.Note that the spacing between the 0.1" connectors of the Lattice board are not 0.1" aligned! You can't plug more than one onto a standard Veroboard. Keep in mind if you want to make a daughter board.The design files of the Olimex boards are available (it's fully open source and made with KiCAD). For the Lattice boards you only get the schematic.You can also modify the Lattice boards for external SPI configuration but it's a bit messy, you have to disconnect the FTDI lines and tap into SCK,MOSI and CREST signals.The Lattice boards only have the 12 MHz "USB" clock, but it's not a biggie you can PLL it up as needed.BoardPowerClockUSBConnectorsFPGA direct configSRAMOlimex iCE40HX8K5V barrel jack100 MHzNoVarious .1",0.05"Requires modding512 kiBLattice iCE40HX8K-BBUSB mini-B12 MHzFT2232H for config + UART4 .1" headersJumper-configurable, via FTDI (iceprog)NoneVerdict: Unless you need the 512 kiB SRAM, extrnal power or external SPI config I recommend the Lattice boards as they are pretty much plug-and-play, but the Olimex boards are cheaper and might have better availability.The iCE40HX8K is a really nice chip and Yosys is amazing. BTW the 8K devices have 16 kiB of SRAM (32×4096) and Yosys does a good job of inferring the RAM blocks.