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.

TMS320F28069: EMUSTOP Source and Function

Part Number: TMS320F28069


What exactly is EMUSTOP sourced from in the ePWM module? I am including the following code in my ePWM setup       

EPwm1Regs.TZSEL.bit.OSHT5 = TZ_ENABLE; /* Halt on CLK Loss */        \

EPwm1Regs.TZSEL.bit.CBC6 = TZ_ENABLE; /* Shut down EMUSTOP */        \

EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; /* Shut off PWM */            \

EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; /* Shut off PWM */            \

Basically if TZ6 is asserted (EMUSTOP) shut down the PWM - doesn't seem to work though. Kind of like to shut off the motor when I am in emulation halt FYI.

  • Hello,

    EMUSTOP is an output signal from the CPU, and it is used to turn off the PWM when the CPU halts as you said.

    Your configuration code looks accurate. My suggestions for debugging are: Have you verified that these registers are written to as expected using the Registers window in CCS debug mode? How do you check that the PWM is still running ie is TBCTR still incrementing?

    Regards,
    Elizabeth
  • I verified that the PWM is still running with a scope hanging on the pwm outputs.

    Now did a little more debugging - put in a asm ("      ESTOP0"); to be executed 10S after pwm started and sure enough pwm stops cleanly so this makes me think PWM stops when the CPU Stops as expected- but really looking for something to stop PWM when the red Terminate button on the debug window of CCS is clicked.  Now when I click Run>Reset>CPU Reset it also shuts the PWM off, as well as when I click Run>Suspend so I have workarounds - so only q is can I configure the red Terminate button to suspend processor before leaving the Debug window?

    Just many of these processors are used in power critical applications - moving multi-HP motors for example. Leaving the PWM locked in a sate can have some disastrous consequences for hardware. Perhaps not this version of CCS - but would certainly look into adding it.

  • No, the CCS terminate button terminates the debug session right away. Good to hear you have workarounds and thanks for the feedback.

    Regards,
    Elizabeth