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.

TMS320F28335 - About Timer INT and ePWM compare timing

Other Parts Discussed in Thread: TMS320F28335Part Number: TMS320F28335

Question type: Development and troubleshooting

Support topic: /Product/Development and troubleshooting/

Description of the problem: I want to adjust ePWM compare timing to timer INT and want timer INT frequency to be twice PWM frequency.
In case of the following case, What value is setting in TIMERxPRD Register and ePWM Time-Base Period Register (TBPRD)?
<>
(1) Time-Base Up-Count Mode
(2) Time-Base Period Shadow Mode
(3) LOADAMODE:Load on either CTR = Zero or CTR = PRD (I use CMPA only.)
(4) Prescale Register is same as Timer prescale resister, system clock / 1.

I think,
In case of TIMERxPRD = (TBPRD-1)/2,
ePWM compare timing adjust timer INT.

is it correct?

Please give me your expertise.


  • Hi,

    I believe it would be TIMERxPRD = (TBPRD+1)/2 -1

    PWM_freq = 10K
    CPU_freq = 150M

    TBPRD = CPU_freq / PWM_freq - 1 = 14999
    TIMERxPRD = 7499


    ===

    The CPUTimer method you described is viable.

    If you wanted, you could instead use another ePWM or an eCAP peripheral to generate your TBPRD/2 interrupts.  If done this way, hardware synchronization features could be used to force alignment, if desired. 


    Thank you,
    Brett

  • Hi,
    Thank you for your answer.
    I believe my equation meaning is same as the equation meaning you showing.

    And, thank you for your suggestion.
    Is "another ePWM" meaning HRPWM?

    If so, I will confirm and consider using another ePWM, HRPWM or eCAP.

    Thank you,
  • Hi,

    "Is another "ePWM" meaning HRPWM?"

    Not necessarily.  For example, if ePWM1 is the PWM output to your FETs, then ePWM2 could be configured to be ePWM1_PRD / 2. 
    ePWM2 would then be responsible for generating the interrupts you need. 
    ePWM1 would generate a synch pulse every ePWM1_PRD.  ePWM2's timer would synchronize with ePWM1 when it receives the synch pulse.

    Good luck in your application!


    Thank you,
    Brett