The standard debug practice is to watch local and
global variables while debugging code. There are various methods for doing this in CCS, such
as memory views and watch views. Additionally, CCS has the ability to create time (and
frequency) domain plots. This ability allows the user to view waveforms using the graph
tool. For information on how to set up and configure the graph tool, see Section 4.5.1. For information on setting up the Expressions window, see the following
instructions.
- Setup watch window: Click View →
Expressions on the menu bar to open an Expressions watch window. Variables can be
added to the Expressions window by clicking Add new expression within the
Expressions window and entering the name of the variable and then pressing enter. The
number format that the variable value is displayed in is based on the number format
associated with the variable when the variable value was declared. You can change the
desired number format for a particular variable by right clicking on the variable and
navigating to Number Format and selecting the desired format.
- Alternately, a group of variables can be imported
into the Expressions window by right clicking within the Expressions window and clicking
Import, browse to the directory of the project at
<workspace>\universal_motorcontrol_am263x_r5fss0-0_nortos_ti-arm-clang\src_control\debug\,
select the universal_motor_control_level1.txt file, and click OK to import the
variables shown in Figure 4-13.
Note: Some of the variables have not
been initialized at this point in the main code and can contain some useless
values.
- Note: the structure of variables motorVars_M1 has references to most variables that are related to controlling motor drive.
- Click on the Continuous Refresh button in the top
right corner of the Expressions Window tab to enable periodic capture of data from the
Microcontroller. By clicking the View Menu button (the 3 dots in the upper right
hand corner of the Expressions window),you can select Continuous Refresh Interval
and edit the refresh rate of the Expressions window. Note that choosing too fast an
interval can affect performance.