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.

Comparator (/w Ramp generator) doesn't work when PWM tripzone action is set to hi-Z

I'm testing Comparator's ramp generator by using an example project from TI.

This project can be download from the following URL. I use LAB3 project.

processors.wiki.ti.com/.../C2000_DPSWorkshop

This project works fine, but when I change EPwm2Regs.TZCTL.TZA from TZ_FORCE_LO to TZ_HIZ

at about line 422 in main() as the following, the PWM output A goes all high.

EPwm2Regs.TZCTL.bit.TZA = TZ_HIZ;// TZ_FORCE_LO; // EPWMxA - force low

Is this a hardware bug or something else?

Jiakai

  • Hi Jiakai,

    Configuring to HIZ would tri-state the PWM outputs, meaning no value is driven - floating.
    FORCE_LO should force the output to a low state driven actively.
    No hardware bug.

    -Bharathi.
  • Hi Bharathi,

    Thank you very much!

    I have another question to ask for your help. In the same project,

    I changed the program to set the registers of PWM1/Comparator1 pair the same way

    as the settings in PWM2/Comparator2 except the following changes:

    EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 8; // comparator1

    Comp1Regs.DACCTL.bit.RAMPSOURCE = 0; // 0 - PMW1

    also in DSP_ISR1, I added the following line:

    DACDRV_RAMP 1 ; PWM1A, use DACDRV_RAMP_In1(IrefTest1) to set Ramp maximum value, this is a constant, and set to _IQ24(0.5)

    But PWM1 doesn't work like PWM2, do you have any suggestions?

    I will send you the changed project if you have time to check it.

    thank you very much.

    Jiakai 

  • Jiakai,

    Since you've changed comparator selection - that would be the first thing to check.
    Please check if the comparator input/output are as expected.

    -Bharathi.
  • Dear Bharathi,

    There is a poor contact on Comparator1 port A when I apply a scope probe to it.
    When I change the probe to a different place, PWM1/Comparator1 pair works fine.

    I am really appreciate your help. thank you very much!

    Jiakai
  • Hi Jiakai,

    That's great!!

    -Bharathi.