Silicon Chip – April 2019

(Ben Green) #1
58 Silicon chip Australia’s electronics magazine siliconchip.com.au

Want to give a project the retro-
computer look? Or do you just need a
convenient way to display a screen full
of text on a low-cost monitor? Then
this nifty project is for you! It generates
a VGA signal akin to some-thing from
an early PC or even a Commodore 64
or Amiga. It does this using a low-cost
iCEstick FPGA development board
and a very simple add-on board and is
controlled via a serial port.

by Tim Blythman


iCEstickiCEstick


VGA TERMINAL


iCEstickiCEstick


F


ollowing on from our review of
the iCEstick and IceStudio soft-
ware (page 32 of this issue), we
delved in to see if we could do some-
thing more useful and exciting to do
than flashing a LED.
After all, field programmable gate
arrays (FPGAs) are considerably more
capable than microcontrollers. So we
had to think of an application that
couldn’t be done with a 555
timer IC or the most basic mi-
cro you can buy!
So we’ve come up with some
‘code’ which configures the
FPGA chip (an iCE40HX-1k) on
the iCEstick to generate VGA-
compatible video signals using the
eight digital outputs available on its
PMOD connector.
The output is displayed as 16 rows
and 32 columns of text, with select-
able foreground and background col-
ours for each 8x8 pixel character. The
colours come from a palette of 16, cho-
sen from 64 possibilities. The graphics
ROM includes pseudo-graphics char-
acters to create block graphics, boxes
and shaded regions.


The module is controlled by a serial
(UART) data line running at 9600 baud
which accepts regular ASCII charac-
ters, LF, CR and FF control codes, as
well as the pseudo-graphics above
ASCII code point 127. There are also
control codes to set the
colours.

This
project could be
used as the starting point of
a more ambitious FPGA-based pro-
ject, or you could combine it with a
microcontroller of your choice, using
the serial port as your micro’s display
interface to the VGA monitor, to dis-
play text and graphics.
Note that when it comes to FPGAs,
it no longer makes sense to refer to
the code as ‘software’. The IceStudio
software takes our HDL (hardware de-

scription language) and synthesises it
into a bitstream.
This bitstream could be considered
an equivalent to a binary firmware
image; it can be stored in a
computer file or uploaded to
an EEPROM on a target sys-
tem. But rather than being a
sequence of instructions for
a processor to execute, it de-
scribes how the various ele-
ments within the FPGA are
connected or configured. For more
detail on this aspect, see the tutorial
starting on page 32.
For this article, we’re providing a
complete IDE project which you can
open up and use straight away. But it’s
also a great starting point for experi-
mentation, and a wonderful tool for
learning about how FPGAs work (and
about digital logic in general).

Circuit description
Most of the hardware required is on
the pre-built iCEstick module. A small
breakout board that we’ve designed
plugs into the 12-pin PMOD connec-
tor, converting the digital signals from
Free download pdf