This project demoinstrates how to use the ZmodDAC with the USB104A7 board. This demo comes in two parts, the FPGA project and the PC console application. Vivado is used to build the hardware platform and Xilinx SDK is used to program the microblaze processor with the demo C/C++ application. The DPTI port provides a USB connected synchronous FIFO interface between the PC software and FPGA logic. This interface connection is used to upload waveforms to the device and control the ZmodDAC.
Waveform .csv files generated by the Digilent Waveforms application can be sent using the write command. The waveform file is expected to be any number of samples separated by newlines. Sample values are expected to be weight values between -1 and 1. The console application has several commands to control the ZmodDAC.
| Command | Function |
|---|---|
| write <path to .csv> | Writes a waveform .csv to the device. These waveforms can be generated using Digilent Waveforms |
| start | Starts the ZmodDAC. |
| stop | Stops the ZmodDAC (Currently unavailable) |
| div <divider value> | Divides the output sample rate |
| gain <low, high, 0, 1> | Sets the gain high or low |
| ch1 | Set active ZmodDAC channel to channel 1 |
| ch2 | Set active ZmodDAC channel to channel 2 |
For more information see the USB104A7 ZmodDAC Demo Wiki.
- USB104A7: To purchase a USB104A7, see the Digilent Store
- Vivado 2019.1 Installation with Xilinx SDK: To set up Vivado, see the Installing Vivado and Digilent Board Files Tutorial.
- Adept Runtime: Download links available on the Adept Wiki
- Serial Terminal Emulator Application (Optional): For more information see the Installing and Using a Terminal Emulator Tutorial.
- USB A Cable
- 5V DC Adapter
- Visual Studio Code Installed (Optional) : Used to build the console application.
- gcc compiler (mingw or linux) in path (Optional) : Used to build the console application. On windows, gcc can be installed through mingw.
- Download the most recent release ZIP archive ("USB104A7-ZmodDAC-*.zip") from the repo's releases page.
- Extract the downloaded ZIP.
- Open the XPR project file, found at <archive extracted location>/FPGA/vivado_proj/USB104A7_ZmodDAC_Demo.xpr, included in the extracted release archive in Vivado 2019.1.
- Launch Xilinx SDK directly (not through the Vivado file menu). When prompted for a workspace, select "<archive extracted location>/sdk_workspace".
- Once the workspace opens, click the Import button. In the resulting dialog, first select Existing Projects into Workspace, then click Next. Navigate to and select the same sdk_workspace folder.
- Build the project. Note: Errors are sometimes seen at this step. These are typically resolved by right-clicking on the BSP project and selecting Regenerate BSP Sources.
- Plug the ZmodDAC into the USB104A7 Syzygy port. Plug in the 5v DC adapter and connect the USB104A7 to the PC using the USB cable.
- Open a serial terminal application (such as TeraTerm and connect it to the USB104A7's serial port, using a baud rate of 115200.
- In the toolbar at the top of the SDK window, select Xilinx -> Program FPGA. Leave all fields as their defaults and click "Program".
- In the Project Explorer pane, right click on the "USB104A7_ZmodDAC_Demo" application project and select "Run As -> Launch on Hardware (System Debugger)".
- The application will now be running on the USB104A7. It can be interacted with as described in the first section of this README.
- Lastly, the hardware platform must be linked to a hardware handoff, so that changes to the Vivado design can be brought into the SDK workspace. In Vivado, in the toolbar at the top of the window, select File -> Export -> Export Hardware. Any Exported Location will do, but make sure to remember the selection, and make sure that the Include bitstream box is checked. Click OK.
- In SDK, right click on the *hw_platform* project, and select Change Hardware Platform Specification. Click Yes in response to the warning. In the resulting dialog, navigate to and select the .hdf hardware handoff file exported in the previous step, then click OK. Now, whenever a modified design is exported from Vivado, on top of the .hdf file, it can be applied to the hardware platform.
- Open Visual Studio Code.
- Open the folder containing the Console Application in visual studio code, found at <archive extracted location>/DPTI_App/DPTITransferWaveform.
- To build, click Terminal -> Run Build Task. This will run the build task found in tasks.json. This will run "gcc USB104A7_ZmodDACDemoApp.c -g3 -O0 -o <dir>\USB104A7_ZmodDACDemoApp.exe -L./ -ldpti -ldmgr" NOTE: The linux dpti and dmgr shared objects can be downloaded from the Adept 2 wiki page under Runtime - Latest Downloads.
This demo can be used as a basis for other projects by modifying the hardware platform in the Vivado project's block design or by modifying the SDK application project.
Check out the USB104A7's Resource Center to find more documentation, demos, and tutorials.
For technical support or questions, please post on the Digilent Forum.
For more information on how this project is version controlled, refer to the digilent-vivado-scripts repo.