---
+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 20 of 22
  1. #1
    Newbie level 1
    Points: 143, Level: 1

    Join Date
    Mar 2012
    Posts
    1
    Helped
    0 / 0
    Points
    143
    Level
    1

    sine wave with different frequency using FPGA

    hello,
    am working on a project waveform generation using fpga , i did sine wave with 1k freq(verilog, vhdl) but now i required sine wave with freq. upto 400khz plz gimmi some tips.

  2. #2
    Member level 1
    Points: 281, Level: 3

    Join Date
    Feb 2012
    Posts
    32
    Helped
    1 / 1
    Points
    281
    Level
    3

    Re: sine wave with different frequency using FPGA

    Hi!

    U want a sine wave generator, with switchable (adjustable) frequency? If this is the case, I'm doing similar project right now.
    What technic do u used for sine gen? Can u post your code?

    In most sine generators, they using a "base" frequency, so u will need an adjustable clock divider to supply adjustable base frequency to sine gen.



  3. #3
    Junior Member level 1
    Points: 479, Level: 4

    Join Date
    Aug 2011
    Location
    New Jersey, USA
    Posts
    19
    Helped
    5 / 5
    Points
    479
    Level
    4

    Re: sine wave with different frequency using FPGA

    I would create a DDS process (Direct Digital Synthesis). There is also a DDS Compiler IP Core, if you have that. But it can be hand-coded with ease. Read:

    http://en.wikipedia.org/wiki/Direct_digital_synthesizer
    http://www.analog.com/library/analog...38-08/dds.html
    http://www.analog.com/static/importe...rev12-2-99.pdf

    Basically an accumulator input into a ROM to map phase to amplitude.

    - Ryan


    1 members found this post helpful.

  4. #4
    Member level 1
    Points: 281, Level: 3

    Join Date
    Feb 2012
    Posts
    32
    Helped
    1 / 1
    Points
    281
    Level
    3

    Re: sine wave with different frequency using FPGA

    I'm using an iteration based code, it's iterates trough the values of 1/4 of a sine wave. http://www.doulos.com/knowhow/vhdl_d...ave_generator/ - just in my case, I rewriteing the code for 0 to 3.3V output.



  5. #5
    FvM
    FvM is offline
    Super Moderator
    Points: 171,616, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,800
    Helped
    8769 / 8769
    Points
    171,616
    Level
    98

    Re: sine wave with different frequency using FPGA

    It's a very "basic", fixed frequency generator. If you want to do anything with variable frequency, you should really learn about the DDS concept mentioned by Ryan. You'll also find various previous edaboard threads related to the topic.



    •   Alt21st March 2012, 12:08

      advertising

        
       

  6. #6
    Member level 3
    Points: 504, Level: 4

    Join Date
    Dec 2011
    Posts
    62
    Helped
    18 / 18
    Points
    504
    Level
    4

    Re: sine wave with different frequency using FPGA

    If you use Xilinx device, I would start from here: http://www.xilinx.com/products/intel...S_Compiler.htm . This IP is available in Xilinx Core Generator tool.

    Quote Originally Posted by Raviraj Sarje View Post
    hello,
    am working on a project waveform generation using fpga , i did sine wave with 1k freq(verilog, vhdl) but now i required sine wave with freq. upto 400khz plz gimmi some tips.
    Cheers,
    Jim



    •   Alt27th March 2012, 03:27

      advertising

        
       

  7. #7
    Member level 3
    Points: 1,382, Level: 8

    Join Date
    Aug 2007
    Location
    Germany
    Posts
    64
    Helped
    9 / 9
    Points
    1,382
    Level
    8

    Re: sine wave with different frequency using FPGA

    Hi,
    I am generating 25MHz Sine wave using DDS core. Simulation is working perfectly but hardware is not working. I am implementing simple DDS core. Can you please tell me what can be the possible reason?



  8. #8
    FvM
    FvM is offline
    Super Moderator
    Points: 171,616, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,800
    Helped
    8769 / 8769
    Points
    171,616
    Level
    98

    Re: sine wave with different frequency using FPGA

    but hardware is not working
    I fear, that's far from a clear problem description.



    •   Alt28th March 2012, 22:09

      advertising

        
       

  9. #9
    Member level 3
    Points: 1,382, Level: 8

    Join Date
    Aug 2007
    Location
    Germany
    Posts
    64
    Helped
    9 / 9
    Points
    1,382
    Level
    8

    Re: sine wave with different frequency using FPGA

    My code for the core is
    entity dds_test is
    Port (
    clk : in STD_LOGIC;
    rdy : out STD_LOGIC;
    sine : out STD_LOGIC_VECTOR(5 downto 0));
    end dds_test;

    architecture Behavioral of dds_test is
    component dds
    port (
    clk: IN std_logic;
    rdy: OUT std_logic;
    sine: OUT std_logic_VECTOR(5 downto 0));
    end component;

    begin
    Sine_wave : dds
    port map (
    clk => clk,
    rdy => rdy,
    sine => sine);

    end Behavioral;

    and simulation results are



  10. #10
    FvM
    FvM is offline
    Super Moderator
    Points: 171,616, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,800
    Helped
    8769 / 8769
    Points
    171,616
    Level
    98

    Re: sine wave with different frequency using FPGA

    O.K., the simulation looks plausible. So what's happening with the hardware design?



  11. #11
    Member level 3
    Points: 1,382, Level: 8

    Join Date
    Aug 2007
    Location
    Germany
    Posts
    64
    Helped
    9 / 9
    Points
    1,382
    Level
    8

    Re: sine wave with different frequency using FPGA

    i am assigning that 'rdy' pin to a led but led is not glowing on fpga.



  12. #12
    Advanced Member level 5
    Points: 24,623, Level: 38

    Join Date
    Jun 2010
    Posts
    4,730
    Helped
    1311 / 1311
    Points
    24,623
    Level
    38

    Re: sine wave with different frequency using FPGA

    the the LED active low?



  13. #13
    Member level 3
    Points: 1,382, Level: 8

    Join Date
    Aug 2007
    Location
    Germany
    Posts
    64
    Helped
    9 / 9
    Points
    1,382
    Level
    8

    Re: sine wave with different frequency using FPGA

    no it is active high



  14. #14
    FvM
    FvM is offline
    Super Moderator
    Points: 171,616, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,800
    Helped
    8769 / 8769
    Points
    171,616
    Level
    98

    Re: sine wave with different frequency using FPGA

    If I understand right, your DDS design has all fixed parameters and no programming interface, so RDY is actually useless. But is should work if present. Reasons that I can imagine:
    - DDS core is hold in reset
    - IO pins not assigned correctly
    - intended configuration not loaded

    There are means to check each point separately.


    1 members found this post helpful.

  15. #15
    Member level 3
    Points: 1,382, Level: 8

    Join Date
    Aug 2007
    Location
    Germany
    Posts
    64
    Helped
    9 / 9
    Points
    1,382
    Level
    8

    Re: sine wave with different frequency using FPGA

    yes, you are right all parameters are fixed. And what do you mean by DDS core is in Reset state? how i can check it?



  16. #16
    FvM
    FvM is offline
    Super Moderator
    Points: 171,616, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,800
    Helped
    8769 / 8769
    Points
    171,616
    Level
    98

    Re: sine wave with different frequency using FPGA

    If you omitted SCLR, the DDS core can be only hold in reset by the global FPGA power-on reset. Do you check, if the intended FPGA design is loaded at all? Is it clocked correctly? Are any other parts beside the DDS core working? Output pins driving out?



  17. #17
    Junior Member level 1
    Points: 479, Level: 4

    Join Date
    Aug 2011
    Location
    New Jersey, USA
    Posts
    19
    Helped
    5 / 5
    Points
    479
    Level
    4

    Re: sine wave with different frequency using FPGA

    It's good to add a heartbeat signal to every design to verify that the bit file loaded like FvM said. Just divide your clock to 2 Hz and have it clock a T flipflop and send that signal out to the LEDs. If you don't see your heartbeat, you have bigger problems than the DDS IP core



  18. #18
    Member level 3
    Points: 1,382, Level: 8

    Join Date
    Aug 2007
    Location
    Germany
    Posts
    64
    Helped
    9 / 9
    Points
    1,382
    Level
    8

    Re: sine wave with different frequency using FPGA

    [/COLOR]I just checked it that core is working perfectly but led is not glowing. Can you please tell me where the problem can be?



  19. #19
    Member level 3
    Points: 504, Level: 4

    Join Date
    Dec 2011
    Posts
    62
    Helped
    18 / 18
    Points
    504
    Level
    4

    Re: sine wave with different frequency using FPGA

    If you have access to Chipscope, I would add an ILA core and see what's going on inside the FPGA.

    Quote Originally Posted by capcas View Post
    [/COLOR]I just checked it that core is working perfectly but led is not glowing. Can you please tell me where the problem can be?
    Cheers,
    Jim



  20. #20
    Advanced Member level 5
    Points: 13,646, Level: 28
    mrflibble's Avatar
    Join Date
    Apr 2010
    Posts
    2,471
    Helped
    618 / 614
    Points
    13,646
    Level
    28

    Re: sine wave with different frequency using FPGA

    Quote Originally Posted by rhearty1 View Post
    It's good to add a heartbeat signal to every design to verify that the bit file loaded like FvM said. Just divide your clock to 2 Hz and have it clock a T flipflop and send that signal out to the LEDs. If you don't see your heartbeat, you have bigger problems than the DDS IP core
    Quote Originally Posted by jimwu88 View Post
    If you have access to Chipscope, I would add an ILA core and see what's going on inside the FPGA.
    Both good advice. A slow divided clock (2 Hz or some such) blinking a led is handy visual feedback during development. And chipscope is useful if you have to do some more invasive checking on the internals of your design. The blinky led is all of 5 minutes work, the ILA may be a little more work but will get you more debugging capabilities in return.



+ Post New Thread
Please login
Page 1 of 2 12 LastLast