0%
0%

# Programming the DE0 Nano for the first time.

'Hello World' for the DE0 Nano.

Similar projects worth following
3.2k views
A simple circuit for an intro to the Altera Cyclone IV on the DE0 Nano.

So, the first first lab in the class that deals with drawing circuits is a couple of XOR circuits, but that is as good a place to start as any.

The circuits:

XOR 1

XOR 2

Using Digital Works Lab

The Logic:

 XOR 1 A B ¬A ¬B A∧¬B ¬A∧B (A∧¬B)∨(¬A∧B) 1 1 0 0 0 0 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 0
 XOR 2 A B ¬A ¬B ¬A∨¬B A∨B (¬A∨¬B)∧(A∨B) 1 1 0 0 0 1 0 1 0 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 0

The Simulation:

TKGate

Digital Works

*TKGate is definitely not a perfect program. I tested it on one computer, and it ran so slowly that it was essentially unusable, and on another system it seemed to work well, but it would occasionally crash. So regardless of the software being used save early and save often. I was also able to use Digital Works on ubuntu running it under wine.

For me designing the circuits in these simulators was a great place to start.

.......................................................................................................................................................................

Programming the DE0 Nano:

Here I will detail the steps that I took in order to program the DE0 Nano with the XOR circuits. Because DE0 Nano development board only has two buttons I tied the circuits together, and also keep in mind that the logic is inversed because the switches are normally high and go low when pushed (double check and re-verify this).

Below is the circuit that the fpga will be programmed with.

A pinout with names correlating to the DE0 Nano Documentation and an example qsf file can be found in the project logs.

Ubuntu Step 1) Make sure that the USB-Blaster is working.

Step 2) Create Project

Step 3) Make the Pin Assignments and Draw the Cirucit

Step 4) Handle a compilation error.

Step 5) Program the DE0 Nano.

This simple example will only load the program to the FPGA, and will run so long as power is not cycled. If power is cycled the default program from the EPCS will be loaded.

• 1 × DE0 Nano Educational FPGA
• 1 × Linux PC with TKGate or Windows PC with Digital Works
• 1 × Quartus II Web Edition

• ### Some Global Settings & IO Standard

 Globals FAMILY "Cyclone IV E" DEVICE EP4CE22F17C6 DEVICE_FILTER_PACKAGE FBGA DEVICE_FILTER_PIN_COUNT 256 Other IO_STANDARD "3.3-V LVTTL" *This should be the setting for all pins

• ### GPIO0

Here the pin name is prefixed with the letter 'a', but this can be changed to anything unique.

 GPIO0 Pin Name PIN_A8 a_IN[0] PIN_D3 a[0] PIN_B8 a_IN[1] PIN_C3 a[1] PIN_A2 a[2] PIN_A3 a[3] PIN_B3 a[4] PIN_B4 a[5] PIN_A4 a[6] PIN_B5 a[7] PIN_A5 a[8] PIN_D5 a[9] PIN_B6 a[10] PIN_A6 a[11] PIN_B7 a[12] PIN_D6 a[13] PIN_A7 a[14] PIN_C6 a[15] PIN_C8 a[16] PIN_E6 a[17] PIN_E7 a[18] PIN_D8 a[19] PIN_E8 a[20] PIN_F8 a[21] PIN_F9 a[22] PIN_E9 a[23] PIN_C9 a[24] PIN_D9 a[25] PIN_E11 a[26] PIN_E10 a[27] PIN_C11 a[28] PIN_B11 a[29] PIN_A12 a[30] PIN_D11 a[31] PIN_D12 a[32] PIN_B12 a[33]

• ### GPIO1

Here the pin name is prefixed with the letter 'b', but this can be changed to anything unique.

 GPIO1 Pin Name PIN_T9 b_IN[0] PIN_F13 b[0] PIN_R9 b_IN[1] PIN_T15 b[1] PIN_T14 b[2] PIN_T13 b[3] PIN_R13 b[4] PIN_T12 b[5] PIN_R12 b[6] PIN_T11 b[7] PIN_T10 b[8] PIN_R11 b[9] PIN_P11 b[10] PIN_R10 b[11] PIN_N12 b[12] PIN_P9 b[13] PIN_N9 b[14] PIN_N11 b[15] PIN_L16 b[16] PIN_K16 b[17] PIN_R16 b[18] PIN_L15 b[19] PIN_P15 b[20] PIN_P16 b[21] PIN_R14 b[22] PIN_N16 b[23] PIN_N15 b[24] PIN_P14 b[25] PIN_L14 b[26] PIN_N14 b[27] PIN_M10 b[28] PIN_L13 b[29] PIN_J16 b[30] PIN_K15 b[31] PIN_J13 b[32] PIN_J14 b[33]

(Better map, this is wierd.)

 2x13 GPIO Header Pin Name PIN_A14 GPIO_2[0] PIN_B16 GPIO_2[1] PIN_C14 GPIO_2[2] PIN_C16 GPIO_2[3] PIN_C15 GPIO_2[4] PIN_D16 GPIO_2[5] PIN_D15 GPIO_2[6] PIN_D14 GPIO_2[7] PIN_F15 GPIO_2[8] PIN_F16 GPIO_2[9] PIN_F14 GPIO_2[10] PIN_G16 GPIO_2[11] PIN_G15 GPIO_2[12] PIN_E15 GPIO_2_IN[0] PIN_E16 GPIO_2_IN[1] PIN_M16 GPIO_2_IN[2]

• ### SDRAM

Here the outline for the SDRAM is barely visible, the chip is on the underside of the board.

• ### EPCS

 EPCS Pin Name PIN_H2 EPCS_DATA0 PIN_H1 EPCS_DCLK PIN_D2 EPCS_NCSO PIN_C1 EPCS_ASDO

• ### Accelerometer & EEPROM

(Why are these tied together? Implications?)

 Accelerometer & EEPROM Pin Name PIN_F2 I2C_SCLK PIN_F1 I2C_SDAT PIN_G5 G_SENSOR_CS_N PIN_M2 G_SENSOR_INT

• ### Switch

 Switch (DIP Switch) Pin Name PIN_M1 SW[0] PIN_T8 SW[1] PIN_B9 SW[2] PIN_M15 SW[3]

• ### Key's

 Key (Push Button) Pin Name PIN_J15 KEY[0] PIN_E1 KEY[1]

Share

# Does this project spark your interest?

Become a member to follow this project and never miss any updates