// Inport DSS and Java Package var start = 0 while (start < 1 ){ switch (start){ case 0: print("40V`60V"); print(""); var start_t = readline("Press Enter"); if (start_t == 1 ){ start++; } break; } } importPackage(Packages.com.ti.debug.engine.scripting); importPackage(Packages.com.ti.ccstudio.scripting.environment); importPackage(Packages.com.ti.dvt.engine.scripting); importPackage(Packages.java.lang); // Modify these viriables to match your environment. use forward slashes var ccs7InstallDir = "C:/ti/ccsv7"; var DSSWorkshopDir = "C:/ti/xdctools_3_50_02_20_core/packages/xdc/rov/dss"; var deviceCCXMLFile = "C:/workspace_CCSv7/lab1/NPP0001-V1.00-02/C28/F28034.ccxml"; var programToLoad = "C:/workspace_CCSv7/lab1/NPP0001-V1.00-02/C28/Debug/C28.out"; var LogFile = "C:/workspace_CCSv7/lab1/log.xml"; //Create the Scripting Environment Object var script = ScriptingEnvironment.instance(); // Create a log file to log script execution script.traceBegin(LogFile, "C:/workspace_CCSv7/lab1/DefaultStylesheet.xsl"); // Set trace levels for console and logs script.traceSetConsoleLevel(TraceLevel.INFO); script.traceSetFileLevel(TraceLevel.ALL); script.traceWrite("Begin scripting session"); // Get the Debug Server and start a Debug Session var debugServer = script.getServer("DebugServer.1"); debugServer.setConfig("C:/workspace_CCSv7/lab1/NPP0001-V1.00-02/C28/F28034.ccxml"); var debugSession = debugServer.openSession(".*"); // Connect to the CPU debugSession.target.connect(); script.traceWrite("Connecting to device..."); //session.target.connect(); script.traceWrite("Connected"); // Load a program debugSession.memory.loadProgram("C:/workspace_CCSv7/lab1/NPP0001-V1.00-02/C28/Debug/C28.out"); print(["debugSession.target.run"]) // Run the target debugSession.target.runAsynch(); // load(["C:/workspace_CCSv7/lab1/vin.js"]); load(["C:/workspace_CCSv7/lab1/charge.js"]); load(["C:/workspace_CCSv7/lab1/vout.js"]); load(["C:/workspace_CCSv7/lab1/iout.js"]); // var a = print(" "); print("------------------------------------------------------------------------"); print("Vin_Gain:"+ vin_gain_new); print("Vin_Offset:"+ vin_offset_new); print("Vout_Gain:"+ vout_gain_new); print("Vout_Offset:"+ vout_offset_new); print("Iout_Gain:"+ iout_gain_new); print("Iout_Offset:"+ iout_offset_new); debugSession.memory.writeData(0,0x00009980,1,16); var ROM_Write =debugSession.memory.readData(0,0x00009980,16); print([ROM_Write]); readline("Press Enter"); var ROM_Write =debugSession.memory.readData(0,0x00009980,16); print([ROM_Write]); // All done debugServer.stop(); script.traceWrite("End scripting session"); // Stop logging and exit. script.traceEnd();