This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:fpga:xilinx:pmod:ad7303 [10 Apr 2012 17:04] – [Running Demo (SDK) Program] Andrei Cozma | resources:fpga:xilinx:pmod:ad7303 [09 Jan 2021 00:49] (current) – user interwiki links Robin Getz | ||
---|---|---|---|
Line 8: | Line 8: | ||
Two reference designs are available for this part: | Two reference designs are available for this part: | ||
* A design which shows how to used the **AD7303 DAC** by outputting square and a sawtooth waveforms | * A design which shows how to used the **AD7303 DAC** by outputting square and a sawtooth waveforms | ||
- | | + | |
- | * **System:** Microblaze, AXI, UART \\ | + | |
+ | * [[http:// | ||
+ | * [[http:// | ||
* A design which demonstrates how to acquire a signal and reproduce it using Digilent PmodAD1 and PmodDA1. Four types of waveforms (Square, Sine, Sawtooth and Triangle) are generated using the **AD7303 DAC** present on the PmodDA1 board. Each waveform has a period of 25 ms, and lasts for 25 s (1000 periods). A loopback cable is connected between the output of the **AD7303 DAC** and the input of the **AD7476 ADC** present on the PmodAD1 board. The Xilinx ChipScope Analyzer tool is used to verify the digitized waveforms. | * A design which demonstrates how to acquire a signal and reproduce it using Digilent PmodAD1 and PmodDA1. Four types of waveforms (Square, Sine, Sawtooth and Triangle) are generated using the **AD7303 DAC** present on the PmodDA1 board. Each waveform has a period of 25 ms, and lasts for 25 s (1000 periods). A loopback cable is connected between the output of the **AD7303 DAC** and the input of the **AD7476 ADC** present on the PmodAD1 board. The Xilinx ChipScope Analyzer tool is used to verify the digitized waveforms. | ||
- | * **HW Platform(s): | + | * **HW Platform(s): |
- | | + | |
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | | ||
====== AD7303 Pmod Reference Design ====== | ====== AD7303 Pmod Reference Design ====== | ||
Line 19: | Line 24: | ||
The bit file provided in the project *.zip file combines the FPGA bit file and the SDK elf files. It may be used for a quick check on the system. All you need is the hardware and a PC running a UART terminal and the programmer (IMPACT). | The bit file provided in the project *.zip file combines the FPGA bit file and the SDK elf files. It may be used for a quick check on the system. All you need is the hardware and a PC running a UART terminal and the programmer (IMPACT). | ||
+ | |||
==== Required Hardware ==== | ==== Required Hardware ==== | ||
- | * [[http://www.xilinx.com/products/ | + | * [[xilinx>products/ |
+ | * [[http:// | ||
+ | * [[http:// | ||
* [[http:// | * [[http:// | ||
==== Required Software ==== | ==== Required Software ==== | ||
- | * Xilinx ISE 13.2 (Programmer (IMPACT) is sufficient for the demo and is available on Webpack). | + | * Xilinx ISE 14.4 (Programmer (IMPACT) is sufficient for the demo and is available on Webpack). |
+ | * A UART terminal (Tera Term/ | ||
==== Running Demo (SDK) Program ==== | ==== Running Demo (SDK) Program ==== | ||
- | <note tip>If you are not familiar with LX9 and/or Xilix tools, please visit\\ [[http://www.xilinx.com/products/ | + | <WRAP center round tip 80%>If you are not familiar with LX9 and/or Xilix tools, please visit\\ [[xilinx>products/ |
- | </note> | + | If you are not familiar with Nexys™3 and/or Xilix tools, please visit\\ [[http:// |
- | Extract the project from the archive file (AD7303.zip) to the location | + | If you are not familiar with ZedBoard and/or Xilix tools, please visit\\ [[http:// |
- | To begin, connect the PmodDA1 to J4 connector of LX9 board, pins 1 to 6 (see image below). You can use an extension cable for ease of use. Connect the USB cables | + | ==== Avnet LX9 MicroBoard Setup ==== |
+ | |||
+ | Extract the project from the archive file (AD7303_< | ||
+ | |||
+ | To begin, connect the PmodDA1 to J4 connector of LX9 board, pins 1 to 6 (see image below). You can use an extension cable for ease of use. Connect the USB cable from the PC to the USB-UART female connector of the board for the UART terminal. The board will be programmed through its USB male connector. | ||
{{: | {{: | ||
- | Start IMPACT, and double click " | + | ==== Digilent Nexys™3 |
- | {{: | + | Extract the project from the archive file (AD7303_< |
- | After programming | + | To begin, connect |
- | {{: | + | {{: |
+ | ==== Avnet ZedBoard ==== | ||
+ | |||
+ | To begin, connect the PmodDA1 to JD connector of ZedBoard (see image below). You can use an extension cable for ease of use. Connect the USB cables from the PC to the board, one for programming (Digilent USB device) and one for the UART terminal (FT232R USB UART). | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== FPGA Configuration for Nexys3 and LX-9 MicroBoard ==== | ||
+ | |||
+ | Start IMPACT, and double click " | ||
+ | |||
+ | If programming was successful, the **Main Menu** will apear in your UART terminal, as seen in the picture below. | ||
+ | There are 3 options: | ||
+ | * Press **[f]** to select **Fixed Value Mode**. | ||
+ | * Press **[w]** to select **Waveform Generation Mode**. | ||
+ | * Press **[g]** to select **Programmable Ramp Signal Generator**. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | When entering **Fixed Value Mode**, DAC selection is automatically activated. Selecting the DAC is done by pressing **[1]** to **[4]**. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Fixed Value Mode** allows entering a value between **0x00** and **0xFF**, value that will be programmed in the DAC. If the number of input characters is less than 2 (e.g. f or 7), the **[Enter]** key must be pressed in order to validate the input. If 2 characters are input, the value is automatically validated (in order to prevent entering more than 2 characters). Pressing the **[s]** key at any time will enter DAC Selection Mode. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Pressing the **[q]** key at any time exits the Fixed Value (or Waveform Generation) Mode and displays the **Main Menu** again. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | When entering **Waveform Generation Mode**, DAC selection is automatically activated. Selecting the DAC is done by pressing **[1]** to **[4]**. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Waveform Generation Mode** allows selecting between 4 types of waveforms: **Square**, **Triangle**, | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Programmable Ramp Signal Generator** allows generating a programmable ramp signal. This mode can be used to test the PmodDA1 using a Digital Multimeter. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Enter time step** allows setting a time step between **100** and **5000** ms. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Enter increment size** allows selecting an increment size that suits your design. Values can vary from **0x00** to **0xFF**. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Select DAC** allows selecting which DAC Output will be used for the Ramp Signal Generation. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Run Ramp Signal Generator** will start generating the desired output. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ==== FPGA Configuration for ZedBoard ==== | ||
+ | |||
+ | Run the **download.bat** script from the " | ||
+ | The script will automatically configure the ZYNQ SoC and download the *.elf file afterwards. | ||
+ | |||
+ | <WRAP center round tip 80%> | ||
+ | If the download script fails to run, modify the Xilinx Tools path in **download.bat** to match your Xilinx Installation path. | ||
+ | </ | ||
+ | |||
+ | If programming was successful, you will be able to see a Triangle Waveform output on A1 and a Sine Waveform output on B1. | ||
Line 49: | Line 131: | ||
==== Functional Description ==== | ==== Functional Description ==== | ||
+ | |||
+ | === Avnet LX-9 MicroBoard and Digilent Nexys3 === | ||
The reference design is a simple SPI interface with two MOSI pins for the PmodDA1. The software programs the device sending an 8-bit configuration value followed by 8-bit data value. | The reference design is a simple SPI interface with two MOSI pins for the PmodDA1. The software programs the device sending an 8-bit configuration value followed by 8-bit data value. | ||
Line 54: | Line 138: | ||
The hardware SPI access allows writing data to the AD7303, using a single CS and SCLK pins, and two MOSI pins (PmodDA1 contains two AD7303 Integrated Circuits, which share the same CS and SCLK pins, but have separate MOSI pins). | The hardware SPI access allows writing data to the AD7303, using a single CS and SCLK pins, and two MOSI pins (PmodDA1 contains two AD7303 Integrated Circuits, which share the same CS and SCLK pins, but have separate MOSI pins). | ||
- | <note important> | + | === Avnet ZedBoard === |
- | * Connecting the PmodDA1 to the LX-9 Board using an extension cable provides ease of use. | + | |
- | * If you desire | + | The reference design is a simple SPI interface with two MOSI pins for the PmodDA1. The software programs the device sending an 8-bit configuration value followed by 8-bit data value. |
- | </note> | + | |
+ | The hardware SPI access allows writing data to the AD7303, using a single CS and SCLK pins, and two MOSI pins (PmodDA1 contains two AD7303 Integrated Circuits, which share the same CS and SCLK pins, but have separate MOSI pins). | ||
+ | |||
+ | For the ZedBoard, DMA is used to send data from DDR to the AD7303 IP Core, outputting a triangle waveform and a sine waveform. | ||
+ | |||
+ | <WRAP round important | ||
+ | \\ | ||
+ | * Connecting the PmodDA1 to the boards | ||
+ | * UART must be set to 115200 Baud Rate for the Avnet LX-9 Microboard and ZedBoard | ||
+ | \\ | ||
+ | </WRAP> | ||
===== Downloads ===== | ===== Downloads ===== | ||
- | {{: | ||
- | ====== AD7303 Pmod and AD7476 Pmod Reference | + | <WRAP round download 80%> |
+ | \\ | ||
+ | **Avnet LX-9 MicroBoard: **\\ | ||
+ | * {{: | ||
- | ===== Quick Start Guide ===== | + | **Digilent Nexys™3: |
+ | * {{: | ||
- | The bit file provided in the project | + | **Avnet ZedBoard: |
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | </ | ||
+ | <wrap hide> | ||
+ | ====== Linux Device Driver ====== | ||
- | ==== Required Hardware ==== | + | Connect PmodDA1 to the JB1 connector of the ZedBoard |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | ==== Required Software | + | ===== Preparing the SD Card ===== |
- | * Xilinx 13.2 Design Suite (contains ISE, XPS, SDK and ChipScope Pro). | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
+ | In order to prepare the SD Card for booting Linux on the ZedBoard: | ||
+ | * Download the device tree: [[https:// | ||
+ | * Follow the instructions on the following wiki page, but use the device tree downloaded on the previous step | ||
+ | * [[/ | ||
- | ==== Running Demo (SDK) Program ==== | + | Make sure you have an HDMI monitor connected to the ZedBoard, plug in the SD Card and power on the board. |
+ | If everything is correct, the system should boot up. If you don't have an HDMI monitor, connect to the board via UART, Baud Rate 115200. | ||
- | <note tip>If you are not familiar with Nexys3 and/or Xilix tools, please visit\\ [[http:// | + | There are 2 ways to test the driver. |
- | </ | + | * Using the terminal window |
+ | * Using the ADI IIO Oscilloscope | ||
- | To begin, connect | + | ===== Using the terminal window ===== |
- | {{ : | + | Open a new terminal window by pressing **Ctrl+Alt+T**. |
- | Start IMPACT, and double click " | + | Navigate to the location of the device |
+ | < | ||
+ | cd /sys/bus/iio/devices/ | ||
+ | ls | ||
+ | iio:device0 iio:device1 trigger0 | ||
+ | cd iio\: | ||
+ | cat name | ||
+ | ad7303 | ||
+ | </code> | ||
- | {{:resources:fpga: | + | If the **cat name** command doesn' |
+ | < | ||
+ | cd .. | ||
+ | cd iio\:device1 | ||
+ | cat name | ||
+ | </ | ||
- | Start the ChipScope Pro Analyzer provided with the Xilinx ISE Design Suite 13.2 and load the project | + | To see the list of options that the AD7303 driver provides, type: |
+ | < | ||
+ | ls | ||
+ | buffer | ||
+ | dev | ||
+ | name out_voltage1_powerdown | ||
+ | </code> | ||
- | {{:resources: | + | To set the raw output voltage, type: |
+ | < | ||
+ | echo 120 > out_voltage0_raw | ||
+ | </ | ||
- | <note important> | + | To check that the raw output voltage has been set, you can type: |
- | * Connecting the Pmod-AD1 and/or Pmod-DA1 to the Nexys3 Board using an extension cable provides ease of use. | + | <code> |
- | * UART must be set to 57600 baudrate. | + | cat out_voltage0_raw |
- | * The reference voltage for both the AD7476A and AD7303 is 3.3V (if using Nexys3 Board). | + | 120 |
- | </note> | + | </code> |
- | ===== Downloads ===== | + | |
- | {{: | + | |
+ | If you want to set the voltage for the second channel, replace out_voltage0_raw with out_voltage1_raw. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The commands written above can also be used if not using an HDMI monitor and a wireless keyboard, by using a serial terminal, and typing the commands after the system boot-up is complete. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===== Using the ADI IIO Oscilloscope ===== | ||
+ | |||
+ | Install the ADI IIO Oscilloscope using the instructions from the following wiki page: | ||
+ | * [[/ | ||
+ | |||
+ | Launch the ADI IIO Oscilloscope. | ||
+ | |||
+ | Open the **Settings** menu and select **Impulse generator** submenu. A popup window will appear and allow you to select an impulse generator (a high resolution timer) and its frequency. The conversions for both the ADC and the DAC are started by the impulses of the generator. Click the **OK** button. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | If the **Impulse generator** option is not available, you can configure the timer manually using the following commands: | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | ls | ||
+ | iio: | ||
+ | cd trigger0 | ||
+ | echo 1000 > frequency | ||
+ | cat frequency | ||
+ | 1000 | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Select **AD7303** tab from the top options. Click on **Single value output**, type in the desired value, and click **Save** at the bottom of the window. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Select **AD7303** tab from the top options. Click on **Waveform output**, select the type of waveform, configure the desired **Amplitude**, | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ====== AD7303 Pmod and AD7476 Pmod Reference Design ====== | ||
+ | {{page> | ||
+ | </ | ||
====== More information ====== | ====== More information ====== | ||
* [[ez> | * [[ez> | ||
+ | * Example questions: {{rss> |