This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SMJ320F2812- Sample sine wave gerneration

Hi Hareesh,

One of our customer(the same) is trying to generate simple sine wave using the F2812 using IQsin and the below error shows up.Can you please help?

"I am trying to generate a sinusoidal waveform using F2812. In the literatures 2 methods were proposed.

1) Using _IQsin.

   My code is like this

 

  " ....

    #define     PI 3.141592

    _iq     Input     =    _IQ(0.0);

    _iq     Sin_out  =    _IQ(0.0);

 

    main()

    {

           ...

 

        Input        =    _IQ29(0.25*PI);

     Sin_out    =    _IQ29sin(Input);

 

        ...

     }

   Its showing an error

 

    " #10099-D</a>  program will not fit into available memory.  placement with alignment/blocking fails for section "IQmathTables" size 0xb50 page 0. 

Available memory ranges: "

 

  and following warnings

 

   "

#10247-D creating output section "IQmath" without a SECTIONS specification

    

#10247-D creating output section "IQmathTables" without a SECTIONS

specification  

 

#16002-D build attribute vendor section TI missing in

"../IQmath.lib<IQ29sin.obj>": compatibility cannot be determined    

 

#16002-D build attribute vendor section TI missing in

"../IQmath.lib<IQmathTables.obj>": compatibility cannot be determined

"

 

   I have used "2812_RAM_lnk.cmd" as the linker file and "IQmath.lib" as Runtime support library. I have only bare minimum of other code to make it out of memory.

  • Mahesh,

    >> #10247-D creating output section "IQmath" without a SECTIONS specification
    >> #10247-D creating output section "IQmathTables" without a SECTIONS

    The linker is telling you that you haven't told it where to link these sections in the .cmd file.  You need to add these sections to the linker command file.  Please see the IQmath User's Guide.

    >> #16002-D build attribute vendor section TI missing in
    >> "../IQmath.lib<IQ29sin.obj>": compatibility cannot be determined   

    >> #16002-D build attribute vendor section TI missing in
    >> "../IQmath.lib<IQmathTables.obj>": compatibility cannot be determined

    These are harmless warnings.  The IQmath library was built with an older version of the codegen tools.  Newer versions have some additional fields of information, so the codegen tools are telling you it cannot find this information for the IQmath lib.  You can ignor this.  If you search the e2e forums for "build attribute" you will find many previous posts on this:

    >>  " #10099-D</a>  program will not fit into available memory.  placement with alignment/blocking fails for section "IQmathTables" size 0xb50 page 0. 

    The linker is telling you it cannot fit the section IQmathTables in the memory that it is trying to put it.  Considering that you didn't tell the linker where to put this section per the previous warning, I would fix that warning first.  After that, if you still get this error, you need to adjust the linker .cmd file so things fit.  You may need to combine some contiguous memory blocks into a single block.  If you cannot get everything to fit in RAM, you will need to start using flash.

    Regards,

    David

  • Thank you David.
    Lastly, which method is better to generate a precise sine wave among the below two?
    High precision sine signal generator library, sgen.h or the _IQsin?
  • Mahesh,

    Mahesh KC03 said:

    Lastly, which method is better to generate a precise sine wave among the below two?
    High precision sine signal generator library, sgen.h or the _IQsin?

    I don't really know the exact differences between the two.  I think they both use similar methods, but again don't know for sure.  The sgen lib, e.g. SGENHP_1 function, outputs a 16-bit value.  IQsin outputs a 32 bit value.  But in terms of accuracy IQsin maybe no more accurate.  Again, I don't really know.  You will have to try them.

    Regards,

    David

  • Hi,

    Customer tried to generate 1KHz sine waveform (at 100KHz throughput) using sgenhp_1 and converted the same using a DAC and identified the 1KHz signal from FFT. But, when he tried to generate another frequency (7.1KHz), he isseeing a 8-10 Hz shifted signal in FFT. Is this explained?
  • Hi,
    Any update here?
  • Where is the cutt off frequency of the filter they are using for DAC? 

  • They are not using any filter. DAC output is directly connected to frequency spectrum analyzer.
  • Can you please update on this? It is quite some time since this was posted.
  • Mahesh,

    I think Manish is referring to the low-pass filter attached to the PWM output (for example R-C).

    -Tommy

  • Hi Tommy,
    Can you please let me which filter you are talking about. The C200 bit output is given directly to the DAC and the DAC output is analysed using FFT. I don't think there is any filter used in this interface.