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.

MSP430 with CCE: Disable output at debugger interruption

Hello all,

on my DC/DC converter application (step-up), the MSP430 drives the switching transistor. The MSP430 output corresponds to a PWM from some timer, and the whole system works amazingly well.

Whenever I interrupt the running µC program from the debugger, the MSP430 will stop, and so will the PWM output. If it is high at the time of the interruption, I will have a direct short from battery to GND. This usually leads to the transistor going up in smoke, literally leaving smoldering ruins.

Is there any way (e.g. using the watchdog) to perform a specific task just before the debugger stops the program? I do have a main switch controlled by the MSP430, and switching it off while the debugger has stopped the program would be just fine.

Thank you,

Max

  • Maximilian Gauger said:
    Is there any way (e.g. using the watchdog) to perform a specific task just before the debugger stops the program?

    No. The debugger stops the CPU and the clocks. So there is nothing that could be executed, as there is nobody who could execute it. Unfortunalely, as you learned the hard way, the debugger does not freeze time for the rest of the world too, th ecthe transistor chokes (and smokes).

    You can configure the debugger to NOT halt the clocks. This means that timers will continue (and therefore the PWM), but also that interrupts may pile up while you are single-stepping.

    Alternatively, you can implement some fail-safe mechanisms into your PWM logic. Such as a hardware monoflop between MSP and transistor, so the transistor will block inf the monoflop doesn't detect a PWM signal edge every now and then (preventing a permanent high level). I used this to esnure that out laser supply doesn't drive the laser when there is no processor anymore that checks for temperature and controls the cooling. After a few ms, the monoflop will switch the laser off if there is no watchdog signal is coming from the CPU anymore (which usually comes every ms, software controlled !).

    Most PWM H-bridge drivers do implement an overcurrent/PWM fail detection circuit of this or a similar kind. Of course a simple transistor doesn't.

  • Hi Max,

    Here are a couple of possible ideas:

    1. If you do not necessarily need to put a breakpoint at a specific line of code, you could enable interrupts on the timer module that is generating the PWM, and in the ISR put an if statement checking if the CCI bit is currently 0 (which will tell you the output state of the PWM is low). Follow the if with a __no_operation(); Then you can place your breakpoint on the __no_operation() statement that should only be reached if your PWM output is low.

    2. You may want to try using one of the breakpoint action options under "Breakpoint Properties." You can do this by right-clicking on your breakpoint and going to "breakpoint properties." Under Action you can select other options than the default "remain halted". For example, you can set the breakpoint to refresh your watch window instead so that you can see the new value of a variable etc. Now, this will still halt your MSP430 for a short amount of time, so this may or may not still be bad for your system, but it will immediately start the target back up again after it has refreshed the window. (I'm not sure which CCS version you are using, but I know this is possible in 4 and 5).

    For more help with ccs breakpoints, a good resource is the CCS forum: http://e2e.ti.com/support/development_tools/code_composer_studio/f/81.aspx

    Regards,

    Katie

**Attention** This is a public forum