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/TMS320F28035: CCS/TMS320F28035 PWM control question

Part Number: TMS320F28035


Tool/software: Code Composer Studio

now  I can set PWM couter and use example in AU set higt   and DB set dead time use PWM chopper 
fast time i set PWM1 in AU set secend time set AU clear but if i have many step cant control i want step I want control SIX PWM
I do not know how to control the output individually, control all hight or all low  or PWM output。 

  • I find i use DB block so cant any change for i want step how can i set DB cant influences control pwm because i want protection At the same time conduction PWM1 A and PWM 1B open
  • user516295938,

    I am having a hard time understanding your post. Is my understanding correct?

    • You want to individually control 6 PMWs.
      • PWMxA and PWMxB must have the same frequency.
        • This is set by EPwmxRegs.TBPRD.
      • PWMxA and PWMxB can have different duties.
        • This can be controlled by CMPA or CMPB and AQCTLA or AQCTLB.
      • PWM1 and PWM2 can have different frequencies. 
        • This can be done by having EPwm1Regs.TBPRD and EPwm2Regs.TBPRD set to different values.

    • You want to be able to set all PWMs High or all PWMs low.
      • You should look at the trip zone submodule.
      • The trip zone submodule can force all PWMs high, low, or to a high-impedance state.

    If I didn't answer your question please let me know.

    Regards,
    Cody 

  • PWMxA and PWMxB must have the same frequency. I know the same frequency
    and fast question PWM frequency
    this is my set


    EPwm1Regs.TBPRD = 2000; // Period = TBCLK counts
    EPwm1Regs.TBPHS.half.TBPHS = 0; // Set Phase register to zero
    EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
    EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
    EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
    EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
    EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
    EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
    EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
    EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero

    i think the cycle is (1/60MHZ)*2000 *2 it is right? how to know PWM i think examole dont set Pre-removal for anyother

    second question i use PWM chopper control duty
    if(x=1)
    {
    EPwm1Regs.AQCTLA.bit.ZRO = AQ_CLEAR;
    EPwm1Regs.AQCTLB.bit.ZRO = AQ_SET;
    EPwm1Regs.CMPA.half.CMPA = 1000;
    EPwm1Regs.CMPB = 1000; //this i set pwm b all higt
    EPwm1Regs.PCCTL.bit.CHPEN=0;
    EPwm1Regs.PCCTL.bit.OSHTWTH=15;
    EPwm1Regs.PCCTL.bit.CHPFREQ=3;
    EPwm1Regs.PCCTL.bit.CHPDUTY=3;
    }
    else if (x=2)
    {
    EPwm1Regs.AQCTLB.bit.ZRO = AQ_CLEAR;
    EPwm1Regs.AQCTLA.bit.ZRO = AQ_SET; // this set PWM A higt and get duty
    EPwm1Regs.CMPA.half.CMPA = 1000;
    EPwm1Regs.CMPB = 1000;
    EPwm1Regs.PCCTL.bit.CHPEN=1;

    }
    i use this control duty this is right? have anyother Register better control and DB i dont how to set is good because i dont use in CAU or CBU change status dont have RED FED
  • user516295938,

    There were a lot of things stated in your post, I pulled the question and statements out of your post and did my best to answer them.

    • i think the cycle is (1/60MHZ)*2000 *2 it is right?
      • Yes, assuming your SYSCLK frequency is 60MHz.
    • how to know PWM i think examole dont set Pre-removal for anyother
      • Sorry, I don’t understand this statement.  
    • second question i use PWM chopper control duty
    • i use this control duty this is right?
      • The easiest way to control the duty is using the compare registers CMPA, CMPB, etc.
    • have anyother Register better control and DB i dont how to set is good because i dont use in CAU or CBU change status dont have RED FED
      • I’m not sure I fully understand this question. However, if you would like to add a dead band to the signal this can be easily done by configuring RED and FED. You should read section 2.5 “Dead-Band Generator (DB) Submodule”, it explains how to configure dead bands.

    Regards,
    Cody