Tuesday, 9 April 2019

Cyclone IV FPGA Development Board

Intro

My favourite thing about ebay is that it has a wide variety of development boards which provide great functionality at prices far lower than branded products.  Looking for an FPGA board I was very excited when I saw this one.
It has a great specification:

FPGA core board:
Power input DC5V
FPGA:EP4CE10F17C8N
SDRAM:256M
SPI FLASH: 64M
50 MHz CLK input 
Bottom board:
PC PS/2 port
VGA port ,can display picture or video, 16 bit 65536 colours
SD card
LCD12864/1602 ,can display number or English character
LCD TFT ,can display number or English character, or video
LED 7seg display 1x8, can display number
LED 1X8
COM port
8X8 LED dot matrix
3X3 key input pad
1X4 key input
switch 1X8 input
ADCTLC549, you can analogue signal acquisition
DAC7512, digital signal to analogue signal
IR input
DS18B20 temperature sensor

So three days later we have lots of inputs and outputs to play with.
In fact the FPGA board is detachable so one could theoretically use all the board IOs for other purposes.

I experienced problems initially as my usb blaster programmer turned out to be a clone and I had to install old WIN7 unsigned drivers to make it work.  Once I was able to load software the board was great.  The vendor provided Quartus programs to test the main features and it was a pleasure to load and run them so that I could be sure my subsequent efforts utilised working hardware.  Update: Life became much easier when I bought a real usb blaster (£16 instead of £6), which works perfectly.


Monday, 8 April 2019

MAX1000 FPGA

I have always been somewhat in awe of FPGAs and nervous of the challenges they present.  Recently, in the March/April edition of Elektor, I saw an instructional article to create a processor on  an Altera/Intel MAX1000 which reminded me of a study of Computer architecture, based on Nand2Tetris.com, which I enjoyed immensly .  The web-site (and book) leads you through all the important steps involved in building a computer starting from a collection of Nand gates and ending with  processor, assembler, compiler and Operating System to run your own programs.
Nand2tetris provided a hardware simulator based on building an increasingly complex hierarchy of components but naturally enough it was too slow to deal with running non-trivial programs.

I went through the following stages to find out more.

1) Purchase a $30 MAX1000 from Arrow Computers

2) Elektor 8080 + Small-C compiler part 1 : LED pattern

Following the instructions in Elektor magazine I built the 8080 simulator FPGA program and was able to run the C program which generates a MAX1000 LED pattern.

3) MAX1000 User Guide Tutorial : LED counter

When delivered the MAX1000 runs an LED counter program, using the tutorial I was able to recreate and download to the FPGA.

4) Quartus, Hello World : NAND gate LED

I wanted to write the simplest possible program and decided on a Nand gate.  Unfortunately only one button is easily available on the MAX1000 so I implemented a NOT gate instead.  When a button is pressed an LED goes out.
This exercise simplified technical work into two tasks:
a) a very simple HDL program to implement a NOT gate.
b) assignment of two MAX1000 pins to a button and an LED

5) Altera NIOS II Hardware Development Tutorial

NIOS II is an FPGA microcontroller developed provided by Altera.  A tutorial is provided which goes through a significant number of steps to build the solution.  It helps you become familiar with the Quartus Prime environment and the specific MAX1000 hardware.

By the end of this investigation I had a very basic idea how to use Quartus Prime and a MAX1000 board.  Clearly 1 usable button and 8 LEDs are insufficient to maintain an interest in programming.  Rather than adding my own devices by breadboarding the MAX1000 and various peripherals I decided to buy a board which already has them built in.