Basys 3 XADC Demo

Overview

Description

This simple XADC Demo project demonstrates a simple usage of the Basys3's XADC port capability. The behavior is as follows:

  • Voltage levels between 0 and 1 Volt are read off of the JXADC header.
  • The 16 User LEDs increment from right to left as the voltage difference on the selected XADC pins gets larger.
  • The two 7-segment displays show the voltage difference on the AD6, AD7, AD14, AD15 pins in volts.
  • SW0 and SW1 select which XADC channel is displayed.

Features Used

Not Used Used
16 User Switches X
16 User LEDs X
5 User Push Buttons X
4-digit 7-Segment Display X
4 Pmod Connectors X
XADC Analog Input 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

A Note About The XADC Port

On the Basys3, the XADC Pmod connector houses 4 differential analog pairs. The corresponding XADC channels are 6, 7, 14, and 15. Below is a picture of the pinout of the Pmod Header.

The differential pairs are grouped by columns. Looking at the number above, 1 corresponds to XA1_P and XA1_N, column 2 routes to XA2_P and XA2_N, 3 routes to XA3_P and XA3_N, and 4 routes to XA4_P and XA4_N. Below is from the Basys3 schematics that will show the internal connections of these signals.

From the schematic we can see XA1 is connected to XADC channel 6, XA2 is connected to XADC channel 14, XA3 is connected to XADC channel 7, and XA4 is connected to XADC channel 15.


Prerequisites

Skills

Hardware

  • Basys3 FPGA board
  • Micro-USB cable
  • Wires and a voltage to measure

Software

  • Vivado Design Suite 2016.4
    • Newer versions can be used, but the procedure may vary slightly

Downloads

Basys 3 Support Repository – ZIP Archive GIT Repo


Download and Launch the Basys 3 XADC Demo

Follow the Using Digilent Github Demo Projects Tutorial. This is an HDL design project, and as such does not support Vivado SDK. Select the tutorial options appropriate for a Vivado-only design. As you can connect your test circuit to your Basys 3 after the demo is running, you do not need to return to this guide when prompted to check for additional hardware requirements and setup.

Using the Basys 3 XADC Demo

1. Applying a voltage to the XADC port

For this demo, the AD6, 7, 14 and 15 pins are used on the JXADC header. We hooked up a signal generator to our pins. All of the other pins were grounded to avoid coupling.

2. Seven Segment Display and LEDs

The 7-Segment display shows the current voltage across the selected XADC pins. The LEDs turn on from right to left as the input voltage increases.

3. Selecting a Channel

To display a different channel on the 7-segment display and LEDs change SW0 and SW1 to select the desired channel as seen in the table below.
Channel Number SW0 Position SW1 Position
XA1 Down Down
XA2 Up Down
XA3 Down Up
XA4 Up Up