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.

TMS570LC4357: Is there an atomic way to enable/disable multiple N2HET-PWM outputs?

Part Number: TMS570LC4357

I have a new design that is using both the EPWM for motor-PWMing, but also 4 of the N2HET outputs (to drive both the hi-side and lo-side with symmetric PWMing, which takes 4 pins). This all works, except I am seeing my power-supply collapse occasionally, which suggests shoot-through (both the hi-side and lo-side FETs on at the same time). I'm not sure, but I think it is occurring on PWM-disable, and to disable the 4 N2HET PWM outputs, I am changing each of the 4 pins N2HET instruction (the en_pin_action bit in the control register of the N2HET instruction), so to fully disable the 4 N2HET outputs is taking many CPU cycles (reading the control register and clearing each en_pin_action bit).

Is there an atomic way to disable the 4 N2HET PWM outputs? I am thinking of writing to the hetREG1->Dir register to clear all 4 bits (set as input) in one write, which I am going to test. But I wanted to see if you had a better suggestion.

Thanks,

Jim

  • Hi Jim,

    Why don't you try the Turn OFF.

    --
    Thanks & regards,
    Jagadish.

  • I was concerned about the sentence in that register that states "does not affect the state of the pin". The CPU is executing asynchronously to the N2HET, so I might change this register with one FET on, and it stays on. I need to set all 4 pins either low or as an input (because they are pulled down), and try to do all 4 pins at once.

    Thanks,

    Jim

  • Hi Jim,

    I need to set all 4 pins either low or as an input (because they are pulled down), and try to do all 4 pins at once.

    That might be not possible with Turn OFF, if we did turn off the program execution will get stop after the completion of program loop and pin states will not affect here, they will be in continue to stay in their respective state of after completion of current program loop. That might be either ON or OFF.

    However, after TURN OFF the N2HET, you can change the pin states to low one after another right? is that a problem?

    --
    Thanks & regards,
    Jagadish.

  • If the turn on/off only takes affect at the end of the cycle, that is good news. I am using symmetric PWMing (with the adjacent N2HET pin as an XOR of the primary pin), so at the end of every cycle, the pins are low. Thanks.