Modify AVR variables over RS232

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times

Modify AVR variables over RS232

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modify AVR variables over RS232

Post 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;
	}

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times

Re: Modify AVR variables over RS232

Post by Niro »

Hello Benj,

this works fine!

Many thanks,
Niro

Post Reply