SPRAD72 February 2023 TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DK-Q1
GUID-51E9DAC2-DD7F-4FD8-9914-374C1F854478.html#GUID-51E9DAC2-DD7F-4FD8-9914-374C1F854478 described the method to read and write the PHY register with C2000 ESC. To simplify the approach, a script can be used to read or write the PHY register dump and print in the console window in CCS during the debug phase.
The General Extension Language (GEL) can be used to configure the Code Composer Studio™ development environment and to initialize the target CPU. GEL is an interpreted language, and the syntax is similar to that of C. A rich set of built-in GEL functions are available, or custom GEL functions can be written. This document describes ways to create well-written GEL start-up files. For a summary of recommendations, see GEL Guidelines.
The step-by-step guide is detailed in the following list:
Frequently accessed GEL functions can be added to the GEL menu of the Code Composer Studio menu bar as shown in #GUID-F80DB2E5-2210-4A4C-B6AD-89D44C419502. To do this, use the "menuitem" keyword to create a new drop-down list of menu items under the GEL menu. Then use the keywords "hotmenu", "dialog", or "slider" to add new menu items in the most recent drop-down list. When the user-defined menu item is selected (under the GEL menu), a dialog box or slider object appears. The example code follows:
menuitem "ESC SMI configuration";
hotmenu C2000_ESC_PHY_Reg_Dump()
{}
The method of reading and writing registers in the gel file needs to be rewritten because there is no intervention of library functions. The example code follows:
ESC_readWordISR(unsigned short wordValue, unsigned short address)
{
unsigned short *p_address;
p_address = (unsigned short *) address;
wordValue = *p_address;
}
ESC_writeWordISR(unsigned short wordValue, unsigned short address)
{
unsigned short *p_address;
p_address = (unsigned short *) address;
wordValue = *p_address;
}
Finally, find the PHY register dump in the console window as #GUID-C1752419-4012-4F52-9A88-B56CC44D7642 shows.