Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
resources:no-os:dac_dma_example [18 Mar 2021 08:51] – created Darius Bresources:no-os:dac_dma_example [29 Mar 2024 19:44] (current) – Specified the number of channels to be plotted iulia Moldovan
Line 1: Line 1:
-===== DAC_DMA_EXAMPLE demo =====+===== DMA_EXAMPLE demo =====
  
-DAC_DMA_EXAMPLE is a standard example, provided in all no-OS projects, that sends a sinewave on Tx channels using DMA from a lookup table. If you physically loopback a Tx channel to an Rx channel via an electrical wire, you may run the DAC_DMA_EXAMPLE and read the received data at a predefined DDR memory address. You may retrieve the data on the computer for processing/plotting either graphically by using the memory viewer of the SDK or via command line using tickle scripts.+DMA_EXAMPLE is a standard example that sends a sinewave on Tx channels using DMA from a lookup table. If you physically loopback a Tx channel to an Rx channel via an electrical wire, you may run the DMA_EXAMPLE and read the received data at Rx from particular memory address.  
 + 
 +To build the DMA_EXAMPLE demo, edit the Makefile and add **-DDMA_EXAMPLE** to CFLAGS and rebuild. Alternatively, you may simply add **#define DMA_EXAMPLE** in a suitable place in code and rebuild. 
 + 
 +To run the DMA_EXAMPLE, you simply need to run the application as usual by: 
 +  *  making sure it was built with the **DMA_EXAMPLE** flag, as already mentioned 
 +  *  monitoring the serial terminal for messages printed by the application 
 + 
 +The application will eventually print something like this: 
 +<code> 
 +DMA_EXAMPLE: address=0x7f170 samples=65536 channels=4 bits=16 
 +</code> 
 + 
 +This means that the memory address where the data at Rx is stored is 0x7f170, there are in total 65536 samples, 16-bit wide across 4 channels, which is equivalent to 16384, 16-bit samples per channel. 
 + 
 +At this point you may use a Tcl script to retrieve data from memory and store it into .csv files for processing. In the terminal where you built the project, run the following command while being in the no-OS/projects///project_name// folder 
 +<code> 
 +for Zynq-7000: 
 +xsct ../../tools/scripts/platform/xilinx/capture.tcl ZYNQ_PS7 0x7f170 65536 4 16 
 + 
 +for ZynqMP: 
 +xsct ../../tools/scripts/platform/xilinx/capture.tcl ZYNQ_PSU 0x7f170 65536 4 16 
 + 
 +for Versal: 
 +xsct ../../tools/scripts/platform/xilinx/capture.tcl VERSAL 0x7f170 65536 4 16 
 +</code> 
 + 
 +After running the xsct command, some .csv files will be created in your directory. Now you need to run the Python script for plotting, specifying the number of channels you want to plot, like this: 
 + 
 +<code> 
 +python3 ../../tools/scripts/platform/xilinx/plot.py 4 
 +</code> 
 + 
 +and a plot window will open showing the Rx channels.
  
-To build the DAC_DMA_EXAMPLE demo, edit the Makefile and add **-DDAC_DMA_EXAMPLE** to CFLAGS and rebuild. Alternatively, you may simply add a **#define DAC_DMA_EXAMPLE** in-code and rebuild. 
resources/no-os/dac_dma_example.1616053913.txt.gz · Last modified: 18 Mar 2021 08:51 by Darius B