Post Go back to editing

Square wave output using fmcdaq2

Dear EngineerZone community


Please support.

I am currently creating a communication system.
The concept is to generate an information signal with vc707 and output it as a Square wave from the DAC (ad 9144) of fmcdaq2. Then, the output Square wave is input to the modulator and communication is carried out.

Before that, I am trying to output a Square wave of 1 kHz (offset 0V) from DAC (AD9144) of fmcdaq2.
How can I do it?

Can you create a design as per the user guide and store a Square wave in the buffer?

I can use both Linux / no-OS.

Yuta

Parents Reply Children
  • Thank you,Andrei

    I am sorry for confusing you.I wanted to generate a square wave of 1 kHz because the modulator used operates by inputting a square wave of about 1 kHz to 2 kHz.

    However, since the ADC/DAC I have is fmcdaq2, I would like to know haw to output a 1 kHz Square wave using fmcdaq2.

    I'm sorry. I looked at https://ez.analog.com/fpga/f/q-a/81027/daq2-kcu105-send-data-to-dac and I saw the URL and could understand changing the filter of fmcdaq2, but I could not understand which part to change specifically.

    Please tell me.

    Yuta

  • You have 2 options:
    Add code in hdl to generate a square wave, you can use, change directly the dds.

    Replace the sine_lut from no-Os with your own square wave.
    https://github.com/analogdevicesinc/no-OS/blob/master/common_drivers/dac_buffer/dac_buffer.c

    Andrei

  • Thanks for the reply, Andrei.

    Sorry for the late reply.

    /***************************************************************************//**
     * @file dac_buffer.c
     * @brief Implementation of DAC LUT driver.
     * @author Istvan Csomortani (istvan.csomortani@analog.com)
     ********************************************************************************
     * Copyright 2014-2016(c) Analog Devices, Inc.
     *
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     * - Redistributions of source code must retain the above copyright
     * notice, this list of conditions and the following disclaimer.
     * - Redistributions in binary form must reproduce the above copyright
     * notice, this list of conditions and the following disclaimer in
     * the documentation and/or other materials provided with the
     * distribution.
     * - Neither the name of Analog Devices, Inc. nor the names of its
     * contributors may be used to endorse or promote products derived
     * from this software without specific prior written permission.
     * - The use of this software may or may not infringe the patent rights
     * of one or more patent holders. This license does not release you
     * from the requirement that you obtain separate licenses from these
     * patent holders to use this software.
     * - Use of the software either in source or binary form, must be run
     * on or directly connected to an Analog Devices Inc. component.
     *
     * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
     * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
     * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *******************************************************************************/
    #include "dac_buffer.h"
    
    /******************************************************************************/
    /******************************* Constant definitions *************************/
    /******************************************************************************/
    
    /* Sine Look Up Table */
    static const uint16_t sine_lut[1024] = {
    	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    	    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    	    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    		0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,
    		0x7FFF,0x7FFF,0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
    /******************************************************************************/
    /************************ Functions Definitions *******************************/
    /******************************************************************************/
    
    uint32_t dac_buffer_load(dac_core core, uint32_t start_address) {
    
    	uint32_t no_of_samples;
    	uint32_t index_i, index_q;
    	uint32_t index_mem = 0;
    
    	no_of_samples = sizeof(sine_lut) / sizeof(typeof(sine_lut[0]));
    
    	for (index_i = 0; index_i < no_of_samples; index_i++) {
    		 /* Phase shifted by 90 degree */
    		index_q = (index_i + 256) % no_of_samples;
    
    		switch (core.no_of_channels) {
    			case 1:
    				ad_reg_write_16(start_address + index_mem * 2, sine_lut[index_i]);
    				index_mem += 1;
    				break;
    			case 2:
    				ad_reg_write_16(start_address + (index_mem + 0) * 2, sine_lut[index_i]);
    				ad_reg_write_16(start_address + (index_mem + 1) * 2, sine_lut[index_q]);
    				index_mem += 2;
    				break;
    			case 4:
    				ad_reg_write_16(start_address + (index_mem + 0) * 2, sine_lut[index_i]);
    				ad_reg_write_16(start_address + (index_mem + 1) * 2, sine_lut[index_q]);
    				ad_reg_write_16(start_address + (index_mem + 2) * 2, sine_lut[index_i]);
    				ad_reg_write_16(start_address + (index_mem + 3) * 2, sine_lut[index_q]);
    				index_mem += 4;
    				break;
    			default:
    				ad_printf("Unsupported mode.\n\r");
    				return -1;
    		}
    	}
    
    	ad_dcache_flush();
    
    	return (core.no_of_channels * no_of_samples);
    }
    
    

    I replaced sine_lut of no-Os with its own square wave as shown in attached dac_buffer.c.

    However, as a result of executing with SDK, Sin waveform was output.

    The run console display is as follows.

    --------------------------------------------------------------------

    Available sampling rates:
    1 - ADC 1000 MSPS; DAC 1000 MSPS
    2 - ADC 500 MSPS; DAC 1000 MSPS
    3 - ADC 500 MSPS; DAC 500 MSPS
    4 - ADC 600 MSPS; DAC 600 MSPS
    choose an option [default 1]:
    3
    3 - ADC 500 MSPS; DAC 500 MSPS
    ad9144_setup : Device descriptor failed!

    CPLL ENABLE

    CPLL ENABLE
    Tx link is enabled
    Measured Link Clock: 125 MHz
    Link status: DATA
    SYSREF captured: Yes
    Rx link is enabled
    Measured Link Clock: 125 MHz
    Link status: DATA
    SYSREF captured: Yes
    adc_setup adc core initialized (500 MHz).
    dac_setup dac core initialized (500 MHz).
    daq2: setup and configuration is done
    daq2: RX capture done.

    --------------------------------------------------------------------

    How can I output square wave? Please tell me.

    Yuta

  • Hi, Andrei

    After commenting out #define DMA_BUFFER 0 of L70 in fmcdaq2.c, I changed #if DMA_BUFFER in L640 to #define DMA_BUFFER and commented out from #else in L618 to #endif in L624.

    After that, I ran make with no-OS/fmcdaq2/vc 707, and as a result of running with SDK, it was displayed on the console as follows.

    How can I solve it? please teach me.

    ----------------------------------------------------

    Available sampling rates:
    1 - ADC 1000 MSPS; DAC 1000 MSPS
    2 - ADC 500 MSPS; DAC 1000 MSPS
    3 - ADC 500 MSPS; DAC 500 MSPS
    4 - ADC 600 MSPS; DAC 600 MSPS
    choose an option [default 1]:
    4
    4 - ADC 600 MSPS; DAC 600 MSPS

    CPLL ENABLE
    xcvr_setup ERROR: XCVR initialization failed!

    CPLL ENABLE
    xcvr_setup ERROR: XCVR initialization failed!
    Tx link is disabled
    Measured Link Clock: off
    External reset is deasserted
    Rx link is disabled
    Measured Link Clock: off
    External reset is deasserted
    adc_setup adc core Status errors.
    dac_setup DAC Core Status errors.

    ----------------------------------------------------

  • That is a strange result.
    Correction, don't uncomment anything out, just change 0 to 1
    https://github.com/analogdevicesinc/no-OS/blob/master/fmcdaq2/fmcdaq2.c#L70

    Andrei

  • I just changed 0 to 1 of https://github.com/analogdevicesinc/no-OS/blob/master/fmcdaq2/fmcdaq2.c#L70.

    After that, I ran make with no-OS/fmcdaq2/vc 707, and as a result of running with SDK, it was displayed on the console as follows. The same error occurred

    How can I solve it? please teach me.

    ----------------------------------------------------

    Available sampling rates:
    1 - ADC 1000 MSPS; DAC 1000 MSPS
    2 - ADC 500 MSPS; DAC 1000 MSPS
    3 - ADC 500 MSPS; DAC 500 MSPS
    4 - ADC 600 MSPS; DAC 600 MSPS
    choose an option [default 1]:
    1
    1 - ADC 1000 MSPS; DAC 1000 MSPS
    xcvr_setup ERROR: XCVR initialization failed!
    xcvr_setup ERROR: XCVR initialization failed!
    Tx link is disabled
    Measured Link Clock: off
    External reset is deasserted
    Rx link is disabled
    Measured Link Clock: off
    External reset is deasserted
    adc_setup adc core Status errors.
    dac_setup DAC Core Status errors.

    ----------------------------------------------------

    Also, CDT Build Console is as shown below.Are these errors caused?

    ----------------------------------------------------


    18:15:33 **** Incremental Build of configuration Debug for project sw ****
    make all
    'Building file: ../src/ad9144.c'
    'Invoking: MicroBlaze gcc compiler'
    mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/ad9144.o" -I../../bsp/sys_mb/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v10.0 -mno-xl-soft-mul -mxl-multiply-high -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/ad9144.d" -MT"src/ad9144.o" -o "src/ad9144.o" "../src/ad9144.c"
    In file included from ../src/platform_drivers.h:47:0,
    from ../src/ad9144.c:46:
    ../src/config.h:70:9: error: expected declaration specifiers or '...' before string constant
    printf("\nWARNING no vendor defined in config.h (for carrier)\n");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/config.h:74:9: error: expected declaration specifiers or '...' before string constant
    printf("\nWARNING CPU arch defined in config.h\n");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../src/ad9144.c:46:0:
    ../src/ad9144.c: In function 'ad9144_spi_check_status':
    ../src/platform_drivers.h:111:23: warning: implicit declaration of function 'usleep' [-Wimplicit-function-declaration]
    #define mdelay(msecs) usleep(1000*msecs)
    ^
    ../src/ad9144.c:134:4: note: in expansion of macro 'mdelay'
    mdelay(1);
    ^~~~~~
    ../src/ad9144.c: In function 'ad9144_short_pattern_test':
    ../src/ad9144.c:528:50: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
    printf("%s : short-pattern-test mismatch (0x%x, 0x%x 0x%x, 0x%x)!.\n",
    ^
    ../src/ad9144.c:528:56: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
    printf("%s : short-pattern-test mismatch (0x%x, 0x%x 0x%x, 0x%x)!.\n",
    ^
    ../src/ad9144.c:528:61: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t {aka const long unsigned int}' [-Wformat=]
    printf("%s : short-pattern-test mismatch (0x%x, 0x%x 0x%x, 0x%x)!.\n",
    ^
    make: *** [src/ad9144.o] error 1

    18:15:38 Build Finished (took 4s.496ms)

     ----------------------------------------------------

  • Hi,

    What other changes have you made to the code?

    I see:
    ../src/config.h:70:9: error: expected declaration specifiers or '...' before string constant
    printf("\nWARNING no vendor defined in config.h (for carrier)\n");
    https://github.com/analogdevicesinc/no-OS/blob/master/fmcdaq2/config.h#L69

    The in the make flow the XILINX, ZYNQ... are predefined https://github.com/analogdevicesinc/no-OS/blob/master/scripts/zynq.mk#L39

    There is something wrong with your build.

    See: https://wiki.analog.com/resources/fpga/quick_validation

    Andrei

  • Try not to use DEBUG, there will be conflicts with some xilinx files.

    Andrei

  • Hi,Andrei

    I changed sin_lut in dac_buffer.c and changed DMA_BUFFER in fmcdaq 2.c from 0 to 1.

    Other programs have not changed anything.