Storm in a Pint Pot

Ken follows up part 2 of the myStorm low down, digging deeper into the design choices:


Makeup of myStorm

Following a successful assembly of the first three myStorm pcbs last weekend – I now go into some more of the details of the hardware.


In this part I take a closer look at the target hardware describing some of the main connectivity and features and describe the way in which we are now able to achieve a $30 selling price.
myStorm is a unique combination of Open Source digital hardware – supporting some of the most current, popular devices.
At the centre of the design is the Lattice ICE40 HX4K-144  FPGA connected to an ARM Cortex M3 microcontroller. To complete the set, we have an optional Raspberry Pi or Pi Zero $5 computer which can be used to support the open source programming tools.
The ARM Cortex is used to program the bitfile into the FPGA, from it’s flash memory as well as providing support functions  – such as 5V tolerant GPIO and 12-bit analogue to digital converter channels – when the myStorm is to be used in a standalone usb mode.

ARM Cortex M3 Section

The ARM microcontroller performs several basic functions at different times in the application development cycle.
  • As a non-volatile Flash memory device for holding the FPGA bitfile.
  • As a FPGA programmer communicating the bitfile to the FPGA via an SPI interface.
  • As a general purpose I/O/ADC slave processor – by way of serial or fast 8-bit parallel interface
  • As a system controller for applications where the Raspberry Pi  is not present.
The microcontroller needs a flash memory of at least 256K bytes. This can be initially met with an STM32F103RCT7 – a Cortex M3 in a 64 pin LQFP package. This gives plenty of available I/O for the various support roles, 8-bit communications bus, UART to the Raspberry Pi, usb to PC- and also allows up to 20 digital GPIO lines and 6 x 12 bit analogue inputs to be brought out to Arduino style headers.
I have had experience of the STM32 range of microcontrollers – so these were the obvious first choice – but with a tight budget, not stretching to a $4 mcu, we were obliged to follow an alternative strategy.

Some months ago, through my association with the STM32Duino group, I got to hear about some low cost ARM M3 parts from a vendor in China, apparently binary and pin compatible with the STM32 parts . At first, these appeared to be rip-offs of the STM32F103 series, produced by Chinese vendor Giga Devices.  However, further investigation revealed that they were actually a legitimate new design, which employed a neat idea to produce a low cost, volume range of ARM Cortex M3 microcontrollers for the Chinese market. Because Giga Device is a Flash Memory manufacturer, their M3 Cortex parts have up to 3Mbytes of flash “on-chip”. One advantage of the GD series of microcontrollers is that they are available with very large (2MB, 3MB) flash memories – allowing multiple FPGA bitfiles to be stored in the single device. The four user DIP switches B0-B3 can be used to select which bitfile image is loaded –  or what mode the myStorm boots up in when power is first applied.

Of primary interest for the initial myStorm, however, was their low cost – a 256Kbyte ARM M3 Cortex by Giga Device – the GD32F103 which sells in 1 off for about $2.00, saving us about $2 on a device from ST.
Here are the important breakout of the Arm provision:
  • The 5V tolerant GPIO lines and  are brought to “Arduino” style pin header, shield connectors  – so that external shields may be fitted.
  • 6 Analogue Input Lines AN0 – AN5 with 12 bit resolution brought to shield headers.
  • UART (with bootloader facility) TX, RX – jumper linked to the UART output of the Pi Zero – to allow communication and serial bootloading
  • Up to 18 digital lines – including I2C and SPI
  • USB 2.0 connection for programming, data and power – when the board is used “standalone” without a Raspberry Pi connected
  • 8 bit bidirectional bus interface to FPGA and Raspberry Pi with handshaking lines
  • SPI bus for programming FPGA from bit file.
  • Up to 120MHz clock available using GD32 parts.
  • Several microcontroller options available from GD32 or STM32 product range – allows greatest versatility in ROM, RAM & peripherals
  • For example – up to 3 differential input 16 bit ADC channels (If STM32F373 optional mcu is fitted in place of STM32F103xx)

Raspberry Pi section

When the Raspberry Pi Zero was released in November 2015, it was heralded with a blaze of publicity as a $5 fully functioning Linux computer. Just add keyboard and display with the O/S stored on a microSD card, therefore including a Standard 2 x 40 Raspberry Pi GPIO header for myStorm was a no-brainer, along with an EEPROM for PI-Hat identity.

With its small size of just 64 x 35 x 5mm, and unbeatable value, it appears to be the ideal solution for a low cost development system.  On the left side of the board we have placed the standard 2×20 way pin header that is common on all recent Raspberry Pi boards.  The Pi Zero can be placed directly onto this connector, whilst a Pi 2 or Pi 3 can be connected using a short 40 way IDC cable, providing full linux add on choices.


Some of the GPIO pins made available on the expansion connector form the 8-bit communications bus that is common to both the Arm Cortex M3 and the FPGA.
The other signals available on the GPIO header are to access to the UART on the Raspberry Pi and the I2C – which can be used to identify the myStorm as a Pi Hat.  This is another use of myStorm – where the combination of the ARM Cortex M3 with its 5V tolerant GPIO and the full flexibility of the FPGA and accompanying fast SRAM can be used to form a really versatile I/O expansion board for the Pi – it’s like having an Arduino on “Digital Steroids” attached.

FPGA Section

