Silicon Chip – April 2019

(Ben Green) #1

34 Silicon chip Australia’s electronics magazine siliconchip.com.au


power is applied.
While the FPGA has the facility to
load its configuration from its own
internal non-volatile configuration
memory, this memory can only be pro-
grammed once, so a reprogrammable
flash chip is used until a design is fi-
nalised.
The EEPROM is simply used to hold
the configuration for the FTDI 2232H
and the remaining IC is an LT3030 dual
low-dropout linear regulator.
There is also a 12MHz clock source
on the iCEstick. This clock source is
necessary for all but the most basic
logic designs.
The iCE40HX-1k also features a PLL,
so designs are not limited to 12MHz,
as higher frequencies can be generated
by the PLL from the 12MHz source.
On the far side of the FPGA are
the I/O breakout headers. Five LEDs
(marked D1-D5) are arranged in a di-
amond pattern, flanked by two 0.1”
pitch 10-pin breakouts. Each of these
provides eight I/O pins plus ground
and 3.3V power.
The 6x2 female header block match-
es Digilent’s PMOD interface, and pro-
vides eight more I/Os, plus ground
and power.
Finally, at the end of the board op-
posite the USB connector is an IR
transceiver chip, which is connected
to another two of the FPGA’s I/O pins.
This gives a total of 24 unallocated I/O
pins available for use, plus at least
ten dedicated to I/O functions on the
board itself.


Other FPGA boards


After acquiring the iCEstick, we
looked around for other FPGA devel-


opment boards; in particular, those
supported by IceStudio. Many of these
are open-sourced hardware designs
that are being promoted on crowd-
funded websites.
In general, we found that most of
them were more expensive than the
iCEstick. A few were cheaper, but also
required a separate programmer. So for
this reason, and because the iCEstick
is easy to buy in Australia, we decided
to stick with it.
The fact that two different software
packages can be used to program it is
also a plus.

Software for the iCEstick
In the following discussion of the
software options, we will only give
very basic examples. If you want some-
thing more involved (and useful), see
our iCEstick VGA Terminal Project,
which starts on page 58.
There, we’ll delve much deeper into
what can be done with the iCEstick
and IceStudio.

IceStudio software
The open-source IceStudio soft-
ware is a free download. We found it
straightforward to use, and had a work-
ing project uploaded to the board in
minutes. There are example projects
available which appear quite basic,
but they are all great building blocks.
The version we tried was just over
100MB, although you also need to
download some other required soft-
ware packages, such as the ‘toolchain’.

Installing IceStudio
IceStudio can be downloaded from
its Github page at https://github.com/

FPGAwars/icestudio Like many open
source tools, it is available for Win-
dows, Linux and macOS. We used the
v0.4.0 release. Although this release
number indicates it is still in beta, we
found the software to be mature and
didn’t run into many bugs.
Behind the scenes, it uses the open-
source IceStorm project to synthesise
the bitstream alongside some configu-
ration files, but you don’t need to con-
cern yourself with these details while
using IceStudio.
In this regard, it is similar to Ardui-
no, which uses the open source gcc
compiler and the AVRDUDE program-
ming tool to provide most of its func-
tions, with inbuilt board configuration
files meaning the user does not have
to worry about the minute details of
the specific hardware used.
Installing IceStudio was quite
straightforward. About halfway down
the Github page (link above), there is
an installation guide, with brief, sim-
ple instructions for Linux, Windows
and macOS, with links to the down-
loads.
We installed on Windows 10, so
some of the steps below may not ap-
ply to Linux or macOS; in particular,
the driver switching step is probably
not needed on these other operating
systems.
The installer does not automatical-
ly install the required toolchain – you
will be prompted to install it when the
program first runs. No further input is
required apart from confirming that
installation should proceed.
IceStudio also includes a bitstream
programmer, but this does not work
with the default device driver for the
iCEstick under Windows. Again, a sim-
ple tool allows the appropriate driver
to be installed and uninstalled (which
is necessary if you wish to also use Lat-
tice’s iCEcube software).

Screen3: if you need to remove
IceStudio’s drivers to allow the
Diamond Programmer to work with
the iCEstick then find this entry in
Device Manager, right-click it and
choose Uninstall Device. Unplug and
replug the iCEstick and Windows

Screen2: IceStudio’s “Two LEDs alternate blink” example (which they incorrectly should reinstall the default drivers.
refer to as “alternative”). The small yellow box at left represents the 12MHz
crystal clock on the iCEstick. It is followed by a 22-stage binary divider,
effectively dividing the 12MHz clock by a factor of 4,194,304 (ie, by 2^22 , to
around 3Hz). Digital pins D1 and D2 are connected to two LEDs on the iCEstick
board, and are driven with square waves derived from the 3Hz clock, one
directly, and one via a NOT gate so that it is on while the other is off.

Free download pdf