Results 1 to 4 of 4

Thread: Need SPI core variant advice - Altera FPGA development kit '3-wire DAC'

  1. #1
    Join Date
    Apr 2017
    Posts
    50
    Rep Power
    1

    Default Need SPI core variant advice - Altera FPGA development kit '3-wire DAC'

    I need to write to the 3 pin SPI DAC on Intel Max10 FPGA Development Kit from C using NIOS soft processor.
    There are several SPI IP varieties to choose from in Platform Designer.
    I'm not sure which SPI variant to choose and i'm not able to find a demo or documents/videos on this subject.
    The DAC is the three pin SPI DAC, so I expect that the best choice is the 'SPI-(3 wire Serial)', but I would like to confirm this. Is this the logical choice?
    What do you use most often? Example of typical code? Thanks for your help.

    Bob
    Last edited by BillyZDSP; June 14th, 2018 at 06:54 PM.

  2. #2
    Join Date
    Oct 2014
    Posts
    17
    Rep Power
    1

    Default Re: Need SPI core variant advice - Altera FPGA development kit '3-wire DAC'

    I have successfully used SPI (3 Wire Serial) to drive slow ADCs and DACs with both NIOSII/C program and HPS/Linux.

    depending on your dac type you can have different code. Mine was simple:

    Code:
    int DACSetVoltage(float V, int DACnr)
    {
        int value = DACVoltage2Bit(V); // this is my function that converts float value to binary corresponding to DAC type and reference voltage used.
        alt_u8 array[2];
        array[0] = value>>8;
        array[1] = value & 0xff;
    
        return alt_avalon_spi_command(DAC_SPI_BASE, DACnr, 2, array, 0, 0, 0);
    }

  3. #3
    Join Date
    Apr 2017
    Posts
    50
    Rep Power
    1

    Default Re: Need SPI core variant advice - Altera FPGA development kit '3-wire DAC'

    Quote Originally Posted by settem View Post
    I have successfully used SPI (3 Wire Serial) to drive slow ADCs and DACs with both NIOSII/C program and HPS/Linux.

    depending on your dac type you can have different code. Mine was simple:

    Code:
    int DACSetVoltage(float V, int DACnr)
    {
        int value = DACVoltage2Bit(V); // this is my function that converts float value to binary corresponding to DAC type and reference voltage used.
        alt_u8 array[2];
        array[0] = value>>8;
        array[1] = value & 0xff;
    
        return alt_avalon_spi_command(DAC_SPI_BASE, DACnr, 2, array, 0, 0, 0);
    }
    Thanks, settem. Which core are you using, and if you don't mind, what is the DAC part number? I may be able to figure something out from that much.

  4. #4
    Join Date
    Apr 2017
    Posts
    50
    Rep Power
    1

    Default Re: Need SPI core variant advice - Altera FPGA development kit '3-wire DAC'

    Also - When hooking up an SPI DAC to Altera FPGA, is it most common to use the DAC as master? and use a SPI slave core IP in Platform Designer? Thanks for your help.

Similar Threads

  1. Is there any altera FPGA development board with LPDDR2 ?
    By yi2fu in forum General Altera Discussion
    Replies: 2
    Last Post: June 27th, 2015, 07:36 AM
  2. Need Advice - First time PCIe device development + QSYS
    By rkirchge in forum General Altera Discussion
    Replies: 10
    Last Post: September 9th, 2013, 05:27 AM
  3. Replies: 0
    Last Post: April 6th, 2010, 12:10 PM
  4. Which FFT core to use...need some advice.
    By mmeyers in forum DSP Builder and DSP IPs
    Replies: 4
    Last Post: July 24th, 2009, 11:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •