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.

CCS/TMS320F28379D: TMS320F28379D

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

With the example code '2837x_RFFT_ADC', I set

sampling frequency: 2kHz

ePWM1 period: 20000

ePWM1 duty cycle:10000

With a 200Hz sine input, it should be 10 points per cycle.

But, the output has 12 points per cycle.

How can I make the output point to 10 point/cycle?

  • I think the way the EPWM period is set gives you a sampling frequency of 2500, so you end up with 12.5 points per cycle. 

    #define EPWM_HSPCLKDIV          1           //EPWM_CLOCK is SYSCLK/(2*2)

    So you will have to calculate the EPWM period with EPWM_CLOCK = 50MHz

    for a sampling frequency of 2KHz, EPWM_PERIOD = EPWM_CLOCK/fs

                                                                                      = 50MHz/2000 = 25000

    duty cycle should be 12500

  • Dear Vishal Coelho.
    Thank you for your reply.

    I tried
    ePWM1_PERIOD 25000;
    ePWM1_duty cycle 12500;

    And, now I have 8 points per cycle.


    I have questions as wondering
    1. Can I make these points set exactly to 10 points per cycle?
    2. What does these values 25000/12500 mean? Do they mean time or counter?

    Thank you!

  • Oh, my mistake. I got 10 points per cycle! Thank you!
    So, question number 1 can be neglected!

    Thank you
  • I have one more question.

    This is FFT mag plot for this project (with the same input)

    it should have a peak at 200Hz but it isn't.

    FFT mag plot setting is

    Do I have anything wrong for FFT plotting?