AnsweredAssumed Answered

AD9361 DAC multiple LUT synchronisation

Question asked by smoki on Dec 15, 2015
Latest reply on Dec 15, 2015 by smoki

Hi all,

 

I'm working with AD9361 integrated with Xilinx ZedBoard using No-Os driver.

 

I'm trying to synchronize sending two different LUT on DAC using AD9361 module. I stored two LUT with 1024 sine wave samples on two different positions in memory. Also, configured ISR for DAC to be triggered when SOT happens.

I'm trying to send one LUT1 on DAC 1000 times(integer counter counts to 1000), and than to switch LUT to send another LUT2 and to repeat those steps continiously.

I did it by counting how many times ISR happens and than switch LUT by calling:

dac_dma_write(AXI_DMAC_REG_SRC_ADDRESS, DAC_DDR_BASEADDR_LUT_2);

 

My dac configuration in dac_init() is:

dac_dma_write(AXI_DMAC_REG_CTRL, 0);

dac_dma_write(AXI_DMAC_REG_CTRL, AXI_DMAC_CTRL_ENABLE);

dac_dma_write(AXI_DMAC_REG_FLAGS, 0);                              

dac_dma_write(AXI_DMAC_REG_IRQ_MASK, AXI_DMAC_IRQ_EOT);            

dac_dma_write(AXI_DMAC_REG_SRC_ADDRESS, DAC_DDR_BASEADDR_LUT_1);

dac_dma_write(AXI_DMAC_REG_SRC_STRIDE, 0x0);

dac_dma_write(AXI_DMAC_REG_X_LENGTH, length - 1);

dac_dma_write(AXI_DMAC_REG_Y_LENGTH, 0x0);

dac_dma_write(AXI_DMAC_REG_START_TRANSFER, 0x1);

 

ISR:

void DmaDoneHandler(unsigned int Channel, XDmaPs_Cmd *DmaCmd, void *CallbackRef)

{

    uint32_t     reg_val        = 0;

 

    dac_dma_read(AXI_DMAC_REG_IRQ_PENDING, &reg_val);                           

    dac_dma_write(AXI_DMAC_REG_IRQ_PENDING, reg_val);                          

 

    if((interruptCounter++) == 1000)

    {

        if(sin == 1)

        {

        dac_dma_write(AXI_DMAC_REG_SRC_ADDRESS, DAC_DDR_BASEADDR_LUT_2);      

        }

        else

        {

        dac_dma_write(AXI_DMAC_REG_SRC_ADDRESS, DAC_DDR_BASEADDR_LUT_1);

        }

 

        interruptCounter = 0;

        sin *= -1;

    }

  

    dac_dma_write(AXI_DMAC_REG_START_TRANSFER, 0x1);

}

 

My question is, is this good approach? Also, I need to accomplish that time of switching of those LUTs is less than 200ns(5MHz)

so if you have any suggestions how to implement this I'll be grateful!

 

One more thing. At one moment this worked fine for LUT with 32 samples, then I just changed LUT on 1024 samples and it stopped working.Any clue what could be the problem?

 

Best regards,

Nemanja

Outcomes