The Lattice ICE 40 series of FPGAs are low cost and ideal for small, low power FPGA applications. With the advent of Clifford Wolf’s open source tool chain – Project ICE Storm – back in December of 2015 we now have everything we need to create open source FPGA designs using entirely an open source toolchain. This is a monumental achievement, and both Alan and I, working on the myStorm project are deeply indebted to those who have worked tirelessly to make this happen.
From a hardware perspective – we have strived to achieve maximum connectivity from the LQFP-144 packaged FPGA.  To do this we  have brought out the FPGA pins to a variety of standard connectors:
  • 3 single PMOD connectors (3 x 4 GPIO)
  • 5 double PMOD connectors (5 x 8 GPIO)
  • 34 pin Boxed Header “Olimex” style 2 x 17 connector
  • 2 x 8 header for direct connection to 32 x 32 RGB matrix display, or to a VGA output expansion board shared with 2 double PMODS.
In addition to the various on board connectors , we achieve further inter-device connectivity from the 8 bit bidirectional bus to Raspberry Pi and ARM Cortex M3.
For clocking the FPGA we use a standard 100MHz clock oscillator. For additional RAM, we have closely coupled a 64K x 16 fast SRAM to the FPGA on the underside of the pcb. This SRAM can be upgraded to 512K x 16 for memory intensive projects, such as video display etc.

Other Hardware Features

  • Efficient dual voltage switching regulator – provides 1.2 volt Vcc for the FPGA plus the 3V3 for FPGA IO, SPI, memory and ARM microcontroller.
  • 4 USER dip switches
  • 5 USER LEDs  4 connected to FPGA outputs – allowing ‘Traffic Light’ display,  plus one connected the ARM microcontroller – for ‘blinky’ or  ‘programming’ purposes.
  • RESET switch
  • BOOT  header – caters for the boot requirements of both the STM32 and the GD32 microcontroller.
All I/O connectors have been arranged on a 0.1″ grid – wherever possible – allowing simple shields to be constructed using stripboard or perf-board.

Cost Reduction

Keeping the cost down was a primary concern, yet we wanted to make a board that was both genuinely useful and accessible.
To achieve this, Alan came up with a unique strategy:

  1. Low cost FPGA with open source tool chain
  2. Low cost ARM Cortex – to act as “system integrator” and glue.
  3. Optional On board Pi Zero – to host the open source FPGA tools – user supplies this at $5.00 or even add their own existing Raspberry Pi.

Having settled on the ICE40HX4K – as the largest ICE40 available in an LQFP package – and thus capable of being routed on a 2 layer board, we set about identifying the other key components.
Having seen James Bowman’s J1a Forth Processor – a soft core running in an ICE40HX1K part, I wanted to add a fast (10nS) 16 bit wide SRAM – which in a TSSOP-44 package allows parts between 64K and 512K words. With this combination comes the ability to create a number of soft core processors, of which the 16 bit simple processor described in the “Nand to Tetris” course would seem a very suitable candidate.
Other applications include digital instrumentation that require large arrays of fast memory – such as digital oscilloscopes and logic analysers.
The lynchpin in this design is the use of a low cost ARM device, not only to provide stand alone USB communications,  storage (in flash) of the FPGA bitfiles, but also provide a series of spi slave ADCs and  5V tolerant GPIO pins and peripherals to augment the FPGA architecture.


We believe that if an FPGA board sells for around $30 then it will attract a fair bit of attention.
This was going to be tricky – so we set ourselves a BOM on a very tight budget of arount $10 based around the principal components – costed in 100 and 1000 off quantities. LOP relates to “Labour, Operations and Profit” – which is the sum our Shenzhen manufacturing Partners will charge us for the pcb assembly and Far East logistics. This is often quoted at about 25% of the total BOM cost.
            100 off            1000 off
FPGA        $5.56               $5.37
ARM         $1.92               $1.00
SRAM        $1.69               $1.22
PCB         $0.88               $0.49
Connectors  $0.50               $0.40
Remainder   $0.50               $0.40

Sub Total   $10.33              $8.88
LOP         $2.58               $2.22
Total       $12.91              $11.10
Pi Zero     $5.00               $5.00

So in 1000 of quantity, the BOM and manufacturing (LOP = Labour, Operations Profit) comes to a total of around $11, which allows a selling price of about $30.

The customer provides their own Raspberry Pi or Pi Zero, from as little as $5.00.
The myStorm will be provided with a full connector set – but these will be not fitted to the pcb – allowing the user maximum flexibility in the choice of connector options.
Alan has already developed a range of PMOD modules which can be plugged directly into the myStorm board.  These include buffers, mosfet outputs and drives for small dc motors he will follow up with some post around these shortly.

9 thoughts on “Storm in a Pint Pot

    1. Hi Jonathan
      We have made 3 for testing and have a small batch for the launch and workshop at OSCAMP 1st week of September, if you can get there you could get one early. Otherwise we expect a larger batch in about 6-7 weeks. We hope to put up a forum/mailing list shortly to register interest and support the myStorm community.

  1. Nice to see that you are still busy doing OSHUG projects. Unfortunately I’m out and about and missing OSCAMP ….grrrr
    BTW I thought it was a whole week event this time is that the case?

    1. The Wuthering Bytes festival is on from the 2nd to the 11th I believe, Ken and I will be around the Hebden Bridge area from the evening of the 2nd to 8th of September so it’s possible to get together then..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s