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.

debugging a motor drive application



Hello,
 
I am using the TMS320C2000 Experimenter Kit with a F28335 and CCS 5.1.1.00031
 
I would like my pwm's to go to a high-z state whenever debug mode is suspended or terminated, to prevent everything from exploding.  Currently they stay stuck at a high or low state whenever it is suspended, and they continue running whenever it is terminated.  I have tried creating a .gel file with the following code:
 
OnHalt()
{
GEL_Reset();
}
 
This kind of works for suspending, but it acts like it is continuously called, instead of just being called once when suspend is clicked.  This does nothing if terminate is clicked.
 
Any suggestions on how to get my pwm's to a high-z state?
 
Thanks
  • Luke,

    I would recommend looking at the FREE, SOFT bits within the ePWM module's TBCTL register to see if anything there can do something you'd want.

    The documentation for this is found in the ePWM User's Guide.


    Thank you,
    Brett

  • Hi Brett,
     
    Thanks for the reply.  I've tried using the FREE, SOFT bits. Setting them to 00 or 01 will stop the PWMs when emulation is suspended, but will not set them to a high-z state.  The issue with this is ePWMa and ePWMb are set up to be complimentary and one is always left high and one is always left low after a suspend (I could work with both being left high or low...but would prefer high-z).  I can almost get the functionality I want using the gel file described above, but I'm having a hard time finding good documentation on writing gel files.  "Example of GEL usage with file i/o for code composer studio v2.1" and "Creating device initialization GEL files" are the only good resources I've found so far.
     
    Thanks again,
    Luke
  • Luke,

    One other idea that I believe would work for you would be to use the trip zone inputs:

    First configure a OSHT trip zone such that it makes PWM1A and 1B (for example) go to Hi-Z on a trip event.  You could then, via software, cause a trip zone event.  The next step would then be to have the GEL file write to this 'force a trip' address 'on Halt'.

    ---

    As an aside, this would also be how I would recommend handling other faults that your software may see.  So understanding the trip-zone submodule's functionality may be beneficial for other reasons as well. :)


    Thank you,
    Brett

  • Hi Brett,

    Thanks for your help on this issue.  I ended up using your suggestion and used a software trip zone event.  I was really hoping for some solution where if suspend or terminate were clicked, a trip zone event would be triggered.  OnHalt() has very little documentation available and it seems janky at best.  The current workaround is OK, however, I know there will be many switches damaged due to students forgetting to set the software flag before clicking suspend or terminate.  If there's somewhere to request features in upcoming releases, I would like to see this in there.  Most users working with switching power supplies are going to run into this same issue.

    Thanks again,

    Luke

  • Luke,

    I wasn't aware the project was largely educational in nature, and I now understand the concern.  I have a potential idea that I've seen done in someone else's code based on OnHalt (I think).  I'll see if the person that did it is willing to share.  I'll report back if I hear something positive.


    Thank you,
    Brett

  • Dear Luke,

    Brett asked me to send you this GEL file.  We use it in our digital power design workshops to stop the students from blowing up the boards by accidentally halting the debugger.

    We have edited the OnHalt() section to take the PWMs to 3 ticks on halt. I think it takes the PWM A channel Low and B Channel High for complimentary PWM but I am not sure. Anyway if you look at the file you should be able to edit it to make it behave in the way that you want it.

    Please note that it takes about 30ms to act. For a motor control application this should not be a problem.

    You can download from:

    www.biricha.com/downloads/f28335.gel

    Hope this helps

    Regards

    Dr Ali Shirsavar

    Biricha Digital Power

  • This is definitely something I can work off of.  Thanks!