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.

CCS/TMS320F28035: How to set or change values of variables in watch window under debug mode

Part Number: TMS320F28035
Other Parts Discussed in Thread: CONTROLSUITE, POWERSUITE, SFRA

Tool/software: Code Composer Studio

Hello,

I am doing emulation on a ILPFC c2000 development board where the controller is F28035. My CCS is version 7. The user manual of the development board gives instructions for incremental builds of the control loops and I have trouble following one of the instructions. For open loop emulation, the instructions suggests to add a variable 'DutyA' in watch window and change the value of it to change the duty ratio. I was able to add it in expression tab and see its value but not able to add it in 'variable' tab. The variable tab is empty and there is not an option 'add variable' when right click in the tab. I also noticed I can click the value of 'DutyA' in expression view and input a new value but it will not stay and will go back to the initial value after hitting enter key. It makes sense that expression tab is only to watch values during debug and is not for setting variable values but why making it possible to click and change in the value column in the first place. Bottom line is I want to update the duty ratio value on the fly in debug mode as opposed to having to change value in the code and recompile. The user manual makes it sound like a simple task to add and change 'DutyA' value but does not elaborate how to do it. Any help or suggestions will be greatly appreciated.

Frank

  • Hello,

    Zhenyu Zhao said:
    For open loop emulation, the instructions suggests to add a variable 'DutyA' in watch window and change the value of it to change the duty ratio.

    The "Watch Window" is a display from the old CCS legacy tools (CCSv3 and earlier). Hence I suspect this document you are referencing is very old.

    Zhenyu Zhao said:
    I was able to add it in expression tab and see its value but not able to add it in 'variable' tab. The variable tab is empty and there is not an option 'add variable' when right click in the tab.

    This is expected, the Variables tab will show all local variables. If you wish to specify which variables to see, and the option to add additional variables/expressions, then the Expressions view is what you wish to use. 

    Zhenyu Zhao said:
    I also noticed I can click the value of 'DutyA' in expression view and input a new value but it will not stay and will go back to the initial value after hitting enter key.

    There are varying reasons for this and it is hard to guess which reason it is without more information. Are you trying to modify the variable with the target is running? If so, is the target in real-time mode? What kind of memory are you trying to modify?

    Thanks

    ki

  • Hi Ki,

    Thank you for your reply. The document is dated 2016, I might have used my own word 'watch window' as an old habit. The exact phrase used in the user guide is 'watch view'.

    Yes, as you mentioned, I just wanted to change the duty cycle value with the target running. Thank you for pointing out about 'real time mode'. Now I have it enabled but still not able to change the value of an expression. The instructions given in the guide is pasted below but I do not know how to add a 'variable'. The user guide is also attached here. The following lines are on page 20. The variable I would like to change is DutyA and it is a variable in the initialization code of the main.c The purpose is to vary the duty cycle of the Boost converter on the fly. I guess it sets a register in epwm block for PWM modulation, Please let me know if you have any suggestion.

     sprui55(1).pdf

  • Sorry, somehow the few lines of instructions are lost in the above post. They are here again:
    To run the code, do as follows
    1. in the watch view, add DutyA as a variable
    2. Set this variable to 0.1 (1677721 in Q24)
    ---note this variable sets the duty cycle for the PFC converter
  • Thanks,
    I am able to reproduce the issue. It appears that DutyA is being set back to 0 after you manually modify it. I have forwarded the issue to the C2000 experts for more analysis.

    Thanks
    ki
  • Hi Zhenyu,

    First I want to double check the project you are working on. Is that coming from C:\ti\controlSUITE\powerSUITE\v_1_07_00_00\IL_PFC_F28035_powerSUITE ?

    If yes, please take a look at this code in the .c file:
    DutyA = SFRA_IQ_INJECT(DutyA_DC);

    Under build 1, you need to change DutyA_DC instead of DutyA because of SFRA implemented. You can put both DutyA_DC and DutyA in the watch window and change DutyA_DC. DutyA will change accordingly. Sorry for the confusion.

    Thanks,

    Best regards,
    Chen
  • Hi Chen and Ki,

    Thank you both for your replies. Yes, I also noticed DutyA_DC is the variable that I can use to update duty cycle on the fly, it seems the user guide needs to be updated.

    Thanks again

    Frank
  • Hi Zhenyu,

    Yes, we will update it and thank you for your question.

    Best regards,
    Chen
  • Hi Chen,

    I also would like to test the single phase operation of the PFC. I noticed there is an 'project option' on main.cfg GUI that seems to be used to select between '2 phase interleaved PFC' and single phase option. But that pulldown menu is always greyed out and I can not make changes to it. I then looked at the cfg script where there are two configuration registers: one called 'Kit.interleave =2' and other called 'Kit.Interleave_index=1'. Are these the registers I should change to make it work in single phase? I do not want to start messing up with the driver code to disable PWM2 as it may break something else such as timing for ADCs. Please advise how to activate the option on main.cfg GUI or if it is safe to edit the above two registers (where can I find descriptions to cfg script) . Let me know if you would like this to be in a new post. Thanks again.
  • Hi Zhenyu,

    Yes, it will be better if you could create another post on this question so that it can be better assisted and other customers might benefit from this thread in the future. Thanks.

    Best regards,
    Chen