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.

Closed loop Sine Generation with PICOLO 28027

Other Parts Discussed in Thread: CONTROLSUITE

Hi

           Any one Tell me that    Please guide me that how to generate the Closed loop Sine PWM .i Know how to generate the Sine Pwm but i need closed loop configeration please .

  • hi

    I am using piccolo mcu f28027 and I want to generate a sine wave of 130Hz approx and 5V amplitude. 

    Can you help me with that please.

    Thank you,

  • Also, can the generated sine wave can be given out to a pin so that it can be used to drive something?

    Thank you so much!

  • Neha,

    Within controlSUITE you can find the "C28x Signal Generation Library".  This and the included documentation should help you to generate a sine wave.  You could then output this to a PWM pin and then put a low-pass filter on it to get a smooth sine wave.

    Note that the F28x is only able to output a maximum of 3.3V.


    Thank you,
    Brett

  • Thank you so much for the quick reply Brett. It is really helpful.

  • Brett,

     

    I was trying to run the Single channel SIN generator from the control suite but that is program is for F2833x and I am using F28027

    I am not sure what all changes I have to do to make it work. 

    Can you please help me with that...

    Thanks,

  • Hi

              You Can Go Through The TI Control Suite in that u will find the the Libraie--> Signal Generation library Yuo Can find the Sine Generation Methods .that it will more helpfull to you to generate Sine wave.

  • Hi,

    As suggested, I am using Signal generation library for sine wave. I am using the first method first example code and that asks to 

    "Edit Linker command file for the look up table"  

    Can anyone tell me how to do that as it gives me error according to the way I am editing by adding that line in the data section of command file.

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

    Or I tried using the following code but it is giving me three errors:

    1. errors encountered during linking; "sin_gen.out" not built sin_gen line 0 1322842956720 643

    2. run placement fails for object "SGENipcb", size 0x200 (page 1).  Available ranges: SGEN         size: 0x200        unused: 0x200        max hole: 0x200 sin_gen line 0

    3. unresolved symbol _SGENT_1_calc, first referenced in ./source/sgent1.obj sin_gen line 0 1322842956720 642

    Code:

    #include "DSP28x_Project.h"     // Device Headerfile and Examples Include File

    #include <sgen.h>

    #define SIGNAL_LENGTH 512

    /* Create an instance of Signal generator module    */

    SGENT_1 sgen = SGENT_1_DEFAULTS;  

    #pragma DATA_SECTION(ipcb, "SGENipcb");

    int ipcb[SIGNAL_LENGTH];  

     int x1;

    void main()

    {    

       unsigned long i;

        InitSysCtrl();

       DINT;

       InitPieCtrl();

       IER = 0x0000;

       IFR = 0x0000;

       InitPieVectTable();

       EINT;   // Enable Global interrupt INTM

       ERTM;   // Enable Global realtime interrupt DBGM

     

    /* Signal Generator module initialisation           */ 

    sgen.offset=0;

    sgen.gain=0x7fff; /* gain=1 in Q15 */

    sgen.freq=5369; /* freq = (Required Freq/Max Freq)*2^15 */

    sgen.step_max=1000; /* Max Freq= (step_max * sampling freq)/65536 */

     

        for(i=0;i<SIGNAL_LENGTH;i++)

            {

            ipcb[i]=0;

            }

        for(i=0;i<SIGNAL_LENGTH;i++)

            {

            sgen.calc(&sgen);

            x1=sgen.out;

            ipcb[i]=x1;

            }        

     

      for(;;);

     

    }  /* End: main() */

    Changes to CMD file:

    Memory Page 1:

    SGEN   : origin = 0x009001, length = 0x000200

    Sections:

    SGENipcb         : > SGEN,    PAGE = 1

     

    Thank you so much,

  • PLease somebody reply... please....

  • Finally able to solve it..

    It was because I didn't add the C28x_sgen_lib.lib , sgt1c. asm, SINTB360.asm files.

     

  • Hi neha,

     I am Sagar. I am also using the sin gen library for 3 phase sine wave generation.

    where you used the sgen.out1,sgen.out2,sgen.out3?

    I applied sgen.out1,sgen.out2,sgen.out3 to the pwm.

    If I connected the RC ckt to output of Pwm I didnt get sine wave.which is I expected.

    I added the C28x_sgen_lib.lib , sgt1c. asm, SINTB360.asm files.

    Is there need to include this file.

    in Linker Command file 

    SINTBL  :>FLASHE, PAGE = 0       // Section area

    Regards,

    sagar