TMS320F280039-Q1: DB register update delay

Part Number: TMS320F280039-Q1
Other Parts Discussed in Thread: PMP41006

Hi experts,

I ask this for my customer.

My customer use DB to modify the High-level duty cycle, the DB configuration is showed in below

They use TIMER to generate the ISR, and will update the TBPRD and DB register value

TIMER is not sync with PWM, PWM1 and PWM2 is sync.

They want PWM1 and PWM2 is same

Now they find sometimes PWM2 DB update will delay one PWM period, that cause PWM1 output is not same as the PWM2 output

image.png

And if they update PWM2 firstly and then update PWM1, PWM1 DB update will delay one PWM period compared to PWM1

Could you help to:

1.what may cause DB update take effect in next PWM cycle although they use immediate mode? I don't know the update sequence between DB and other register: for example, is it required that DB update should earlier than TBPRD update? Or is it required that DB update should earlier than the rise edge?

2.Do we have recommend configuration for their requirement?

BRs

Shuqing

  • Also add the AQ configuration for this

  • Hi Shuqing

    The issue may happen because DB and Period values updated at different time in software and they loaded in immediate mode. Customer can use below options to sync the update of PWMs

    1. Sync the counter of PWM1 and 2. Use shadow load mode for period and DB updates and load them to active register together, for example at counter =0 of PWM1.

    2. Use global load: Set the period and DB in global load mode and use global loading. For detail, please refer to the TRM.

    Thank you 

    Amir Hussain

  • Hi Amir,

    Still don't understand the relationship between DB and TBPRD, is it means I should update DB before the TBPRD or what?

    And I also ask customer to capture the EPWM A/B waveform, is it means the DBRED is not take effect but DBFED take effect? When it will happened?

    They have already use shadow mode for CMP and TBPRD, and load event use the zero event, is it cause by: DBRED update later than rising edge? Or other reasons?

    BRs

    Shuqing

  • Hi Shuqing

    "Still don't understand the relationship between DB and TBPRD, is it means I should update DB before the TBPRD or what?"

    [AH] There is no defined relation between the update of DB and period. Whatever is updated in software first gets loaded first in immediate load mode. 

    "is it means the DBRED is not take effect but DBFED take effect? When it will happened?"

    [AH] No, I feel there are not loaded to active register together.

     "DBRED update later than rising edge? Or other reasons?"

    [AH] In the immediate mode DBRED will update earlier than the AQ module update. 

    You mentioned that CMP and TBPRD are loaded through shadow register. I will suggest to add DB update to shadow load mode as well. 

    Also, we have an LLC based reference design, pmp41006. Please ask customer to refer this design and go through EPWM settings.

    Thank you 

    Amir Hussain

  • In the immediate mode DBRED will update earlier than the AQ module update. 

    I means if DBRED update earlier than AQ module and TBPRD update, what will happen? Is it cause the DB take effect in next period?

    BRs

    Shuqing

  • Hi Shuqing

    In immediate mode, the DB will take effect immediately after it is modified.

    Thank you

    Amir Hussain