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.

TMS320F28375S: High resolution on CMPA AND CMPB

Part Number: TMS320F28375S

Hello,

as in a title, is it possible to make CMPA and CMPB high resolution?

Here is what I am trying to do:

Count-mode : count-up

Output(let's say PWM3A) is high at CTR = CMPB

Output (PWM3A) is low at CTR = CMPA

PWM3A is controlled so as to be shifted from PWM1A. The amount to shift is decided by CMPB and the amount should be the high-reso.

The on-width is controlled by CMPA as you can see. The on-width also should be controlled in high-reso.

But according to the section 14.14.1.3 of the datasheet, the MEP is "programmed to be controlled either from the CMPAHR / CMPBHR register..."

If you take the sentence straightforward, it seems impossible to do what I want to do.

But there are two registers to determine edge modes that correspond to each CMPx.

This means, the edge mode can be individually set for corresponding CMPx and thus I assumed setting CMPA and CMPB high resolution is possible.

So I tried the following but it didn't work as intended.

CTLMODEB = 00b

EDGMODEB = 01b as CMPB controls the L to H timing of PWM3A.

CTLMODEA = 00b

EDGMODEA = 10b as CMPA controls the H to L timing of PWM3A.

So, back to the first question, is it possible to set CMPA AND CMPB high resolution?

And if yes, then what is the problem with my current settings?

Thanks,

Yukihiro Hatagishi

  • Hi,

    user3605066 said:

    So, back to the first question, is it possible to set CMPA AND CMPB high resolution?

    And if yes, then what is the problem with my current settings?



    No. CMPA and CMPB can not be used with HIgh resolution on PWMA output.
    CMPA is tied to PWMA and CMPB is tied to PWMB output.
    It's not possible to have the configuration like you mentioned below.

    Output(let's say PWM3A) is high at CTR = CMPB

    Output (PWM3A) is low at CTR = CMPA

    While using HR, PWMA is inherently linked to the CMPA and PWMB is linked to CMPB HR component.
    This restriction doesn't apply if you are not using HR.

  • Thank you, Subrahmanya-san.

    Some more questions in response to your answer:

    1) With your comments and what is written in datasheet, I understand CMPAHR as HR only for PWMxA and CMPB as HR only for PWMxB. Is this correct?

    2) Will setting CMPAHR as BE allow PWM3A's rise and fall timing high resolution on my current settings?

    3) Does RE on HRCFG's EDGMODEA mean the rise edge of PWMxA generated by AQ? Or DB (out A in this case)?

    4) PWM3B is generated by adding DBFED to PWMxA from AQ and inverting it.

    In this case, is it capable to make PWM3B high resolution by setting CMPBHR?

    I have checked some of the characteristics on hardware but I want to know how it is designed.

  • Hi,

    user3605066 said:

    1) With your comments and what is written in datasheet, I understand CMPAHR as HR only for PWMxA and CMPB as HR only for PWMxB. Is this correct?

    Correct.

    user3605066 said:

    2) Will setting CMPAHR as BE allow PWM3A's rise and fall timing high resolution on my current settings?



    Yes, but both rising and falling edges will have same delay of CMPAHR - so it'll show up as phase shift

    user3605066 said:

    3) Does RE on HRCFG's EDGMODEA mean the rise edge of PWMxA generated by AQ? Or DB (out A in this case)?


    It would be with DB.

    user3605066 said:

    4) PWM3B is generated by adding DBFED to PWMxA from AQ and inverting it.

    In this case, is it capable to make PWM3B high resolution by setting CMPBHR?


    Yes. PWM3B will have CMPBHR

    If you are using Deadband i recommend that you use up-down count mode instead of up-count mode.
    Due to limitation of edge placement - first edge has to be in first 3 cycles after counter zero (including deadband), that makes up-count mode practically unusable with dead band. Up-down count mode would be more suitable option for your case.

  • Well noted, Subrahmanya-san.

    I appreciate the answers.