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
Modify AVR variables over RS232
Moderator: Benj
- 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
Hello Niro,
You should be able to use C functions such as these to read and write to address locations on the AVR.
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;
}Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel