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.

DSS writeRegister not working (F28069)

Hello everyone,

I need some help with reading/writing some of the registers on the 69 using DSS.

I have the following methods written in Java:

	public void SetDSSRegisterValue(String regName, long value)
	{
		try
		{
			debugSession.memory.writeRegister(regName, value);
			System.out.println("register " + regName + " written to: " + value);
		}
		catch(Exception e)
		{
			System.out.println(e);
		}
	}
	public long GetDSSRegisterValue(String regName)
	{
		System.out.println("========> DSS GetDSSRegisterValue....");
		long val = 0;
		try
		{
			val = debugSession.memory.readRegister(regName);
			System.out.println(regName + " = " + val);
		}
		catch(Exception e)
		{
			System.out.println("ex: " + e);
			val = -1;
		}
		return val;
	}

When I call SetDSSRegisterValue("GPIO_GPACTRL", 111) I read back 111 using GetDSSRegisterValue("GPIO_GPACTRL") .

When I call SetDSSRegisterValue("ePWM1_TBPRD", 111) i read back 0 using GetDSSRegisterValue("ePWM1_TBPRD").

No PWM registers seem to be updating. GPIO registers are working. Is there anything I'm missing?

I'm not having issues with reading and writing variables.

I'm using Example_2806xCpuTimer example from the Control Suite.

Thanks,

  • Hello,

    Andreea Negrea said:

    When I call SetDSSRegisterValue("ePWM1_TBPRD", 111) i read back 0 using GetDSSRegisterValue("ePWM1_TBPRD").

    No PWM registers seem to be updating. GPIO registers are working. Is there anything I'm missing?

    The syntax for the command looks right. One thing to confirm is to launch a debug session in CCS and see if you can change the value of the register via the Register view and it displays the changes.

    Thanks

    ki

  • Works fine in CCS...
  • In addition to what I wrote, I'm using this to initialize the debugging session:

    	ScriptingEnvironment env = ScriptingEnvironment.instance();
    	DebugServer debugServer = null;
    	DebugSession debugSession = null;
    	public DSS()
    	{
    		System.out.println("========> DSS constructor....");
    		try
    		{
    		    // Get the Debug Server and start a Debug Session
    		    debugServer = (DebugServer)env.getServer("DebugServer.1");
    		    debugServer.setConfig("C:/ti/controlSUITE/development_kits/F28069 controlSTICK/RT-SineFIRFFT32_v1_5/TMDX28069USB.ccxml");
    		    debugSession = debugServer.openSession("Texas Instruments XDS100v1 USB Emulator_0/C28xx");
    		    
    		    Connect();
    		   
    		    //env.traceWrite("Loading Flash...");
    		    debugSession.memory.loadProgram("C:/Users/popni1/workspace_v6_1/Example_2806xCpuTimer/Debug/Example_2806xCpuTimer.out");
    		    
    		}
    		catch(Exception e)
    		{
    			
    		}
    	}
    	public void Connect()
    	{
    		System.out.println("========> DSS connect....");
    		try
    		{
    			if(!debugSession.target.isConnected())
    			{
    				System.out.println("DSS connection: " + debugSession.target.isConnected());
    			    env.traceWrite("Connecting to device...");
    			    debugSession.target.connect();
    			    env.traceWrite("Connected.");
    			    //debugSession.target.halt();
    			}
    		}
    		catch(Exception e)
    		{
    			
    		}
    		
    	}

  • Andreea Negrea said:
    No PWM registers seem to be updating. GPIO registers are working. Is there anything I'm missing?

    Andreea - have you enabled the clock to the PWM module?  The registers read back zero if the clocks are not enabled.

  • Thank you for your answer,

    We enabled the PWM clock and now reading seems to work fine. Will post later if something else comes up.