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.

TMS320F280049C-Q1: Tpwm & TBCTR HiResolution

Part Number: TMS320F280049C-Q1


Hi Expert,

My customer is referring to 7.11.3 Enhanced Pulse Width Modulator in TMS320F004x Datasheet (SPRS945F)

ePWMxA/ePWMxB signals can be controlled with HiResolution steps (150ps min) by HRPWM module.
Also, Time-Base Period can be set by TBPRD and TBPRDHR registers.

Customer question is:
1) Can user set PWM Period Tpwm or PWM Frequency Fpwm with HiResolution steps (150min) by TBPRD and TBPRDHR ?
2) Does TBCTR below have HiResolution steps (150ps min) ?

Best regards,
Saito

  • Hi,

    Can user set PWM Period Tpwm or PWM Frequency Fpwm with HiResolution steps (150min) by TBPRD and TBPRDHR ?

    Yes, Period can be controlled in High resolution steps.

    2) Does TBCTR below have HiResolution steps (150ps min) ?

    No, TBCTR counts at maximum of SYSCLK rate only. PWM at low resolution is generated using TBCTR and High resolution is applied using a different circuit (7.11.4 High-Resolution Pulse Width Modulator (HRPWM))

  • Thank you, Subrahmanya.

    Please let me ask additional question. I need to understand more deeply since customer is asking more.

    I am referring to 18.15.1.5.4 High Resolution Period in F28004x TRM (aprui33d.pdf) as well.

    I understand that Tpwm of ePWMxA can be controlled by setting TBPRD and TBPRDHR in Hi resolution steps. (150ps min).
    On the other hand, TBCTR counts at TBCLK in regular steps. (regular PWM step is 10nsec when TBCLK=100Mhz)

    I thought ePWMxA (with Hi resolution) is made by TBCTR counts-up or down, though. My understanding seems wrong..

    Question:
    - How is Tpwm of ePWMxA made in Hi resolution steps ? Is it based on TBCTR only or additional counter as well ?
    - I mean, Is there any additional fractional counter in hi resolution steps in addition to TBCTR, which is internal and hidden in Time-Base or HRPWM sub module ?

    Best regards,
    Saito

  • Hi,

    - How is Tpwm of ePWMxA made in Hi resolution steps ? Is it based on TBCTR only or additional counter as well ?

    Yes, it's done by additional logic, not the TBCTR counter. High resolution is obtained using proprietary delay line based architecture. 

    - I mean, Is there any additional fractional counter in hi resolution steps in addition to TBCTR, which is internal and hidden in Time-Base or HRPWM sub module ?

    It's not exactly an additional fractional counter, but functionally it's equivalent micro step delay based architecture as i said above. From a user standpoint, this can be viewed as logic offering high precision beyond TBCTR.

  • Hi Subrahmanya,

    Customer is still confused.

            Subrahmanya said:
            It's (ePWMxA signal for Hi Resolution Tpwm) is done by additional logic, not the TBCTR counter. 
            High resolution is obtained using proprietary delay line based architecture. 

    How about Event Trigger for Hi Resolution such as CMPA / CMPB ?
    CMPA/CMPB is compared with TBCTR to make trigger event. Does CMPA/CMPB or TBCTR use a delay line for high resolution as well ?
    I am also confused how to synchronize between ePWMxA Tpwm High resolution and Event trigger using CMPA/CMPB.

    E2E_Tpwm TBCTR HiResolution.xlsx

    Best regards,
    Saito

  • Hi,

    How about Event Trigger for Hi Resolution such as CMPA / CMPB ?
    CMPA/CMPB is compared with TBCTR to make trigger event. Does CMPA/CMPB or TBCTR use a delay line for high resolution as well ?

    Event trigger using CMPA/CMPB is not in high resolution mode. These events will be in low resolution mode only - w.r.t TBCLK of PWM.
    CMPA:CMPAHR (or CMPB:CMPBHR) together determine the edge placement.
    CMPA is used with TBCTR for edge generation, then is further applied using delaylines using CMPAHR to determine fine edge placement.

    I am also confused how to synchronize between ePWMxA Tpwm High resolution and Event trigger using CMPA/CMPB.

    PWM outputs will be high resolution but events will not be in high resolution. Typically, events are generated w.r.t. the middle of the ON time of the PWM for ADC sampling etc. This can be generated CMPA/B/C/D, counter zero/PRD match events. These events are based of TBCTR (no HR). 

  • Hi Subrahmanya

    Sorry for asking many times, since I need more deep lecture.

    “PWM outputs ePWMxA will be high resolution but events will not be in high resolution because the events are based of TBCTR.”
    I understand that. but not clear in details.

    Unclear point that I have is :
        ePWMxA is delayed with delay line, which is calculated by both TBPRD and TBPRDHD register.
        On the other hand, TBCTR is count up or down by TBPRD only.

    For instance)

      18.15.1.5.4 High Resolution Period (sprui33d.pdf)
          TBCLK                                     = 10 ns (100 MHz)
          Required PWM frequency       = 175 kHz (period of 571.428)
          Number of MEP steps per coarse step at 180 ps (MEP_ScaleFactor)  =   55 (10 ns / 180 ps)
          Value to keep TBPRDHR within range of 1-255 and fractional              = 0.5 (0080h in Q8 format)
          rounding constant (default value)

      In that case,
           -    ePWMxA Period   = 1/175kHz = 5.71428 usec = 571.428 * 10nsec --> (TBPRD=570 : (integer period value)-1, and TBPRDHR= Frac(571.428) <<8)
           -    TBCTR Period     = 5.71 usec                           = 571 * 10nsec -->  (TBPRD = 570)

    Thus, ePWMxA period is different with TBCTR period. Not same exactly.

    “How does C2000 make same period between ePWMxA period and TBCTR period ?”
    This is still un-clear.

    Could you please give me explanation of these mechanism ? 

    Best regards,
    Saito

  • Hi,
    No problem with multiple questions, feel free to ask and clarify your understanding.

    Unclear point that I have is :
        ePWMxA is delayed with delay line, which is calculated by both TBPRD and TBPRDHD register.
        On the other hand, TBCTR is count up or down by TBPRD only.

    That's correct. TBPRD is used as period for the coarse counter TBCTR. TBPRDHR is used to attain the high resolution using delay mechanism.

    Thus, ePWMxA period is different with TBCTR period. Not same exactly.

    “How does C2000 make same period between ePWMxA period and TBCTR period ?”
    This is still un-clear.

    Could you please give me explanation of these mechanism ? 

    Yes, the TBCTR period (with is TBPRD) is not same as the output PWM ePWMxA period. Because the ePWMxA period will correspond to the TBPRD:TBPRDHR together (i.e. integer and fractional portion). As I said earlier, in the high resolution period control mode, the delay line based algorithm will generate the final PWM with fractional component of the period included in the ePWMxA output. This is already addressed in the design of the module. This is an algorithm implemented in hardware which is transparent to the users - it's not a simple linear delay. From the use standpoint, you should expect to see high resolution ePWMxA output with fractional component incorporated.
    Are you observing any specific issue? If so, please highlight the same so that we can discuss those aspects specifically.