Scherz 94
Scherz 94
• Stereo jack
• Micro SD card adapter
• Three seven-segment displays
• 39 IOs for user-defined purposes
• On-board voltage regulators
The Elbert board has a software utility for programming the board. This handles just
the final step of copying the binary file generated by ISE onto the Elbert V2’s flash
memory. There is also a USB driver to install for Windows users. To set up your com-
puter to use the Elbert, visit the product page for the Elbert V2 at numato.com and
click on the Downloads tab.
You will need to download:
To install the USB driver on Windows, plug the Elbert V2 board into your
computer and the New Hardware Wizard should start. Point the wizard at the
extracted “numatocdc” folder and the driver should install and the new hardware
be recognized.
After this, the Elbert V2 will be connected to one of the virtual COM ports of your
PC. To find out which port, open the Windows Device Manager and you should find
it listed in the Ports section as shown in Fig. 14.5.
Chapter 14: Programmable Logic 903
14.5 Downloads
All the code examples used in this book can be found in the GitHub repository
(https://github.com/simonmonk/pefi4).
To install the examples on your PC, click on the “Download ZIP” button in the
bottom right of the GitHub page and then extract the file. You will find the examples
in the folder “fpga.”
It is worth working through the examples below to build-up the projects and get
used to using ISE, but if you get stuck and need to compare what you have done with
the final working design, then these files will come in handy.
The first example that we will make is the data selector that you first met in Chap. 12
(Fig. 12.32). The schematic for this is repeated in Fig. 14.6.
The three inputs (A, B, and “data select”) for this circuit will be hooked up to three
of the push buttons on the Elbert V2 and the output will be connected to one of the
LEDs so that we can see the circuit actually in use.
out
B
Switch analogy
A
out
B
data select
Enter “data_selector” in the Name field. In the Location field navigate to the folder
where you want to keep your ISE designs. The Working Directory field will auto-
matically update to match this directory, so you don’t need to change the Working
Directory field.
Change the “Top-level source type” drop-down to “Schematic” and then click
“Next.”
This will take you to the Project Settings shown in Fig. 14.8.
Change the settings so that they match Fig. 14.8 and then click “Next” again. The
Wizard will then show you a summary of the new project and you can then click
“Finish.”
This will create for you the new, but empty project shown in Fig. 14.9.
The screen is divided into four main areas:
In the top left you have the Project View. This is where you can find the various
files that go to make up a project. It is organized as a tree structure. Initially there are
Chapter 14: Programmable Logic 905
two entries in this area. There is the entry that says “data_selector” and the second
entry that has a seemingly random name (xc3s50a-4tq144). The latter will eventually
contain two files, the schematic drawing that we are about to create and an imple-
mentation constraints file that defines how the inputs and outputs in the schematic
connect to the actual switches and LEDs on the Elbert V2.
906 PRACTICAL ELECTRONICS FOR INVENTORS
You can also double-click on “xc3s50a-4tq144” to open the project properties. So,
if you made a mistake setting the project properties using the New Project Wizard,
you can always correct it by double-clicking on this entry.
To the left, beneath the Project View is the Design View. This will eventually list
useful actions that we can apply to our design including generating the binary file for
programming the Elbert V2.
The wide area at the bottom of the window is the console. This is where error
messages will appear.
The large area to the right of the window is the editor area. When it comes to
drawing the schematic, this is where you will do it.
Select a Source Type of “Schematic” and enter “data_selector” in the File name
field and then click “Next.” A summary screen will appear, to which you can respond
by clicking “Finish.” This will result in a blank canvas being prepared for us in which
we can draw the schematic.
This is shown in Fig. 14.11, labelling the parts that you are going to need.
The icon menu bar running vertically to the left of the editor area controls the
mode of the window and also what appears on the left-hand side of the window:
• The top icon (an arrow) puts the window into select mode. You will need to click
on this before you can drag circuit symbols about or change their properties.
• Click on the “Add wire” mode when you are connecting the gates and other circuit
symbols together.
• IO markers are used to indicate the boundary between the schematic you are
designing and the actual pins of the FPGA IC. This mode lets you add these symbols.
• Add logic symbols. This is the mode selected in Fig. 14.11. The left hand panel then
divides into a top half that shows categories of circuit symbol and a bottom half
that has a list of the component symbols in that category.
Chapter 14: Programmable Logic 907
Initially, the connections are all given names like XLXN_1, etc. To change these
names to more meaningful names, change to “Select” mode, right-click on an IO
connector and chose the menu option “Rename Port.” Change the port names so that
they agree with Fig. 14.14.
Chapter 14: Programmable Logic 909
Notice that we have called the output Q. This is because the word “OUT” is
reserved for use by ISE, so you cannot call any of your connections “OUT” or you
will get an error when you try and build the project.
The schematic is now complete, and now would be a good time to do “File->Save”
to save the schematic design to file.
# Push buttons
NET “A” LOC = P80; # SW1
NET “B” LOC = P79; # SW2
NET “SEL” LOC = P78; # SW3
910 PRACTICAL ELECTRONICS FOR INVENTORS
# LED
NET “Q” LOC = P46; # LED8
The lines that begin with a # are comment lines. That is, like the lines of program
code starting with // in Arduino C take no part in the functioning of the program,
the lines starting with # are not part of the configuration information, they are just to
make it easier to see what is going on.
In the section that starts with “# Push Buttons” you can see the link between the
IO Connector names on the schematic and the FPGA GPIO pins that are connected to
the switches. So, SW1 is connected to P80, etc.
FIGURE 14.16 The switch and LED pin allocations for the Elbert V2.
Chapter 14: Programmable Logic 911