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.

how to generate 800HZ signal using 28335

Other Parts Discussed in Thread: ADS8556

Hi all,

I am  using 28335 control card R1.0 with docking station. I need to generate perfect 400HZ  interrupt  signal using 28335. I have used following statements.But i am not getting the exact 400HZ .Please suggest me the remedy for this.

code:

#define CPU_RATE 6.66666667L

#if (CPU_FRQ_150MHZ)
ConfigCpuTimer(&CpuTimer0, 150, 625);
#endif
interrupt void cpu_timer0_isr(void)


   CpuTimer0.InterruptCount++;
   GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; // Toggle GPIO34 once per 625 milliseconds

// i have written mu code here which will take 100 microseconds.        




            } 
  
   PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

Thanking you

sham m v

  • Hi Sham,

    it's better to use the ePWM for this requirement.

    For more informations please take a look: http://focus.ti.com/lit/ug/sprug04a/sprug04a.pdf

     

    With best regards,

    Chris

  • You said that you'd like to have a 400 Hz interrupt service (1/400Hz = 2500 microseconds) - so why did you initialize the timer 0 to 625 milliseconds?

    A correct initialization of Timer0 would look like this:

    InitCpuTimers();

    ConfigCpuTimer(&CpuTimer0, 150, 2500);

    PieCtrlRegs.PIEIER1.bit.INTx7 = 1;

    IER |= 1;

    EINT;

    C

    puTimer0Regs.TCR.bit.TSS = 0; // start timer

    Of course, you have to initialize the PIE vector table as well.

    A CPU timer is well suited for your purpose.

     

  • Dear sir,Frank Bormannf


    Thanks for replying to my query.I've just started working on DSP.Your teaching ROM is of great help to me. I am using 28335 control card to acquire
    16 bit data from ADS8556 EVM.My requirement is to take 16 samples in one fundamental cycle of 50 HZ i.e (exact 800hz sampling frequency).I need to generate
    start of conversion(50% duty cycle) signal as shown in the figure below. kindly suggest me the proper resource/configuration that should be used to generate the signal.
    Also i request you to give a skeletal program to configure external interrupt(XINT) on 28335 control card. I intend to connect the end of conversion signal to XINT.Kindly help me sir.

     

                                  S/c signal

    Thanking you,

    sham M.V

    Phd scholar, National institute of technology,India

     

  • Sorry but I cannot view your image. Please try to add the image as file attachment.

  • Dear sir, sorry for the trouble actually i have insered the image but later on it did not uploaded. I am forwarding the Start of conversion signal for your kind reference.

    Thanking you,

    sham m v