Page 1 of 1

Modify AVR variables over RS232

Posted: Fri Jan 28, 2011 6:06 pm
by Niro
Hello all,

I'm trying to figure out how to change variables, running on the AVR via RS232 connection. Actually I have a flowcode software running on the AVR, which variables I want to modify remotely over RS232, i.e. I'd like to send somthing like the variables name (or pointer to the variable) and associated data to the AVR to modify it while the AVR is running. But I really don't know how to manage this with Flowcode, since I didn't find any pointer capabilities.
Does anybody have an idea about a solution?

Many thanks,
Niro

Re: Modify AVR variables over RS232

Posted: Mon Jan 31, 2011 12:12 pm
by Benj
Hello Niro,

You should be able to use C functions such as these to read and write to address locations on the AVR.

Code: Select all

	char read_reg(unsigned int address)
	{
		char RetVal;

		volatile char* register_ptr = (char*)address;

		RetVal = *register_ptr;

		return RetVal;
	}


	void write_reg(unsigned int address, char data)
	{
		volatile char* register_ptr = (char*)address;

		*register_ptr = data;
	}

Re: Modify AVR variables over RS232

Posted: Fri Feb 04, 2011 1:12 pm
by Niro
Hello Benj,

this works fine!

Many thanks,
Niro