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/TMS320F28377D: SDFM data reset after sync signal from ePWM

Part Number: TMS320F28377D

Tool/software: Code Composer Studio

Hi everyone, 

All my PWM counter is up-down count mode, I use ePWM11, 12 to reset SDFM directly. 

And latch data by CLA, triggered by ePWM2 CMPC count-up INT.

For example, by setting ePWM2.CMPC = ePWM1.CMPC = 1000, including filter latency plus 10 SDFM CLK time.

By the 28377 spec, because the SDFM data register wont be clear after reset filter module, CLA should get data.

However, the data is reset after sync SDFM, I have to set ePWM11.CPMC earlier about 2us to avoid this situation, is this normal?

Of course I notice that there should be only one CPMC event per PWM cycle,

but if I only latch data at 1000 count-up, I can ignored the result from second CMPC reset.

p.s. My question is same as question 2 in this post :

https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/624783?tisearch=e2e-sitesearch&keymatch=SDFM%20clock

  • Willie,

    Sorry, your question isn't clear and I believe there are lot of important information missing:-

    1) DOSR settings?

    2) EPWM settings:-
    - TBPRD settings
    - CMPC / CMPD settings
    - PWM frequency

    I get a feeling that you don't prefer to use SDFM data acknowledge interrupts to read SDFM data filter results and you want to use PWM1/2 interrupt to read the SDFM data filter. Am I correct? If so, after EPWM11/12 SDSYNC signal resets the SDFM data filter you have to time PWM1/2 interrupt to wait for latency of data filter + 5 SD-Cx cycles.

    Regards,
    Manoj
  • Manoj,

    Sorry for the unclear information, here they are:
    1) SDFM settings:
    -DOSR:256
    -Filter: sinc3
    -CLK: 10MHz
    -MIF: disable
    -Reset: enable

    2) EPWM settings:-
    - TBPRD : 6250 (up-down count)
    - CMPC / CMPD : 4140
    - PWM frequency: 8K

    3) CLA trigger source settings:-
    - trigger source: ePWM2 CMPC up-count
    - CMPC: 3940

    And yes, I don't use SDFM AEFx to trigger latch function, I use another ePWM counter to trigger CLA at the right time.
    The time was 3 * (256 / 10M) + 10 SDFM CLK.

    3 * (256 / 10M) + 10 SDFM CLK. = 3940



    My question is:
    Will the SDFM data register also be reset when sync signal happened?
    According to spec, the register data wont be clear after sync signal, however, if I set ePWM11.CMPC = ePWM2.CMPC = 3940 , then I will get 0.

    Willie

  • Willie,

    Yes, as the TRM mentions data filter register doesn't get reset to 0.

    Based on your SDFM, SD-modulator frequency settings, you have to wait for ((3*256) + 5) / 10MHz = 77.3 us after data filter gets SDSYNC pulse from PWM. I didn't quite understand your diagram. Also, with PWMCLK freq = 8KHz, TBCTR increments / decrements every 125 us. Why is PWMCLK freq so slow?

    Regards,
    Manoj
  • Manoj,
    Thanks for your reply.
    There is a mistake on describing the PWMCLK freq, I just means that our PWM is trigger at zero, and the period in real world is 125us, not means PWMCLK freq = 8KHz.

    As you mention,
    "Yes, as the TRM mentions data filter register doesn't get reset to 0."
    But, I found that register data is been cleared when sync, just like question 2 on this post:
    e2e.ti.com/.../624783
  • Willie,

    As mentioned in my previous post, SDSYNC pulse from PWMs DON'T reset the contents of SDFM data register. It just resets the SDFM internal DOSR counter. If you read the SDFM data register after waiting for latency of data filter + 5 additional SD-Cx period, you are guaranteed to read correct digital output.

    Regards,

    Manoj

  • Manoj,

    I still get 0 after latch data after sync signal add latency of data filter + 5 SD-Cx.
    Does it allowable to reset the modelu directly at latch? which means reset again after add latency of data filter + 5 SD-Cx.
  • Willie,

    I couldn't understand your question. Please rephrase it.

    What is the expected digital output? Did you make sure to read the SDFM data filter results after ((3*256) + 5) / 10MHz = 77.3 us after SDSYNC event?

    Regards,
    Manoj
  • Manoj, 

    For safety reason, I read data after  ((3*256) + 10) / 10MHz = 78.3 us after SDSYNC event.

    But the next SDSYNC event by ePWM11 also trigger after 78.3 us after last SDSYNC event.

    Read and SDSYNC are at the same time.

    According to my experiment, to avoid reading 0, the next SDSYNC must delay 2us, otherwise I got 0.

    I read data at CLA which is triggered by PWM counter, Is it possible that CLA is too slow so SDFM data register is cleaned for the first data after SDSYNC?

  • Willie,

    For starters, you calculations are wrong.

    ((3*256) + 10) / 10MHz = 78.3 us.

    I also don't see why you need of additional 5 SD-Cx. Reading the result at ((3*256) + 5) / 10MHz = 77.3 us should get you correct filter output result.

    Also, you cannot read the filter output / reset the data filter at the same time. This can lead to unpredictable results. That probably why you are seeing 0 in your result register.

    This is not a CLA problem and CLA isn't slow to read SDFM data register.

    Regards,
    Manoj
  • Manoj, 

    Manoj Santha Mohan said:

    I also don't see why you need of additional 5 SD-Cx. Reading the result at ((3*256) + 5) / 10MHz = 77.3 us should get you correct filter output result.

    Adding 5 SD_Cx is experiment result, maybe I did something wrong, I'll check these days.

    Manoj Santha Mohan said:

    Also, you cannot read the filter output / reset the data filter at the same time. This can lead to unpredictable results. That probably why you are seeing 0 in your result register.

    So, how long dose TI suggest the time interval between read and reset?

    If user cannot read and reset at the same time, the TRM notes "reset won't clear data" is non-sense. Or, is there an application that use this feature?

  • Willie,

    I'm not sure about your application requirement. But, I can say we have never had customers who want to reset and read the SDFM data filter at the same time.

    Regards,
    Manoj
  • Manoj Santha Mohan said:

    we have never had customers who want to reset and read the SDFM data filter at the same time.

    Thanks for your answer!

    If so, then the TRM should not mention reset won't clear data register. Because this is wrong and the action is forbidden.