This is an old revision of the document!


Nexys4-DDR Advanced I/O Demo

Overview

Features Used

Not Used Used
16 user switches X
16 user LEDs X
Two tri-color LEDs X
5 User Push Buttons X
Two 4-digit 7-segment displays X
4 Pmod ports X
Pmod for XADC signals X
12-bit VGA output X
USB-UART Bridge X
Serial Flash for Application Data X
USB HID Host With Mouse X
USB HID Host With Keyboard X
Micro SD card connector X
PWM audio output X
PDM microphone X
3-axis accelerometer X
128MiB DDR2 X
Temperature sensor X
10/100 Ethernet PHY X

Description

The project represents the User Demo found on the Nexys4-DDR configuration and demonstrates usage of the VGA display in 1280 X 1024 mode, the Artix7 XADC, the Nexys4 onboard ADT7420 Temperature Sensor on Two-Wire Interface, the ADXL362 Accelerometer on SPI Interface, the PS2 interface, the RGB Leds, the ADMP421 Omnidirectional Microphone, Audio Output, the 16MB PSRAM Memory, user buttons, switches and LEDs.

The project was created under ISE 14.7 and then ported to Vivado 14.2

The behavior is as follows:

The project connects to the VGA display in a 1280*1024 resolution and displays various items on the screen:

  • a Digilent / Analog Devices logo
  • a mouse cursor, if a Usb mouse is connected to the board when the project is started
  • the audio signal from the onboard ADMP421 Omnidirectional Microphone
  • a small square representing the X and Y acceleration data from the ADXL362 onboard Accelerometer.The square moves according the Nexys4 board position. Note that the X and Y axes on the board are exchanged due to the accelerometer layout on the Nexys4 board.The accelerometer display also displays the acceleration magnitude, calculated asSQRT( X^2 + Y^2 +Z^2), where X, Y and Z represent the acceleration value on the respective axes
  • The FPGA temperature, the onboard ADT7420 temperature sensor temperature value and the accelerometertemperature value
  • The value of the R, G and B components sent to the RGB Leds LD16 and LD17

Other features:

  • The 16 Switches (SW0..SW15) are connected to LD0..LD15 except when audio recording is done
  • Pressing BTNL, BTNC and BTNR will toggle between Red, Green and Blue colors on LD16 and LD17 Color sweeping returns when BTND is pressed. BTND also togles between LD16, LD17, none or both
  • Pressing BTNU will start audio recording for about 5S, then the audio data will be played back on the Audio output. While recording, LD15..LD0 will show a progressbar moving to the right, while playing back, LD15..LD0 will show a progressbar moving to the left. Recorded audio data is stored in the onboard DDR2 memory.

Prerequisites

Skills

  • Basic familiarity with Vivado
    • This experience can be found by walking through our “Getting Started with Vivado” guide

Hardware

  • Basys3 FPGA board
  • Micro-USB cable
  • Headphones or speaker
  • Monitor with a VGA cable
  • USB mouse

Software

  • Vivado Design Suite 2015.X
    • Newer/older versions can be used, but the procedure may vary slightly

Downloads

Nexys4-DDR Support Repository – ZIP GIT Repo


How to...

1. Generate the Project

1.1) Download the repository linked in the download section and place it in the location of your choosing.
1.2) Generate the User_Demo project in the Projects folder by following this guide before continuing: How to Generate a Project from Digilent's Github

2. Build the Project

2.1) Click Generate Bitstream on the left hand menu towards the bottom. Vivado will run through both Run Synthesis and Run Implementation before it generates the bitstream automatically.

Note: If you want, you can click each step by itself in the order of Run Synthesis, Run Implementation and then Generate Bitstream.

3. Program the Board

3.1) Once you have generated your bit file, Click on the hardware manager and connect to your board by choosing the local server option.

3.2) Click program to load the project onto your Nexys4-DDR.

4. Run the Project

This portion will help you run the demo and observe all its features.

4.1) Using the Switches with Leds

For this section, all the switches are tied to their corresponding led. Every time a switch is toggled, the led directly above it will toggle with it. If the center push button is pressed, all the Leds will be tied to ground

4.2) Seven Segment Display

The 7-Segment display runs a constant snake pattern. There is no way to change this pattern with the Nexys4-DDR I/O.
4.3) Tri-color Leds and Push Buttons
The two tri-color leds are initially set to gradually change from red to green, then green to blue, then back to red. If the user pushed btnR, the leds are set to blue. If the user pushed btnC, the leds are set to green. If the user pushed btnL, the leds are set to red. Finally if the user pushed btnD, the leds return to their gradual change loop. If the User keeps pushing btnD, both leds will be isolated then both will be turned off.

4.4) Audio Recorder

If the user pushes btnU, an audio recording is started and data is taken from the omni-directional microphone. The data is stored into the DDR2 memory. While the recorder is recording, the leds will light up from left to right. After about five seconds, the audio will be read from DDR2 memory and played through the headphone jack. Leds will turn off from right to left.

4.5) VGA Output and Mouse Control

The project connects to the VGA display in a 1280*1024 resolution and displays various items on the screen:

* a Digilent / Analog Devices logo
* a mouse cursor, if a Usb mouse is connected to the board when the project is started
* the audio signal from the onboard ADMP421 Omnidirectional Microphone
* a small square representing the X and Y acceleration data from the ADXL362 onboard >Accelerometer.The square moves according the Nexys4 board position. Note that the X and Y axes on the board are exchanged due to the accelerometer layout on the Nexys4 board.The accelerometer display also displays the acceleration magnitude, calculated asSQRT( X^2 + Y^2 +Z^2), where X, Y and Z represent the acceleration value on the respective axes
* The FPGA temperature, the onboard ADT7420 temperature sensor temperature value and the accelerometertemperature value
* The value of the R, G and B components sent to the RGB Leds LD16 and LD17