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: Motorware mainISR executing slower than expected while debugging in CCS

Part Number: TMS320F28069
Other Parts Discussed in Thread: MOTORWARE

I'm running into a strange issue while trying to debug an Instaspin motorware application on the F28069F.  When I run the debugger in CCS the mainISR seems to be executing at a much slower rate than it should be.  The mainISR should be triggered off the completion of the ADC interrupt but it seems to be at a much slower rate.  I have one breakpoint that updates the expression view enable and its in the main function, not mainISR.  Without the breakpoint enable I think it executes at the correct rate.  Not sure as I can't debug it.  Still issues with the code but can't see the expressions to debug.  The other strange thing is if I setup the breakpoint to update all windows it doesn't update the expressions and the code doesn't seem to execute fully.  It does turn on the status LED of my board but doesn't turn on the Run_Identify flag which turns on another LED.  I think it may be halting execution instead of continuing.

This wasn't an issue until recently, so I'm sure I fat fingered something.  What am I missing.

Thanks, John

  • Are you using TI hardware kit like controlCard or LaunchPad-F28069? If you are using own board, you should check HAL_setupClks() and HAL_setupPll() if the clock is configured correctly according to your board.

    And also, check the PWM and control frequencies are set correctly in user.h as you want.

    #define USER_PWM_FREQ_kHz                (15.0)

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK        (1)

    #define USER_NUM_ISR_TICKS_PER_CTRL_TICK       (1)

  • USER_SYSTEM_FREQ_MHz  is 90

    USER_PWM_FREQ_kHz is 10, I've tried setting that faster but the board faults out

    TICKS for ISR and CTRL are 1

    I only see the declaration of HAL_setupClks() in hal.h, don't see it called in main().  Should it be?

    I see no reference to HAL_setupPll() either declared or called.

    Thinking back over the last couple of weeks I believe all my issues starting coincide with me upgrading from CCS 10.3 to 10.4.  This morning I just uninstall both and reinstalled 10.4 but no change.  Tried enabling Silicon Real-Time mode and that didn't make a difference either.  Guess I should try going back to 10.3.

    BTW this issue is why I haven't replied to my other posting of regarding the V16 motor control issue.  This version of the code was running and controlling the motor fine at lower RPM before I upgraded to CCS 10.4.  Since then I haven't been able to turn a motor will debugging in CCS.

  • More info.  I uninstalled 10.4 and reinstalled 10.3 and the mainISR started running at the appropriate rate.  However, with a breakpoint enabled to update all windows it wouldn't turn the motor.  With the breakpoint disabled code works as expected and it's back to turning the motor.

    Are there specific recommendations for where Motorware/Instaspin breakpoints should be or not be? 

  • You might check the PWM output signals with an oscilloscope if the switching frequency is 10kHz as you set. 

    HAL_setupClks() is called in HAL_setParams() in hal.c. You need to set the clock according to the oscillator or crystal you used on the board.

    You can't set any breakpoints in the ISR when you try to run a motor.